aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/i4l/isdn_concap.c4
-rw-r--r--drivers/isdn/i4l/isdn_net.c83
-rw-r--r--drivers/isdn/i4l/isdn_net.h7
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c20
4 files changed, 61 insertions, 53 deletions
diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
index 0193b6f7c70c..46048e55f241 100644
--- a/drivers/isdn/i4l/isdn_concap.c
+++ b/drivers/isdn/i4l/isdn_concap.c
@@ -42,7 +42,7 @@
42static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) 42static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
43{ 43{
44 struct net_device *ndev = concap -> net_dev; 44 struct net_device *ndev = concap -> net_dev;
45 isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev; 45 isdn_net_dev *nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
46 isdn_net_local *lp = isdn_net_get_locked_lp(nd); 46 isdn_net_local *lp = isdn_net_get_locked_lp(nd);
47 47
48 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name); 48 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
@@ -61,7 +61,7 @@ static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *
61static int isdn_concap_dl_connect_req(struct concap_proto *concap) 61static int isdn_concap_dl_connect_req(struct concap_proto *concap)
62{ 62{
63 struct net_device *ndev = concap -> net_dev; 63 struct net_device *ndev = concap -> net_dev;
64 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 64 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
65 int ret; 65 int ret;
66 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name); 66 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
67 67
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 4da81c132589..023ea11d2f9e 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -120,7 +120,7 @@ static __inline__ int isdn_net_device_busy(isdn_net_local *lp)
120 return 0; 120 return 0;
121 121
122 if (lp->master) 122 if (lp->master)
123 nd = ((isdn_net_local *) lp->master->priv)->netdev; 123 nd = ISDN_MASTER_PRIV(lp)->netdev;
124 else 124 else
125 nd = lp->netdev; 125 nd = lp->netdev;
126 126
@@ -213,9 +213,9 @@ isdn_net_reset(struct net_device *dev)
213{ 213{
214#ifdef CONFIG_ISDN_X25 214#ifdef CONFIG_ISDN_X25
215 struct concap_device_ops * dops = 215 struct concap_device_ops * dops =
216 ( (isdn_net_local *) dev->priv ) -> dops; 216 ((isdn_net_local *) netdev_priv(dev))->dops;
217 struct concap_proto * cprot = 217 struct concap_proto * cprot =
218 ( (isdn_net_local *) dev->priv ) -> netdev -> cprot; 218 ((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
219#endif 219#endif
220#ifdef CONFIG_ISDN_X25 220#ifdef CONFIG_ISDN_X25
221 if( cprot && cprot -> pops && dops ) 221 if( cprot && cprot -> pops && dops )
@@ -250,11 +250,11 @@ isdn_net_open(struct net_device *dev)
250 } 250 }
251 251
252 /* If this interface has slaves, start them also */ 252 /* If this interface has slaves, start them also */
253 253 p = MASTER_TO_SLAVE(dev);
254 if ((p = (((isdn_net_local *) dev->priv)->slave))) { 254 if (p) {
255 while (p) { 255 while (p) {
256 isdn_net_reset(p); 256 isdn_net_reset(p);
257 p = (((isdn_net_local *) p->priv)->slave); 257 p = MASTER_TO_SLAVE(p);
258 } 258 }
259 } 259 }
260 isdn_lock_drivers(); 260 isdn_lock_drivers();
@@ -483,7 +483,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
483 isdn_net_ciscohdlck_connected(lp); 483 isdn_net_ciscohdlck_connected(lp);
484 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) { 484 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) {
485 if (lp->master) { /* is lp a slave? */ 485 if (lp->master) { /* is lp a slave? */
486 isdn_net_dev *nd = ((isdn_net_local *)lp->master->priv)->netdev; 486 isdn_net_dev *nd = ISDN_MASTER_PRIV(lp)->netdev;
487 isdn_net_add_to_bundle(nd, lp); 487 isdn_net_add_to_bundle(nd, lp);
488 } 488 }
489 } 489 }
@@ -823,7 +823,7 @@ isdn_net_dial(void)
823void 823void
824isdn_net_hangup(struct net_device *d) 824isdn_net_hangup(struct net_device *d)
825{ 825{
826 isdn_net_local *lp = (isdn_net_local *) d->priv; 826 isdn_net_local *lp = (isdn_net_local *) netdev_priv(d);
827 isdn_ctrl cmd; 827 isdn_ctrl cmd;
828#ifdef CONFIG_ISDN_X25 828#ifdef CONFIG_ISDN_X25
829 struct concap_proto *cprot = lp->netdev->cprot; 829 struct concap_proto *cprot = lp->netdev->cprot;
@@ -832,7 +832,7 @@ isdn_net_hangup(struct net_device *d)
832 832
833 if (lp->flags & ISDN_NET_CONNECTED) { 833 if (lp->flags & ISDN_NET_CONNECTED) {
834 if (lp->slave != NULL) { 834 if (lp->slave != NULL) {
835 isdn_net_local *slp = (isdn_net_local *)lp->slave->priv; 835 isdn_net_local *slp = ISDN_SLAVE_PRIV(lp);
836 if (slp->flags & ISDN_NET_CONNECTED) { 836 if (slp->flags & ISDN_NET_CONNECTED) {
837 printk(KERN_INFO 837 printk(KERN_INFO
838 "isdn_net: hang up slave %s before %s\n", 838 "isdn_net: hang up slave %s before %s\n",
@@ -1048,10 +1048,10 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1048{ 1048{
1049 isdn_net_dev *nd; 1049 isdn_net_dev *nd;
1050 isdn_net_local *slp; 1050 isdn_net_local *slp;
1051 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1051 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1052 int retv = 0; 1052 int retv = 0;
1053 1053
1054 if (((isdn_net_local *) (ndev->priv))->master) { 1054 if (((isdn_net_local *) netdev_priv(ndev))->master) {
1055 printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__); 1055 printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
1056 dev_kfree_skb(skb); 1056 dev_kfree_skb(skb);
1057 return 0; 1057 return 0;
@@ -1063,7 +1063,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1063 return isdn_ppp_xmit(skb, ndev); 1063 return isdn_ppp_xmit(skb, ndev);
1064 } 1064 }
1065#endif 1065#endif
1066 nd = ((isdn_net_local *) ndev->priv)->netdev; 1066 nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
1067 lp = isdn_net_get_locked_lp(nd); 1067 lp = isdn_net_get_locked_lp(nd);
1068 if (!lp) { 1068 if (!lp) {
1069 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); 1069 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
@@ -1090,9 +1090,9 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1090 } else { 1090 } else {
1091 /* subsequent overload: if slavedelay exceeded, start dialing */ 1091 /* subsequent overload: if slavedelay exceeded, start dialing */
1092 if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) { 1092 if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) {
1093 slp = lp->slave->priv; 1093 slp = ISDN_SLAVE_PRIV(lp);
1094 if (!(slp->flags & ISDN_NET_CONNECTED)) { 1094 if (!(slp->flags & ISDN_NET_CONNECTED)) {
1095 isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv); 1095 isdn_net_force_dial_lp(ISDN_SLAVE_PRIV(lp));
1096 } 1096 }
1097 } 1097 }
1098 } 1098 }
@@ -1112,7 +1112,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1112static void 1112static void
1113isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev) 1113isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
1114{ 1114{
1115 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1115 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1116 if (!skb) 1116 if (!skb)
1117 return; 1117 return;
1118 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { 1118 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -1127,7 +1127,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
1127 1127
1128static void isdn_net_tx_timeout(struct net_device * ndev) 1128static void isdn_net_tx_timeout(struct net_device * ndev)
1129{ 1129{
1130 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1130 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1131 1131
1132 printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate); 1132 printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate);
1133 if (!lp->dialstate){ 1133 if (!lp->dialstate){
@@ -1161,7 +1161,7 @@ static void isdn_net_tx_timeout(struct net_device * ndev)
1161static int 1161static int
1162isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) 1162isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
1163{ 1163{
1164 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1164 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1165#ifdef CONFIG_ISDN_X25 1165#ifdef CONFIG_ISDN_X25
1166 struct concap_proto * cprot = lp -> netdev -> cprot; 1166 struct concap_proto * cprot = lp -> netdev -> cprot;
1167/* At this point hard_start_xmit() passes control to the encapsulation 1167/* At this point hard_start_xmit() passes control to the encapsulation
@@ -1310,7 +1310,7 @@ isdn_net_close(struct net_device *dev)
1310 struct net_device *p; 1310 struct net_device *p;
1311#ifdef CONFIG_ISDN_X25 1311#ifdef CONFIG_ISDN_X25
1312 struct concap_proto * cprot = 1312 struct concap_proto * cprot =
1313 ( (isdn_net_local *) dev->priv ) -> netdev -> cprot; 1313 ((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
1314 /* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */ 1314 /* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */
1315#endif 1315#endif
1316 1316
@@ -1318,17 +1318,18 @@ isdn_net_close(struct net_device *dev)
1318 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot ); 1318 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
1319#endif 1319#endif
1320 netif_stop_queue(dev); 1320 netif_stop_queue(dev);
1321 if ((p = (((isdn_net_local *) dev->priv)->slave))) { 1321 p = MASTER_TO_SLAVE(dev);
1322 if (p) {
1322 /* If this interface has slaves, stop them also */ 1323 /* If this interface has slaves, stop them also */
1323 while (p) { 1324 while (p) {
1324#ifdef CONFIG_ISDN_X25 1325#ifdef CONFIG_ISDN_X25
1325 cprot = ( (isdn_net_local *) p->priv ) 1326 cprot = ((isdn_net_local *) netdev_priv(p))
1326 -> netdev -> cprot; 1327 -> netdev -> cprot;
1327 if( cprot && cprot -> pops ) 1328 if( cprot && cprot -> pops )
1328 cprot -> pops -> close( cprot ); 1329 cprot -> pops -> close( cprot );
1329#endif 1330#endif
1330 isdn_net_hangup(p); 1331 isdn_net_hangup(p);
1331 p = (((isdn_net_local *) p->priv)->slave); 1332 p = MASTER_TO_SLAVE(p);
1332 } 1333 }
1333 } 1334 }
1334 isdn_net_hangup(dev); 1335 isdn_net_hangup(dev);
@@ -1342,7 +1343,7 @@ isdn_net_close(struct net_device *dev)
1342static struct net_device_stats * 1343static struct net_device_stats *
1343isdn_net_get_stats(struct net_device *dev) 1344isdn_net_get_stats(struct net_device *dev)
1344{ 1345{
1345 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1346 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1346 return &lp->stats; 1347 return &lp->stats;
1347} 1348}
1348 1349
@@ -1421,7 +1422,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
1421static int 1422static int
1422isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 1423isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1423{ 1424{
1424 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1425 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1425 unsigned long len = 0; 1426 unsigned long len = 0;
1426 unsigned long expires = 0; 1427 unsigned long expires = 0;
1427 int tmp = 0; 1428 int tmp = 0;
@@ -1763,7 +1764,7 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
1763static void 1764static void
1764isdn_net_receive(struct net_device *ndev, struct sk_buff *skb) 1765isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1765{ 1766{
1766 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1767 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1767 isdn_net_local *olp = lp; /* original 'lp' */ 1768 isdn_net_local *olp = lp; /* original 'lp' */
1768#ifdef CONFIG_ISDN_X25 1769#ifdef CONFIG_ISDN_X25
1769 struct concap_proto *cprot = lp -> netdev -> cprot; 1770 struct concap_proto *cprot = lp -> netdev -> cprot;
@@ -1777,7 +1778,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1777 * handle master's statistics and hangup-timeout 1778 * handle master's statistics and hangup-timeout
1778 */ 1779 */
1779 ndev = lp->master; 1780 ndev = lp->master;
1780 lp = (isdn_net_local *) ndev->priv; 1781 lp = (isdn_net_local *) netdev_priv(ndev);
1781 lp->stats.rx_packets++; 1782 lp->stats.rx_packets++;
1782 lp->stats.rx_bytes += skb->len; 1783 lp->stats.rx_bytes += skb->len;
1783 } 1784 }
@@ -1878,7 +1879,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
1878 unsigned short type, 1879 unsigned short type,
1879 const void *daddr, const void *saddr, unsigned plen) 1880 const void *daddr, const void *saddr, unsigned plen)
1880{ 1881{
1881 isdn_net_local *lp = dev->priv; 1882 isdn_net_local *lp = netdev_priv(dev);
1882 unsigned char *p; 1883 unsigned char *p;
1883 ushort len = 0; 1884 ushort len = 0;
1884 1885
@@ -1935,7 +1936,7 @@ static int
1935isdn_net_rebuild_header(struct sk_buff *skb) 1936isdn_net_rebuild_header(struct sk_buff *skb)
1936{ 1937{
1937 struct net_device *dev = skb->dev; 1938 struct net_device *dev = skb->dev;
1938 isdn_net_local *lp = dev->priv; 1939 isdn_net_local *lp = netdev_priv(dev);
1939 int ret = 0; 1940 int ret = 0;
1940 1941
1941 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { 1942 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -1965,7 +1966,7 @@ isdn_net_rebuild_header(struct sk_buff *skb)
1965static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh) 1966static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
1966{ 1967{
1967 const struct net_device *dev = neigh->dev; 1968 const struct net_device *dev = neigh->dev;
1968 isdn_net_local *lp = dev->priv; 1969 isdn_net_local *lp = netdev_priv(dev);
1969 1970
1970 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) 1971 if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
1971 return eth_header_cache(neigh, hh); 1972 return eth_header_cache(neigh, hh);
@@ -1976,7 +1977,7 @@ static void isdn_header_cache_update(struct hh_cache *hh,
1976 const struct net_device *dev, 1977 const struct net_device *dev,
1977 const unsigned char *haddr) 1978 const unsigned char *haddr)
1978{ 1979{
1979 isdn_net_local *lp = dev->priv; 1980 isdn_net_local *lp = netdev_priv(dev);
1980 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) 1981 if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
1981 eth_header_cache_update(hh, dev, haddr); 1982 eth_header_cache_update(hh, dev, haddr);
1982} 1983}
@@ -2291,16 +2292,16 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
2291 * it's master and parent slave is online. If not, reject the call. 2292 * it's master and parent slave is online. If not, reject the call.
2292 */ 2293 */
2293 if (lp->master) { 2294 if (lp->master) {
2294 isdn_net_local *mlp = (isdn_net_local *) lp->master->priv; 2295 isdn_net_local *mlp = ISDN_MASTER_PRIV(lp);
2295 printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name); 2296 printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name);
2296 printk(KERN_DEBUG "master=%s\n", lp->master->name); 2297 printk(KERN_DEBUG "master=%s\n", lp->master->name);
2297 if (mlp->flags & ISDN_NET_CONNECTED) { 2298 if (mlp->flags & ISDN_NET_CONNECTED) {
2298 printk(KERN_DEBUG "master online\n"); 2299 printk(KERN_DEBUG "master online\n");
2299 /* Master is online, find parent-slave (master if first slave) */ 2300 /* Master is online, find parent-slave (master if first slave) */
2300 while (mlp->slave) { 2301 while (mlp->slave) {
2301 if ((isdn_net_local *) mlp->slave->priv == lp) 2302 if (ISDN_SLAVE_PRIV(mlp) == lp)
2302 break; 2303 break;
2303 mlp = (isdn_net_local *) mlp->slave->priv; 2304 mlp = ISDN_SLAVE_PRIV(mlp);
2304 } 2305 }
2305 } else 2306 } else
2306 printk(KERN_DEBUG "master offline\n"); 2307 printk(KERN_DEBUG "master offline\n");
@@ -2512,7 +2513,7 @@ isdn_net_force_dial(char *name)
2512 */ 2513 */
2513static void _isdn_setup(struct net_device *dev) 2514static void _isdn_setup(struct net_device *dev)
2514{ 2515{
2515 isdn_net_local *lp = dev->priv; 2516 isdn_net_local *lp = netdev_priv(dev);
2516 2517
2517 dev->flags = IFF_NOARP | IFF_POINTOPOINT; 2518 dev->flags = IFF_NOARP | IFF_POINTOPOINT;
2518 lp->p_encap = ISDN_NET_ENCAP_RAWIP; 2519 lp->p_encap = ISDN_NET_ENCAP_RAWIP;
@@ -2568,20 +2569,20 @@ isdn_net_new(char *name, struct net_device *master)
2568 kfree(netdev); 2569 kfree(netdev);
2569 return NULL; 2570 return NULL;
2570 } 2571 }
2571 netdev->local = netdev->dev->priv; 2572 netdev->local = netdev_priv(netdev->dev);
2572 netdev->dev->init = isdn_net_init; 2573 netdev->dev->init = isdn_net_init;
2573 if (master) { 2574 if (master) {
2574 /* Device shall be a slave */ 2575 /* Device shall be a slave */
2575 struct net_device *p = (((isdn_net_local *) master->priv)->slave); 2576 struct net_device *p = MASTER_TO_SLAVE(master);
2576 struct net_device *q = master; 2577 struct net_device *q = master;
2577 2578
2578 netdev->local->master = master; 2579 netdev->local->master = master;
2579 /* Put device at end of slave-chain */ 2580 /* Put device at end of slave-chain */
2580 while (p) { 2581 while (p) {
2581 q = p; 2582 q = p;
2582 p = (((isdn_net_local *) p->priv)->slave); 2583 p = MASTER_TO_SLAVE(p);
2583 } 2584 }
2584 ((isdn_net_local *) q->priv)->slave = netdev->dev; 2585 MASTER_TO_SLAVE(q) = netdev->dev;
2585 } else { 2586 } else {
2586 /* Device shall be a master */ 2587 /* Device shall be a master */
2587 /* 2588 /*
@@ -3079,7 +3080,7 @@ isdn_net_force_hangup(char *name)
3079 /* If this interface has slaves, do a hangup for them also. */ 3080 /* If this interface has slaves, do a hangup for them also. */
3080 while (q) { 3081 while (q) {
3081 isdn_net_hangup(q); 3082 isdn_net_hangup(q);
3082 q = (((isdn_net_local *) q->priv)->slave); 3083 q = MASTER_TO_SLAVE(q);
3083 } 3084 }
3084 isdn_net_hangup(p->dev); 3085 isdn_net_hangup(p->dev);
3085 return 0; 3086 return 0;
@@ -3109,8 +3110,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
3109 isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel); 3110 isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel);
3110 if (p->local->master) { 3111 if (p->local->master) {
3111 /* It's a slave-device, so update master's slave-pointer if necessary */ 3112 /* It's a slave-device, so update master's slave-pointer if necessary */
3112 if (((isdn_net_local *) (p->local->master->priv))->slave == p->dev) 3113 if (((isdn_net_local *) ISDN_MASTER_PRIV(p->local))->slave ==
3113 ((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave; 3114 p->dev)
3115 ((isdn_net_local *)ISDN_MASTER_PRIV(p->local))->slave =
3116 p->local->slave;
3114 } else { 3117 } else {
3115 /* Unregister only if it's a master-device */ 3118 /* Unregister only if it's a master-device */
3116 unregister_netdev(p->dev); 3119 unregister_netdev(p->dev);
diff --git a/drivers/isdn/i4l/isdn_net.h b/drivers/isdn/i4l/isdn_net.h
index 2a6c370ea87f..74032d0881ef 100644
--- a/drivers/isdn/i4l/isdn_net.h
+++ b/drivers/isdn/i4l/isdn_net.h
@@ -56,6 +56,11 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb);
56 56
57#define ISDN_NET_MAX_QUEUE_LENGTH 2 57#define ISDN_NET_MAX_QUEUE_LENGTH 2
58 58
59#define ISDN_MASTER_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->master))
60#define ISDN_SLAVE_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->slave))
61#define MASTER_TO_SLAVE(master) \
62 (((isdn_net_local *) netdev_priv(master))->slave)
63
59/* 64/*
60 * is this particular channel busy? 65 * is this particular channel busy?
61 */ 66 */
@@ -126,7 +131,7 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
126 unsigned long flags; 131 unsigned long flags;
127 132
128 if (lp->master) 133 if (lp->master)
129 master_lp = (isdn_net_local *) lp->master->priv; 134 master_lp = ISDN_MASTER_PRIV(lp);
130 135
131// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n", 136// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
132// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue); 137// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index bf5821ef192a..a3551dd0324d 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -1040,7 +1040,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
1040 is = ippp_table[slot]; 1040 is = ippp_table[slot];
1041 1041
1042 if (lp->master) { // FIXME? 1042 if (lp->master) { // FIXME?
1043 mlp = (isdn_net_local *) lp->master->priv; 1043 mlp = ISDN_MASTER_PRIV(lp);
1044 slot = mlp->ppp_slot; 1044 slot = mlp->ppp_slot;
1045 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 1045 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
1046 printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n", 1046 printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
@@ -1223,7 +1223,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
1223 struct ippp_struct *ipt,*ipts; 1223 struct ippp_struct *ipt,*ipts;
1224 int slot, retval = 0; 1224 int slot, retval = 0;
1225 1225
1226 mlp = (isdn_net_local *) (netdev->priv); 1226 mlp = (isdn_net_local *) netdev_priv(netdev);
1227 nd = mlp->netdev; /* get master lp */ 1227 nd = mlp->netdev; /* get master lp */
1228 1228
1229 slot = mlp->ppp_slot; 1229 slot = mlp->ppp_slot;
@@ -2013,7 +2013,7 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
2013{ 2013{
2014 struct ppp_stats __user *res = ifr->ifr_data; 2014 struct ppp_stats __user *res = ifr->ifr_data;
2015 struct ppp_stats t; 2015 struct ppp_stats t;
2016 isdn_net_local *lp = (isdn_net_local *) dev->priv; 2016 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
2017 2017
2018 if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats))) 2018 if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
2019 return -EFAULT; 2019 return -EFAULT;
@@ -2052,7 +2052,7 @@ isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2052{ 2052{
2053 int error=0; 2053 int error=0;
2054 int len; 2054 int len;
2055 isdn_net_local *lp = (isdn_net_local *) dev->priv; 2055 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
2056 2056
2057 2057
2058 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) 2058 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
@@ -2119,7 +2119,7 @@ isdn_ppp_dial_slave(char *name)
2119 2119
2120 sdev = lp->slave; 2120 sdev = lp->slave;
2121 while (sdev) { 2121 while (sdev) {
2122 isdn_net_local *mlp = (isdn_net_local *) sdev->priv; 2122 isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
2123 if (!(mlp->flags & ISDN_NET_CONNECTED)) 2123 if (!(mlp->flags & ISDN_NET_CONNECTED))
2124 break; 2124 break;
2125 sdev = mlp->slave; 2125 sdev = mlp->slave;
@@ -2127,7 +2127,7 @@ isdn_ppp_dial_slave(char *name)
2127 if (!sdev) 2127 if (!sdev)
2128 return 2; 2128 return 2;
2129 2129
2130 isdn_net_dial_req((isdn_net_local *) sdev->priv); 2130 isdn_net_dial_req((isdn_net_local *) netdev_priv(sdev));
2131 return 0; 2131 return 0;
2132#else 2132#else
2133 return -1; 2133 return -1;
@@ -2150,10 +2150,10 @@ isdn_ppp_hangup_slave(char *name)
2150 2150
2151 sdev = lp->slave; 2151 sdev = lp->slave;
2152 while (sdev) { 2152 while (sdev) {
2153 isdn_net_local *mlp = (isdn_net_local *) sdev->priv; 2153 isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
2154 2154
2155 if (mlp->slave) { /* find last connected link in chain */ 2155 if (mlp->slave) { /* find last connected link in chain */
2156 isdn_net_local *nlp = (isdn_net_local *) mlp->slave->priv; 2156 isdn_net_local *nlp = ISDN_SLAVE_PRIV(mlp);
2157 2157
2158 if (!(nlp->flags & ISDN_NET_CONNECTED)) 2158 if (!(nlp->flags & ISDN_NET_CONNECTED))
2159 break; 2159 break;
@@ -2688,7 +2688,7 @@ static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
2688 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot); 2688 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
2689 2689
2690 if(lp->master) { 2690 if(lp->master) {
2691 int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot; 2691 int slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
2692 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 2692 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
2693 printk(KERN_ERR "%s: slot(%d) out of range\n", 2693 printk(KERN_ERR "%s: slot(%d) out of range\n",
2694 __func__, slot); 2694 __func__, slot);
@@ -2875,7 +2875,7 @@ static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct
2875 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot); 2875 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
2876 2876
2877 if (lp->master) { 2877 if (lp->master) {
2878 slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot; 2878 slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
2879 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 2879 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
2880 printk(KERN_ERR "%s: slot(%d) out of range\n", 2880 printk(KERN_ERR "%s: slot(%d) out of range\n",
2881 __func__, slot); 2881 __func__, slot);