diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 23:32:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 23:32:15 -0500 |
commit | 748ff68fad9600593c6abe47856037602bd5d133 (patch) | |
tree | 96bc5e90ba9f66932562a7061f7403d17b316b61 | |
parent | fd8f4997e35f2c9a8bfc4d797ec09a6ae7858e04 (diff) |
hippi: convert driver to net_device_ops
Convert the HIPPI infrastructure for use with net_device_ops.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/rrunner.c | 15 | ||||
-rw-r--r-- | include/linux/hippidevice.h | 4 | ||||
-rw-r--r-- | net/802/hippi.c | 14 |
3 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index 6e4131f9a93..b4e3ddd0b59 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
@@ -63,6 +63,16 @@ MODULE_LICENSE("GPL"); | |||
63 | 63 | ||
64 | static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002 Jes Sorensen (jes@wildopensource.com)\n"; | 64 | static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002 Jes Sorensen (jes@wildopensource.com)\n"; |
65 | 65 | ||
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 | |||
66 | /* | 76 | /* |
67 | * Implementation notes: | 77 | * Implementation notes: |
68 | * | 78 | * |
@@ -115,10 +125,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev, | |||
115 | spin_lock_init(&rrpriv->lock); | 125 | spin_lock_init(&rrpriv->lock); |
116 | 126 | ||
117 | dev->irq = pdev->irq; | 127 | dev->irq = pdev->irq; |
118 | dev->open = &rr_open; | 128 | dev->netdev_ops = &rr_netdev_ops; |
119 | dev->hard_start_xmit = &rr_start_xmit; | ||
120 | dev->stop = &rr_close; | ||
121 | dev->do_ioctl = &rr_ioctl; | ||
122 | 129 | ||
123 | dev->base_addr = pci_resource_start(pdev, 0); | 130 | dev->base_addr = pci_resource_start(pdev, 0); |
124 | 131 | ||
diff --git a/include/linux/hippidevice.h b/include/linux/hippidevice.h index bab303dafd6..f148e490841 100644 --- a/include/linux/hippidevice.h +++ b/include/linux/hippidevice.h | |||
@@ -32,7 +32,9 @@ struct hippi_cb { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); | 34 | 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); | ||
36 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); | 38 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); |
37 | #endif | 39 | #endif |
38 | 40 | ||
diff --git a/net/802/hippi.c b/net/802/hippi.c index e35dc1e0915..313b9ebf92e 100644 --- a/net/802/hippi.c +++ b/net/802/hippi.c | |||
@@ -144,7 +144,7 @@ __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
144 | 144 | ||
145 | EXPORT_SYMBOL(hippi_type_trans); | 145 | EXPORT_SYMBOL(hippi_type_trans); |
146 | 146 | ||
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) |
148 | { | 148 | { |
149 | /* | 149 | /* |
150 | * HIPPI's got these nice large MTUs. | 150 | * HIPPI's got these nice large MTUs. |
@@ -154,12 +154,13 @@ static int hippi_change_mtu(struct net_device *dev, int new_mtu) | |||
154 | dev->mtu = new_mtu; | 154 | dev->mtu = new_mtu; |
155 | return(0); | 155 | return(0); |
156 | } | 156 | } |
157 | EXPORT_SYMBOL(hippi_change_mtu); | ||
157 | 158 | ||
158 | /* | 159 | /* |
159 | * For HIPPI we will actually use the lower 4 bytes of the hardware | 160 | * For HIPPI we will actually use the lower 4 bytes of the hardware |
160 | * address as the I-FIELD rather than the actual hardware address. | 161 | * address as the I-FIELD rather than the actual hardware address. |
161 | */ | 162 | */ |
162 | static int hippi_mac_addr(struct net_device *dev, void *p) | 163 | int hippi_mac_addr(struct net_device *dev, void *p) |
163 | { | 164 | { |
164 | struct sockaddr *addr = p; | 165 | struct sockaddr *addr = p; |
165 | if (netif_running(dev)) | 166 | if (netif_running(dev)) |
@@ -167,8 +168,9 @@ static int hippi_mac_addr(struct net_device *dev, void *p) | |||
167 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | 168 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); |
168 | return 0; | 169 | return 0; |
169 | } | 170 | } |
171 | EXPORT_SYMBOL(hippi_mac_addr); | ||
170 | 172 | ||
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) |
172 | { | 174 | { |
173 | /* Never send broadcast/multicast ARP messages */ | 175 | /* Never send broadcast/multicast ARP messages */ |
174 | p->mcast_probes = 0; | 176 | p->mcast_probes = 0; |
@@ -181,6 +183,7 @@ static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) | |||
181 | p->ucast_probes = 0; | 183 | p->ucast_probes = 0; |
182 | return 0; | 184 | return 0; |
183 | } | 185 | } |
186 | EXPORT_SYMBOL(hippi_neigh_setup_dev); | ||
184 | 187 | ||
185 | static const struct header_ops hippi_header_ops = { | 188 | static const struct header_ops hippi_header_ops = { |
186 | .create = hippi_header, | 189 | .create = hippi_header, |
@@ -190,11 +193,12 @@ static const struct header_ops hippi_header_ops = { | |||
190 | 193 | ||
191 | static void hippi_setup(struct net_device *dev) | 194 | static void hippi_setup(struct net_device *dev) |
192 | { | 195 | { |
193 | dev->set_multicast_list = NULL; | 196 | #ifdef CONFIG_COMPAT_NET_DEV_OPS |
194 | dev->change_mtu = hippi_change_mtu; | 197 | dev->change_mtu = hippi_change_mtu; |
195 | dev->header_ops = &hippi_header_ops; | ||
196 | dev->set_mac_address = hippi_mac_addr; | 198 | dev->set_mac_address = hippi_mac_addr; |
197 | dev->neigh_setup = hippi_neigh_setup_dev; | 199 | dev->neigh_setup = hippi_neigh_setup_dev; |
200 | #endif | ||
201 | dev->header_ops = &hippi_header_ops; | ||
198 | 202 | ||
199 | /* | 203 | /* |
200 | * We don't support HIPPI `ARP' for the time being, and probably | 204 | * We don't support HIPPI `ARP' for the time being, and probably |