Skip to content

Commit 748ff68

Browse files
Stephen Hemmingerdavem330
authored andcommitted
hippi: convert driver to net_device_ops
Convert the HIPPI infrastructure for use with net_device_ops. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fd8f499 commit 748ff68

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

drivers/net/rrunner.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ MODULE_LICENSE("GPL");
6363

6464
static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002 Jes Sorensen ([email protected])\n";
6565

66+
67+
static const struct net_device_ops rr_netdev_ops = {
68+
.ndo_open = rr_open,
69+
.ndo_stop = rr_close,
70+
.ndo_do_ioctl = rr_ioctl,
71+
.ndo_start_xmit = rr_start_xmit,
72+
.ndo_change_mtu = hippi_change_mtu,
73+
.ndo_set_mac_address = hippi_mac_addr,
74+
};
75+
6676
/*
6777
* Implementation notes:
6878
*
@@ -115,10 +125,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
115125
spin_lock_init(&rrpriv->lock);
116126

117127
dev->irq = pdev->irq;
118-
dev->open = &rr_open;
119-
dev->hard_start_xmit = &rr_start_xmit;
120-
dev->stop = &rr_close;
121-
dev->do_ioctl = &rr_ioctl;
128+
dev->netdev_ops = &rr_netdev_ops;
122129

123130
dev->base_addr = pci_resource_start(pdev, 0);
124131

include/linux/hippidevice.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ struct hippi_cb {
3232
};
3333

3434
extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev);
35-
35+
extern int hippi_change_mtu(struct net_device *dev, int new_mtu);
36+
extern int hippi_mac_addr(struct net_device *dev, void *p);
37+
extern int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p);
3638
extern struct net_device *alloc_hippi_dev(int sizeof_priv);
3739
#endif
3840

net/802/hippi.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
144144

145145
EXPORT_SYMBOL(hippi_type_trans);
146146

147-
static int hippi_change_mtu(struct net_device *dev, int new_mtu)
147+
int hippi_change_mtu(struct net_device *dev, int new_mtu)
148148
{
149149
/*
150150
* HIPPI's got these nice large MTUs.
@@ -154,21 +154,23 @@ static int hippi_change_mtu(struct net_device *dev, int new_mtu)
154154
dev->mtu = new_mtu;
155155
return(0);
156156
}
157+
EXPORT_SYMBOL(hippi_change_mtu);
157158

158159
/*
159160
* For HIPPI we will actually use the lower 4 bytes of the hardware
160161
* address as the I-FIELD rather than the actual hardware address.
161162
*/
162-
static int hippi_mac_addr(struct net_device *dev, void *p)
163+
int hippi_mac_addr(struct net_device *dev, void *p)
163164
{
164165
struct sockaddr *addr = p;
165166
if (netif_running(dev))
166167
return -EBUSY;
167168
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
168169
return 0;
169170
}
171+
EXPORT_SYMBOL(hippi_mac_addr);
170172

171-
static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
173+
int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
172174
{
173175
/* Never send broadcast/multicast ARP messages */
174176
p->mcast_probes = 0;
@@ -181,6 +183,7 @@ static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
181183
p->ucast_probes = 0;
182184
return 0;
183185
}
186+
EXPORT_SYMBOL(hippi_neigh_setup_dev);
184187

185188
static const struct header_ops hippi_header_ops = {
186189
.create = hippi_header,
@@ -190,11 +193,12 @@ static const struct header_ops hippi_header_ops = {
190193

191194
static void hippi_setup(struct net_device *dev)
192195
{
193-
dev->set_multicast_list = NULL;
196+
#ifdef CONFIG_COMPAT_NET_DEV_OPS
194197
dev->change_mtu = hippi_change_mtu;
195-
dev->header_ops = &hippi_header_ops;
196198
dev->set_mac_address = hippi_mac_addr;
197199
dev->neigh_setup = hippi_neigh_setup_dev;
200+
#endif
201+
dev->header_ops = &hippi_header_ops;
198202

199203
/*
200204
* We don't support HIPPI `ARP' for the time being, and probably

0 commit comments

Comments
 (0)