Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Hemminger and committed by
David S. Miller
748ff68f fd8f4997

+23 -10
+11 -4
drivers/net/rrunner.c
··· 63 63 64 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 77 * Implementation notes: 68 78 * ··· 125 115 spin_lock_init(&rrpriv->lock); 126 116 127 117 dev->irq = pdev->irq; 128 - dev->open = &rr_open; 129 - dev->hard_start_xmit = &rr_start_xmit; 130 - dev->stop = &rr_close; 131 - dev->do_ioctl = &rr_ioctl; 118 + dev->netdev_ops = &rr_netdev_ops; 132 119 133 120 dev->base_addr = pci_resource_start(pdev, 0); 134 121
+3 -1
include/linux/hippidevice.h
··· 32 32 }; 33 33 34 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 38 extern struct net_device *alloc_hippi_dev(int sizeof_priv); 37 39 #endif 38 40
+9 -5
net/802/hippi.c
··· 144 144 145 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 150 * HIPPI's got these nice large MTUs. ··· 154 154 dev->mtu = new_mtu; 155 155 return(0); 156 156 } 157 + EXPORT_SYMBOL(hippi_change_mtu); 157 158 158 159 /* 159 160 * For HIPPI we will actually use the lower 4 bytes of the hardware 160 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 165 struct sockaddr *addr = p; 165 166 if (netif_running(dev)) ··· 168 167 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 169 168 return 0; 170 169 } 170 + EXPORT_SYMBOL(hippi_mac_addr); 171 171 172 - static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) 172 + int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) 173 173 { 174 174 /* Never send broadcast/multicast ARP messages */ 175 175 p->mcast_probes = 0; ··· 183 181 p->ucast_probes = 0; 184 182 return 0; 185 183 } 184 + EXPORT_SYMBOL(hippi_neigh_setup_dev); 186 185 187 186 static const struct header_ops hippi_header_ops = { 188 187 .create = hippi_header, ··· 193 190 194 191 static void hippi_setup(struct net_device *dev) 195 192 { 196 - dev->set_multicast_list = NULL; 193 + #ifdef CONFIG_COMPAT_NET_DEV_OPS 197 194 dev->change_mtu = hippi_change_mtu; 198 - dev->header_ops = &hippi_header_ops; 199 195 dev->set_mac_address = hippi_mac_addr; 200 196 dev->neigh_setup = hippi_neigh_setup_dev; 197 + #endif 198 + dev->header_ops = &hippi_header_ops; 201 199 202 200 /* 203 201 * We don't support HIPPI `ARP' for the time being, and probably