aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/lec.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r--net/atm/lec.c60
1 files changed, 23 insertions, 37 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 8f701cde5945..e5e301550e8a 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -152,7 +152,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
152 buff += 4; 152 buff += 4;
153 mesg->content.normal.flag = *buff & 0x01; /* 0x01 is topology change */ 153 mesg->content.normal.flag = *buff & 0x01; /* 0x01 is topology change */
154 154
155 priv = (struct lec_priv *)dev->priv; 155 priv = netdev_priv(dev);
156 atm_force_charge(priv->lecd, skb2->truesize); 156 atm_force_charge(priv->lecd, skb2->truesize);
157 sk = sk_atm(priv->lecd); 157 sk = sk_atm(priv->lecd);
158 skb_queue_tail(&sk->sk_receive_queue, skb2); 158 skb_queue_tail(&sk->sk_receive_queue, skb2);
@@ -218,7 +218,7 @@ static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
218 218
219static int lec_open(struct net_device *dev) 219static int lec_open(struct net_device *dev)
220{ 220{
221 struct lec_priv *priv = (struct lec_priv *)dev->priv; 221 struct lec_priv *priv = netdev_priv(dev);
222 222
223 netif_start_queue(dev); 223 netif_start_queue(dev);
224 memset(&priv->stats, 0, sizeof(struct net_device_stats)); 224 memset(&priv->stats, 0, sizeof(struct net_device_stats));
@@ -252,7 +252,7 @@ static void lec_tx_timeout(struct net_device *dev)
252static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev) 252static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
253{ 253{
254 struct sk_buff *skb2; 254 struct sk_buff *skb2;
255 struct lec_priv *priv = (struct lec_priv *)dev->priv; 255 struct lec_priv *priv = netdev_priv(dev);
256 struct lecdatahdr_8023 *lec_h; 256 struct lecdatahdr_8023 *lec_h;
257 struct atm_vcc *vcc; 257 struct atm_vcc *vcc;
258 struct lec_arp_table *entry; 258 struct lec_arp_table *entry;
@@ -373,19 +373,13 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { 373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) {
374 pr_debug("%s:lec_start_xmit: queuing packet, ", 374 pr_debug("%s:lec_start_xmit: queuing packet, ",
375 dev->name); 375 dev->name);
376 pr_debug("MAC address " MAC_FMT "\n", 376 pr_debug("MAC address %pM\n", lec_h->h_dest);
377 lec_h->h_dest[0], lec_h->h_dest[1],
378 lec_h->h_dest[2], lec_h->h_dest[3],
379 lec_h->h_dest[4], lec_h->h_dest[5]);
380 skb_queue_tail(&entry->tx_wait, skb); 377 skb_queue_tail(&entry->tx_wait, skb);
381 } else { 378 } else {
382 pr_debug 379 pr_debug
383 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", 380 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ",
384 dev->name); 381 dev->name);
385 pr_debug("MAC address " MAC_FMT "\n", 382 pr_debug("MAC address %pM\n", lec_h->h_dest);
386 lec_h->h_dest[0], lec_h->h_dest[1],
387 lec_h->h_dest[2], lec_h->h_dest[3],
388 lec_h->h_dest[4], lec_h->h_dest[5]);
389 priv->stats.tx_dropped++; 383 priv->stats.tx_dropped++;
390 dev_kfree_skb(skb); 384 dev_kfree_skb(skb);
391 } 385 }
@@ -397,10 +391,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
397 391
398 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { 392 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) {
399 pr_debug("lec.c: emptying tx queue, "); 393 pr_debug("lec.c: emptying tx queue, ");
400 pr_debug("MAC address " MAC_FMT "\n", 394 pr_debug("MAC address %pM\n", lec_h->h_dest);
401 lec_h->h_dest[0], lec_h->h_dest[1],
402 lec_h->h_dest[2], lec_h->h_dest[3],
403 lec_h->h_dest[4], lec_h->h_dest[5]);
404 lec_send(vcc, skb2, priv); 395 lec_send(vcc, skb2, priv);
405 } 396 }
406 397
@@ -442,14 +433,14 @@ static int lec_close(struct net_device *dev)
442 */ 433 */
443static struct net_device_stats *lec_get_stats(struct net_device *dev) 434static struct net_device_stats *lec_get_stats(struct net_device *dev)
444{ 435{
445 return &((struct lec_priv *)dev->priv)->stats; 436 return &((struct lec_priv *)netdev_priv(dev))->stats;
446} 437}
447 438
448static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) 439static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
449{ 440{
450 unsigned long flags; 441 unsigned long flags;
451 struct net_device *dev = (struct net_device *)vcc->proto_data; 442 struct net_device *dev = (struct net_device *)vcc->proto_data;
452 struct lec_priv *priv = (struct lec_priv *)dev->priv; 443 struct lec_priv *priv = netdev_priv(dev);
453 struct atmlec_msg *mesg; 444 struct atmlec_msg *mesg;
454 struct lec_arp_table *entry; 445 struct lec_arp_table *entry;
455 int i; 446 int i;
@@ -539,15 +530,8 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
539 { 530 {
540 struct net_bridge_fdb_entry *f; 531 struct net_bridge_fdb_entry *f;
541 532
542 pr_debug 533 pr_debug("%s: bridge zeppelin asks about %pM\n",
543 ("%s: bridge zeppelin asks about " MAC_FMT "\n", 534 dev->name, mesg->content.proxy.mac_addr);
544 dev->name,
545 mesg->content.proxy.mac_addr[0],
546 mesg->content.proxy.mac_addr[1],
547 mesg->content.proxy.mac_addr[2],
548 mesg->content.proxy.mac_addr[3],
549 mesg->content.proxy.mac_addr[4],
550 mesg->content.proxy.mac_addr[5]);
551 535
552 if (br_fdb_get_hook == NULL || dev->br_port == NULL) 536 if (br_fdb_get_hook == NULL || dev->br_port == NULL)
553 break; 537 break;
@@ -596,7 +580,7 @@ static void lec_atm_close(struct atm_vcc *vcc)
596{ 580{
597 struct sk_buff *skb; 581 struct sk_buff *skb;
598 struct net_device *dev = (struct net_device *)vcc->proto_data; 582 struct net_device *dev = (struct net_device *)vcc->proto_data;
599 struct lec_priv *priv = (struct lec_priv *)dev->priv; 583 struct lec_priv *priv = netdev_priv(dev);
600 584
601 priv->lecd = NULL; 585 priv->lecd = NULL;
602 /* Do something needful? */ 586 /* Do something needful? */
@@ -727,7 +711,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
727{ 711{
728 unsigned long flags; 712 unsigned long flags;
729 struct net_device *dev = (struct net_device *)vcc->proto_data; 713 struct net_device *dev = (struct net_device *)vcc->proto_data;
730 struct lec_priv *priv = (struct lec_priv *)dev->priv; 714 struct lec_priv *priv = netdev_priv(dev);
731 715
732#if DUMP_PACKETS >0 716#if DUMP_PACKETS >0
733 int i = 0; 717 int i = 0;
@@ -874,7 +858,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)
874 vpriv->old_pop = vcc->pop; 858 vpriv->old_pop = vcc->pop;
875 vcc->user_back = vpriv; 859 vcc->user_back = vpriv;
876 vcc->pop = lec_pop; 860 vcc->pop = lec_pop;
877 lec_vcc_added(dev_lec[ioc_data.dev_num]->priv, 861 lec_vcc_added(netdev_priv(dev_lec[ioc_data.dev_num]),
878 &ioc_data, vcc, vcc->push); 862 &ioc_data, vcc, vcc->push);
879 vcc->proto_data = dev_lec[ioc_data.dev_num]; 863 vcc->proto_data = dev_lec[ioc_data.dev_num];
880 vcc->push = lec_push; 864 vcc->push = lec_push;
@@ -886,7 +870,8 @@ static int lec_mcast_attach(struct atm_vcc *vcc, int arg)
886 if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg]) 870 if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg])
887 return -EINVAL; 871 return -EINVAL;
888 vcc->proto_data = dev_lec[arg]; 872 vcc->proto_data = dev_lec[arg];
889 return (lec_mcast_make((struct lec_priv *)dev_lec[arg]->priv, vcc)); 873 return lec_mcast_make((struct lec_priv *)netdev_priv(dev_lec[arg]),
874 vcc);
890} 875}
891 876
892/* Initialize device. */ 877/* Initialize device. */
@@ -928,11 +913,11 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
928 return -EINVAL; 913 return -EINVAL;
929 } 914 }
930 915
931 priv = dev_lec[i]->priv; 916 priv = netdev_priv(dev_lec[i]);
932 priv->is_trdev = is_trdev; 917 priv->is_trdev = is_trdev;
933 lec_init(dev_lec[i]); 918 lec_init(dev_lec[i]);
934 } else { 919 } else {
935 priv = dev_lec[i]->priv; 920 priv = netdev_priv(dev_lec[i]);
936 if (priv->lecd) 921 if (priv->lecd)
937 return -EADDRINUSE; 922 return -EADDRINUSE;
938 } 923 }
@@ -1093,7 +1078,8 @@ static void *lec_itf_walk(struct lec_state *state, loff_t *l)
1093 void *v; 1078 void *v;
1094 1079
1095 dev = state->dev ? state->dev : dev_lec[state->itf]; 1080 dev = state->dev ? state->dev : dev_lec[state->itf];
1096 v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL; 1081 v = (dev && netdev_priv(dev)) ?
1082 lec_priv_walk(state, l, netdev_priv(dev)) : NULL;
1097 if (!v && dev) { 1083 if (!v && dev) {
1098 dev_put(dev); 1084 dev_put(dev);
1099 /* Partial state reset for the next time we get called */ 1085 /* Partial state reset for the next time we get called */
@@ -1255,7 +1241,7 @@ static void __exit lane_module_cleanup(void)
1255 1241
1256 for (i = 0; i < MAX_LEC_ITF; i++) { 1242 for (i = 0; i < MAX_LEC_ITF; i++) {
1257 if (dev_lec[i] != NULL) { 1243 if (dev_lec[i] != NULL) {
1258 priv = (struct lec_priv *)dev_lec[i]->priv; 1244 priv = netdev_priv(dev_lec[i]);
1259 unregister_netdev(dev_lec[i]); 1245 unregister_netdev(dev_lec[i]);
1260 free_netdev(dev_lec[i]); 1246 free_netdev(dev_lec[i]);
1261 dev_lec[i] = NULL; 1247 dev_lec[i] = NULL;
@@ -1279,7 +1265,7 @@ static int lane2_resolve(struct net_device *dev, const u8 *dst_mac, int force,
1279 u8 **tlvs, u32 *sizeoftlvs) 1265 u8 **tlvs, u32 *sizeoftlvs)
1280{ 1266{
1281 unsigned long flags; 1267 unsigned long flags;
1282 struct lec_priv *priv = (struct lec_priv *)dev->priv; 1268 struct lec_priv *priv = netdev_priv(dev);
1283 struct lec_arp_table *table; 1269 struct lec_arp_table *table;
1284 struct sk_buff *skb; 1270 struct sk_buff *skb;
1285 int retval; 1271 int retval;
@@ -1326,7 +1312,7 @@ static int lane2_associate_req(struct net_device *dev, const u8 *lan_dst,
1326{ 1312{
1327 int retval; 1313 int retval;
1328 struct sk_buff *skb; 1314 struct sk_buff *skb;
1329 struct lec_priv *priv = (struct lec_priv *)dev->priv; 1315 struct lec_priv *priv = netdev_priv(dev);
1330 1316
1331 if (compare_ether_addr(lan_dst, dev->dev_addr)) 1317 if (compare_ether_addr(lan_dst, dev->dev_addr))
1332 return (0); /* not our mac address */ 1318 return (0); /* not our mac address */
@@ -1363,7 +1349,7 @@ static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr,
1363#if 0 1349#if 0
1364 int i = 0; 1350 int i = 0;
1365#endif 1351#endif
1366 struct lec_priv *priv = (struct lec_priv *)dev->priv; 1352 struct lec_priv *priv = netdev_priv(dev);
1367#if 0 /* 1353#if 0 /*
1368 * Why have the TLVs in LE_ARP entries 1354 * Why have the TLVs in LE_ARP entries
1369 * since we do not use them? When you 1355 * since we do not use them? When you