equal
deleted
inserted
replaced
76 // net_device functions |
76 // net_device functions |
77 int ec_eoedev_open(struct net_device *); |
77 int ec_eoedev_open(struct net_device *); |
78 int ec_eoedev_stop(struct net_device *); |
78 int ec_eoedev_stop(struct net_device *); |
79 int ec_eoedev_tx(struct sk_buff *, struct net_device *); |
79 int ec_eoedev_tx(struct sk_buff *, struct net_device *); |
80 struct net_device_stats *ec_eoedev_stats(struct net_device *); |
80 struct net_device_stats *ec_eoedev_stats(struct net_device *); |
|
81 |
|
82 /*****************************************************************************/ |
|
83 |
|
84 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
85 static const struct net_device_ops ec_eoedev_ops = { |
|
86 .ndo_open = ec_eoedev_open, |
|
87 .ndo_stop = ec_eoedev_stop, |
|
88 .ndo_start_xmit = ec_eoedev_tx, |
|
89 .ndo_get_stats = ec_eoedev_stats, |
|
90 }; |
|
91 #endif |
81 |
92 |
82 /*****************************************************************************/ |
93 /*****************************************************************************/ |
83 |
94 |
84 /** EoE constructor. |
95 /** EoE constructor. |
85 * |
96 * |
136 ret = -ENODEV; |
147 ret = -ENODEV; |
137 goto out_return; |
148 goto out_return; |
138 } |
149 } |
139 |
150 |
140 // initialize net_device |
151 // initialize net_device |
|
152 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) |
|
153 eoe->dev->netdev_ops = &ec_eoedev_ops; |
|
154 #else |
141 eoe->dev->open = ec_eoedev_open; |
155 eoe->dev->open = ec_eoedev_open; |
142 eoe->dev->stop = ec_eoedev_stop; |
156 eoe->dev->stop = ec_eoedev_stop; |
143 eoe->dev->hard_start_xmit = ec_eoedev_tx; |
157 eoe->dev->hard_start_xmit = ec_eoedev_tx; |
144 eoe->dev->get_stats = ec_eoedev_stats; |
158 eoe->dev->get_stats = ec_eoedev_stats; |
|
159 #endif |
145 |
160 |
146 for (i = 0; i < ETH_ALEN; i++) |
161 for (i = 0; i < ETH_ALEN; i++) |
147 eoe->dev->dev_addr[i] = i | (i << 4); |
162 eoe->dev->dev_addr[i] = i | (i << 4); |
148 |
163 |
149 // initialize private data |
164 // initialize private data |