mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 14:56:19 +07:00
isdn: Kill directly reference of netdev->priv
Simply use netdev_priv() to replace netdev->priv. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
25dd7e6aed
commit
838361fe78
@ -42,7 +42,7 @@
|
|||||||
static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
|
static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = concap -> net_dev;
|
struct net_device *ndev = concap -> net_dev;
|
||||||
isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev;
|
isdn_net_dev *nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
|
||||||
isdn_net_local *lp = isdn_net_get_locked_lp(nd);
|
isdn_net_local *lp = isdn_net_get_locked_lp(nd);
|
||||||
|
|
||||||
IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
|
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 *
|
|||||||
static int isdn_concap_dl_connect_req(struct concap_proto *concap)
|
static int isdn_concap_dl_connect_req(struct concap_proto *concap)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = concap -> net_dev;
|
struct net_device *ndev = concap -> net_dev;
|
||||||
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
int ret;
|
int ret;
|
||||||
IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
|
IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ static __inline__ int isdn_net_device_busy(isdn_net_local *lp)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (lp->master)
|
if (lp->master)
|
||||||
nd = ((isdn_net_local *) lp->master->priv)->netdev;
|
nd = ISDN_MASTER_PRIV(lp)->netdev;
|
||||||
else
|
else
|
||||||
nd = lp->netdev;
|
nd = lp->netdev;
|
||||||
|
|
||||||
@ -213,9 +213,9 @@ isdn_net_reset(struct net_device *dev)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
struct concap_device_ops * dops =
|
struct concap_device_ops * dops =
|
||||||
( (isdn_net_local *) dev->priv ) -> dops;
|
((isdn_net_local *) netdev_priv(dev))->dops;
|
||||||
struct concap_proto * cprot =
|
struct concap_proto * cprot =
|
||||||
( (isdn_net_local *) dev->priv ) -> netdev -> cprot;
|
((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
if( cprot && cprot -> pops && dops )
|
if( cprot && cprot -> pops && dops )
|
||||||
@ -250,11 +250,11 @@ isdn_net_open(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If this interface has slaves, start them also */
|
/* If this interface has slaves, start them also */
|
||||||
|
p = MASTER_TO_SLAVE(dev);
|
||||||
if ((p = (((isdn_net_local *) dev->priv)->slave))) {
|
if (p) {
|
||||||
while (p) {
|
while (p) {
|
||||||
isdn_net_reset(p);
|
isdn_net_reset(p);
|
||||||
p = (((isdn_net_local *) p->priv)->slave);
|
p = MASTER_TO_SLAVE(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isdn_lock_drivers();
|
isdn_lock_drivers();
|
||||||
@ -483,7 +483,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
|
|||||||
isdn_net_ciscohdlck_connected(lp);
|
isdn_net_ciscohdlck_connected(lp);
|
||||||
if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) {
|
if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) {
|
||||||
if (lp->master) { /* is lp a slave? */
|
if (lp->master) { /* is lp a slave? */
|
||||||
isdn_net_dev *nd = ((isdn_net_local *)lp->master->priv)->netdev;
|
isdn_net_dev *nd = ISDN_MASTER_PRIV(lp)->netdev;
|
||||||
isdn_net_add_to_bundle(nd, lp);
|
isdn_net_add_to_bundle(nd, lp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -823,7 +823,7 @@ isdn_net_dial(void)
|
|||||||
void
|
void
|
||||||
isdn_net_hangup(struct net_device *d)
|
isdn_net_hangup(struct net_device *d)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) d->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(d);
|
||||||
isdn_ctrl cmd;
|
isdn_ctrl cmd;
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
struct concap_proto *cprot = lp->netdev->cprot;
|
struct concap_proto *cprot = lp->netdev->cprot;
|
||||||
@ -832,7 +832,7 @@ isdn_net_hangup(struct net_device *d)
|
|||||||
|
|
||||||
if (lp->flags & ISDN_NET_CONNECTED) {
|
if (lp->flags & ISDN_NET_CONNECTED) {
|
||||||
if (lp->slave != NULL) {
|
if (lp->slave != NULL) {
|
||||||
isdn_net_local *slp = (isdn_net_local *)lp->slave->priv;
|
isdn_net_local *slp = ISDN_SLAVE_PRIV(lp);
|
||||||
if (slp->flags & ISDN_NET_CONNECTED) {
|
if (slp->flags & ISDN_NET_CONNECTED) {
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"isdn_net: hang up slave %s before %s\n",
|
"isdn_net: hang up slave %s before %s\n",
|
||||||
@ -1048,10 +1048,10 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
|
|||||||
{
|
{
|
||||||
isdn_net_dev *nd;
|
isdn_net_dev *nd;
|
||||||
isdn_net_local *slp;
|
isdn_net_local *slp;
|
||||||
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
int retv = 0;
|
int retv = 0;
|
||||||
|
|
||||||
if (((isdn_net_local *) (ndev->priv))->master) {
|
if (((isdn_net_local *) netdev_priv(ndev))->master) {
|
||||||
printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
|
printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1063,7 +1063,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
|
|||||||
return isdn_ppp_xmit(skb, ndev);
|
return isdn_ppp_xmit(skb, ndev);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
nd = ((isdn_net_local *) ndev->priv)->netdev;
|
nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
|
||||||
lp = isdn_net_get_locked_lp(nd);
|
lp = isdn_net_get_locked_lp(nd);
|
||||||
if (!lp) {
|
if (!lp) {
|
||||||
printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
|
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)
|
|||||||
} else {
|
} else {
|
||||||
/* subsequent overload: if slavedelay exceeded, start dialing */
|
/* subsequent overload: if slavedelay exceeded, start dialing */
|
||||||
if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) {
|
if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) {
|
||||||
slp = lp->slave->priv;
|
slp = ISDN_SLAVE_PRIV(lp);
|
||||||
if (!(slp->flags & ISDN_NET_CONNECTED)) {
|
if (!(slp->flags & ISDN_NET_CONNECTED)) {
|
||||||
isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv);
|
isdn_net_force_dial_lp(ISDN_SLAVE_PRIV(lp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1112,7 +1112,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
|
|||||||
static void
|
static void
|
||||||
isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
|
isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) dev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
||||||
@ -1127,7 +1127,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
static void isdn_net_tx_timeout(struct net_device * ndev)
|
static void isdn_net_tx_timeout(struct net_device * ndev)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
|
|
||||||
printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate);
|
printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate);
|
||||||
if (!lp->dialstate){
|
if (!lp->dialstate){
|
||||||
@ -1161,7 +1161,7 @@ static void isdn_net_tx_timeout(struct net_device * ndev)
|
|||||||
static int
|
static int
|
||||||
isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
struct concap_proto * cprot = lp -> netdev -> cprot;
|
struct concap_proto * cprot = lp -> netdev -> cprot;
|
||||||
/* At this point hard_start_xmit() passes control to the encapsulation
|
/* At this point hard_start_xmit() passes control to the encapsulation
|
||||||
@ -1310,7 +1310,7 @@ isdn_net_close(struct net_device *dev)
|
|||||||
struct net_device *p;
|
struct net_device *p;
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
struct concap_proto * cprot =
|
struct concap_proto * cprot =
|
||||||
( (isdn_net_local *) dev->priv ) -> netdev -> cprot;
|
((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
|
||||||
/* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */
|
/* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1318,17 +1318,18 @@ isdn_net_close(struct net_device *dev)
|
|||||||
if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
|
if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
|
||||||
#endif
|
#endif
|
||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
if ((p = (((isdn_net_local *) dev->priv)->slave))) {
|
p = MASTER_TO_SLAVE(dev);
|
||||||
|
if (p) {
|
||||||
/* If this interface has slaves, stop them also */
|
/* If this interface has slaves, stop them also */
|
||||||
while (p) {
|
while (p) {
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
cprot = ( (isdn_net_local *) p->priv )
|
cprot = ((isdn_net_local *) netdev_priv(p))
|
||||||
-> netdev -> cprot;
|
-> netdev -> cprot;
|
||||||
if( cprot && cprot -> pops )
|
if( cprot && cprot -> pops )
|
||||||
cprot -> pops -> close( cprot );
|
cprot -> pops -> close( cprot );
|
||||||
#endif
|
#endif
|
||||||
isdn_net_hangup(p);
|
isdn_net_hangup(p);
|
||||||
p = (((isdn_net_local *) p->priv)->slave);
|
p = MASTER_TO_SLAVE(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isdn_net_hangup(dev);
|
isdn_net_hangup(dev);
|
||||||
@ -1342,7 +1343,7 @@ isdn_net_close(struct net_device *dev)
|
|||||||
static struct net_device_stats *
|
static struct net_device_stats *
|
||||||
isdn_net_get_stats(struct net_device *dev)
|
isdn_net_get_stats(struct net_device *dev)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) dev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
|
||||||
return &lp->stats;
|
return &lp->stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1421,7 +1422,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
|
|||||||
static int
|
static int
|
||||||
isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) dev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
|
||||||
unsigned long len = 0;
|
unsigned long len = 0;
|
||||||
unsigned long expires = 0;
|
unsigned long expires = 0;
|
||||||
int tmp = 0;
|
int tmp = 0;
|
||||||
@ -1763,7 +1764,7 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
|
|||||||
static void
|
static void
|
||||||
isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
|
isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
isdn_net_local *olp = lp; /* original 'lp' */
|
isdn_net_local *olp = lp; /* original 'lp' */
|
||||||
#ifdef CONFIG_ISDN_X25
|
#ifdef CONFIG_ISDN_X25
|
||||||
struct concap_proto *cprot = lp -> netdev -> cprot;
|
struct concap_proto *cprot = lp -> netdev -> cprot;
|
||||||
@ -1777,7 +1778,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
|
|||||||
* handle master's statistics and hangup-timeout
|
* handle master's statistics and hangup-timeout
|
||||||
*/
|
*/
|
||||||
ndev = lp->master;
|
ndev = lp->master;
|
||||||
lp = (isdn_net_local *) ndev->priv;
|
lp = (isdn_net_local *) netdev_priv(ndev);
|
||||||
lp->stats.rx_packets++;
|
lp->stats.rx_packets++;
|
||||||
lp->stats.rx_bytes += skb->len;
|
lp->stats.rx_bytes += skb->len;
|
||||||
}
|
}
|
||||||
@ -1878,7 +1879,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
|
|||||||
unsigned short type,
|
unsigned short type,
|
||||||
const void *daddr, const void *saddr, unsigned plen)
|
const void *daddr, const void *saddr, unsigned plen)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = dev->priv;
|
isdn_net_local *lp = netdev_priv(dev);
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
ushort len = 0;
|
ushort len = 0;
|
||||||
|
|
||||||
@ -1935,7 +1936,7 @@ static int
|
|||||||
isdn_net_rebuild_header(struct sk_buff *skb)
|
isdn_net_rebuild_header(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct net_device *dev = skb->dev;
|
struct net_device *dev = skb->dev;
|
||||||
isdn_net_local *lp = dev->priv;
|
isdn_net_local *lp = netdev_priv(dev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
||||||
@ -1965,7 +1966,7 @@ isdn_net_rebuild_header(struct sk_buff *skb)
|
|||||||
static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
|
static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
|
||||||
{
|
{
|
||||||
const struct net_device *dev = neigh->dev;
|
const struct net_device *dev = neigh->dev;
|
||||||
isdn_net_local *lp = dev->priv;
|
isdn_net_local *lp = netdev_priv(dev);
|
||||||
|
|
||||||
if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
|
if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
|
||||||
return eth_header_cache(neigh, hh);
|
return eth_header_cache(neigh, hh);
|
||||||
@ -1976,7 +1977,7 @@ static void isdn_header_cache_update(struct hh_cache *hh,
|
|||||||
const struct net_device *dev,
|
const struct net_device *dev,
|
||||||
const unsigned char *haddr)
|
const unsigned char *haddr)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = dev->priv;
|
isdn_net_local *lp = netdev_priv(dev);
|
||||||
if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
|
if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
|
||||||
eth_header_cache_update(hh, dev, haddr);
|
eth_header_cache_update(hh, dev, haddr);
|
||||||
}
|
}
|
||||||
@ -2291,16 +2292,16 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
|
|||||||
* it's master and parent slave is online. If not, reject the call.
|
* it's master and parent slave is online. If not, reject the call.
|
||||||
*/
|
*/
|
||||||
if (lp->master) {
|
if (lp->master) {
|
||||||
isdn_net_local *mlp = (isdn_net_local *) lp->master->priv;
|
isdn_net_local *mlp = ISDN_MASTER_PRIV(lp);
|
||||||
printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name);
|
printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name);
|
||||||
printk(KERN_DEBUG "master=%s\n", lp->master->name);
|
printk(KERN_DEBUG "master=%s\n", lp->master->name);
|
||||||
if (mlp->flags & ISDN_NET_CONNECTED) {
|
if (mlp->flags & ISDN_NET_CONNECTED) {
|
||||||
printk(KERN_DEBUG "master online\n");
|
printk(KERN_DEBUG "master online\n");
|
||||||
/* Master is online, find parent-slave (master if first slave) */
|
/* Master is online, find parent-slave (master if first slave) */
|
||||||
while (mlp->slave) {
|
while (mlp->slave) {
|
||||||
if ((isdn_net_local *) mlp->slave->priv == lp)
|
if (ISDN_SLAVE_PRIV(mlp) == lp)
|
||||||
break;
|
break;
|
||||||
mlp = (isdn_net_local *) mlp->slave->priv;
|
mlp = ISDN_SLAVE_PRIV(mlp);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
printk(KERN_DEBUG "master offline\n");
|
printk(KERN_DEBUG "master offline\n");
|
||||||
@ -2512,7 +2513,7 @@ isdn_net_force_dial(char *name)
|
|||||||
*/
|
*/
|
||||||
static void _isdn_setup(struct net_device *dev)
|
static void _isdn_setup(struct net_device *dev)
|
||||||
{
|
{
|
||||||
isdn_net_local *lp = dev->priv;
|
isdn_net_local *lp = netdev_priv(dev);
|
||||||
|
|
||||||
dev->flags = IFF_NOARP | IFF_POINTOPOINT;
|
dev->flags = IFF_NOARP | IFF_POINTOPOINT;
|
||||||
lp->p_encap = ISDN_NET_ENCAP_RAWIP;
|
lp->p_encap = ISDN_NET_ENCAP_RAWIP;
|
||||||
@ -2568,20 +2569,20 @@ isdn_net_new(char *name, struct net_device *master)
|
|||||||
kfree(netdev);
|
kfree(netdev);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
netdev->local = netdev->dev->priv;
|
netdev->local = netdev_priv(netdev->dev);
|
||||||
netdev->dev->init = isdn_net_init;
|
netdev->dev->init = isdn_net_init;
|
||||||
if (master) {
|
if (master) {
|
||||||
/* Device shall be a slave */
|
/* Device shall be a slave */
|
||||||
struct net_device *p = (((isdn_net_local *) master->priv)->slave);
|
struct net_device *p = MASTER_TO_SLAVE(master);
|
||||||
struct net_device *q = master;
|
struct net_device *q = master;
|
||||||
|
|
||||||
netdev->local->master = master;
|
netdev->local->master = master;
|
||||||
/* Put device at end of slave-chain */
|
/* Put device at end of slave-chain */
|
||||||
while (p) {
|
while (p) {
|
||||||
q = p;
|
q = p;
|
||||||
p = (((isdn_net_local *) p->priv)->slave);
|
p = MASTER_TO_SLAVE(p);
|
||||||
}
|
}
|
||||||
((isdn_net_local *) q->priv)->slave = netdev->dev;
|
MASTER_TO_SLAVE(q) = netdev->dev;
|
||||||
} else {
|
} else {
|
||||||
/* Device shall be a master */
|
/* Device shall be a master */
|
||||||
/*
|
/*
|
||||||
@ -3079,7 +3080,7 @@ isdn_net_force_hangup(char *name)
|
|||||||
/* If this interface has slaves, do a hangup for them also. */
|
/* If this interface has slaves, do a hangup for them also. */
|
||||||
while (q) {
|
while (q) {
|
||||||
isdn_net_hangup(q);
|
isdn_net_hangup(q);
|
||||||
q = (((isdn_net_local *) q->priv)->slave);
|
q = MASTER_TO_SLAVE(q);
|
||||||
}
|
}
|
||||||
isdn_net_hangup(p->dev);
|
isdn_net_hangup(p->dev);
|
||||||
return 0;
|
return 0;
|
||||||
@ -3109,8 +3110,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
|
|||||||
isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel);
|
isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel);
|
||||||
if (p->local->master) {
|
if (p->local->master) {
|
||||||
/* It's a slave-device, so update master's slave-pointer if necessary */
|
/* It's a slave-device, so update master's slave-pointer if necessary */
|
||||||
if (((isdn_net_local *) (p->local->master->priv))->slave == p->dev)
|
if (((isdn_net_local *) ISDN_MASTER_PRIV(p->local))->slave ==
|
||||||
((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave;
|
p->dev)
|
||||||
|
((isdn_net_local *)ISDN_MASTER_PRIV(p->local))->slave =
|
||||||
|
p->local->slave;
|
||||||
} else {
|
} else {
|
||||||
/* Unregister only if it's a master-device */
|
/* Unregister only if it's a master-device */
|
||||||
unregister_netdev(p->dev);
|
unregister_netdev(p->dev);
|
||||||
|
@ -56,6 +56,11 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb);
|
|||||||
|
|
||||||
#define ISDN_NET_MAX_QUEUE_LENGTH 2
|
#define ISDN_NET_MAX_QUEUE_LENGTH 2
|
||||||
|
|
||||||
|
#define ISDN_MASTER_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->master))
|
||||||
|
#define ISDN_SLAVE_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->slave))
|
||||||
|
#define MASTER_TO_SLAVE(master) \
|
||||||
|
(((isdn_net_local *) netdev_priv(master))->slave)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* is this particular channel busy?
|
* is this particular channel busy?
|
||||||
*/
|
*/
|
||||||
@ -126,7 +131,7 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (lp->master)
|
if (lp->master)
|
||||||
master_lp = (isdn_net_local *) lp->master->priv;
|
master_lp = ISDN_MASTER_PRIV(lp);
|
||||||
|
|
||||||
// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
|
// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
|
||||||
// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
|
// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
|
||||||
|
@ -1040,7 +1040,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||||||
is = ippp_table[slot];
|
is = ippp_table[slot];
|
||||||
|
|
||||||
if (lp->master) { // FIXME?
|
if (lp->master) { // FIXME?
|
||||||
mlp = (isdn_net_local *) lp->master->priv;
|
mlp = ISDN_MASTER_PRIV(lp);
|
||||||
slot = mlp->ppp_slot;
|
slot = mlp->ppp_slot;
|
||||||
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
||||||
printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
|
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)
|
|||||||
struct ippp_struct *ipt,*ipts;
|
struct ippp_struct *ipt,*ipts;
|
||||||
int slot, retval = 0;
|
int slot, retval = 0;
|
||||||
|
|
||||||
mlp = (isdn_net_local *) (netdev->priv);
|
mlp = (isdn_net_local *) netdev_priv(netdev);
|
||||||
nd = mlp->netdev; /* get master lp */
|
nd = mlp->netdev; /* get master lp */
|
||||||
|
|
||||||
slot = mlp->ppp_slot;
|
slot = mlp->ppp_slot;
|
||||||
@ -2013,7 +2013,7 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
|
|||||||
{
|
{
|
||||||
struct ppp_stats __user *res = ifr->ifr_data;
|
struct ppp_stats __user *res = ifr->ifr_data;
|
||||||
struct ppp_stats t;
|
struct ppp_stats t;
|
||||||
isdn_net_local *lp = (isdn_net_local *) dev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
|
||||||
|
|
||||||
if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
|
if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
@ -2052,7 +2052,7 @@ isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||||||
{
|
{
|
||||||
int error=0;
|
int error=0;
|
||||||
int len;
|
int len;
|
||||||
isdn_net_local *lp = (isdn_net_local *) dev->priv;
|
isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
|
||||||
|
|
||||||
|
|
||||||
if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
|
if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
|
||||||
@ -2119,7 +2119,7 @@ isdn_ppp_dial_slave(char *name)
|
|||||||
|
|
||||||
sdev = lp->slave;
|
sdev = lp->slave;
|
||||||
while (sdev) {
|
while (sdev) {
|
||||||
isdn_net_local *mlp = (isdn_net_local *) sdev->priv;
|
isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
|
||||||
if (!(mlp->flags & ISDN_NET_CONNECTED))
|
if (!(mlp->flags & ISDN_NET_CONNECTED))
|
||||||
break;
|
break;
|
||||||
sdev = mlp->slave;
|
sdev = mlp->slave;
|
||||||
@ -2127,7 +2127,7 @@ isdn_ppp_dial_slave(char *name)
|
|||||||
if (!sdev)
|
if (!sdev)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
isdn_net_dial_req((isdn_net_local *) sdev->priv);
|
isdn_net_dial_req((isdn_net_local *) netdev_priv(sdev));
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return -1;
|
return -1;
|
||||||
@ -2150,10 +2150,10 @@ isdn_ppp_hangup_slave(char *name)
|
|||||||
|
|
||||||
sdev = lp->slave;
|
sdev = lp->slave;
|
||||||
while (sdev) {
|
while (sdev) {
|
||||||
isdn_net_local *mlp = (isdn_net_local *) sdev->priv;
|
isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
|
||||||
|
|
||||||
if (mlp->slave) { /* find last connected link in chain */
|
if (mlp->slave) { /* find last connected link in chain */
|
||||||
isdn_net_local *nlp = (isdn_net_local *) mlp->slave->priv;
|
isdn_net_local *nlp = ISDN_SLAVE_PRIV(mlp);
|
||||||
|
|
||||||
if (!(nlp->flags & ISDN_NET_CONNECTED))
|
if (!(nlp->flags & ISDN_NET_CONNECTED))
|
||||||
break;
|
break;
|
||||||
@ -2688,7 +2688,7 @@ static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
|
|||||||
isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
|
isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
|
||||||
|
|
||||||
if(lp->master) {
|
if(lp->master) {
|
||||||
int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
|
int slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
|
||||||
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
||||||
printk(KERN_ERR "%s: slot(%d) out of range\n",
|
printk(KERN_ERR "%s: slot(%d) out of range\n",
|
||||||
__func__, slot);
|
__func__, slot);
|
||||||
@ -2875,7 +2875,7 @@ static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct
|
|||||||
isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
|
isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
|
||||||
|
|
||||||
if (lp->master) {
|
if (lp->master) {
|
||||||
slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
|
slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
|
||||||
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
|
||||||
printk(KERN_ERR "%s: slot(%d) out of range\n",
|
printk(KERN_ERR "%s: slot(%d) out of range\n",
|
||||||
__func__, slot);
|
__func__, slot);
|
||||||
|
Loading…
Reference in New Issue
Block a user