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

fddi: convert to new network device ops

Similar to ethernet. Convert infrastructure and the one lone FDDI
driver (for the one lone user of that hardware??). Compile tested only.

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
145186a3 007c3838

+19 -9
+12 -7
drivers/net/skfp/skfddi.c
··· 168 168 #define PRINTK(s, args...) 169 169 #endif // DRIVERDEBUG 170 170 171 + static const struct net_device_ops skfp_netdev_ops = { 172 + .ndo_open = skfp_open, 173 + .ndo_stop = skfp_close, 174 + .ndo_start_xmit = skfp_send_pkt, 175 + .ndo_get_stats = skfp_ctl_get_stats, 176 + .ndo_change_mtu = fddi_change_mtu, 177 + .ndo_set_multicast_list = skfp_ctl_set_multicast_list, 178 + .ndo_set_mac_address = skfp_ctl_set_mac_address, 179 + .ndo_do_ioctl = skfp_ioctl, 180 + }; 181 + 171 182 /* 172 183 * ================= 173 184 * = skfp_init_one = ··· 264 253 } 265 254 266 255 dev->irq = pdev->irq; 267 - dev->get_stats = &skfp_ctl_get_stats; 268 - dev->open = &skfp_open; 269 - dev->stop = &skfp_close; 270 - dev->hard_start_xmit = &skfp_send_pkt; 271 - dev->set_multicast_list = &skfp_ctl_set_multicast_list; 272 - dev->set_mac_address = &skfp_ctl_set_mac_address; 273 - dev->do_ioctl = &skfp_ioctl; 256 + dev->netdev_ops = &skfp_netdev_ops; 274 257 275 258 SET_NETDEV_DEV(dev, &pdev->dev); 276 259
+1
include/linux/fddidevice.h
··· 27 27 #ifdef __KERNEL__ 28 28 extern __be16 fddi_type_trans(struct sk_buff *skb, 29 29 struct net_device *dev); 30 + extern int fddi_change_mtu(struct net_device *dev, int new_mtu); 30 31 extern struct net_device *alloc_fddidev(int sizeof_priv); 31 32 #endif 32 33
+6 -2
net/802/fddi.c
··· 167 167 168 168 EXPORT_SYMBOL(fddi_type_trans); 169 169 170 - static int fddi_change_mtu(struct net_device *dev, int new_mtu) 170 + int fddi_change_mtu(struct net_device *dev, int new_mtu) 171 171 { 172 172 if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN)) 173 173 return(-EINVAL); 174 174 dev->mtu = new_mtu; 175 175 return(0); 176 176 } 177 + EXPORT_SYMBOL(fddi_change_mtu); 177 178 178 179 static const struct header_ops fddi_header_ops = { 179 180 .create = fddi_header, 180 181 .rebuild = fddi_rebuild_header, 181 182 }; 182 183 184 + 183 185 static void fddi_setup(struct net_device *dev) 184 186 { 185 - dev->change_mtu = fddi_change_mtu; 186 187 dev->header_ops = &fddi_header_ops; 188 + #ifdef CONFIG_COMPAT_NET_DEV_OPS 189 + dev->change_mtu = fddi_change_mtu, 190 + #endif 187 191 188 192 dev->type = ARPHRD_FDDI; 189 193 dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */