diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-29 21:39:54 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-01 09:50:29 -0400 |
commit | 2515ab628f227b0711393993fe3228e167cc988f (patch) | |
tree | e241fd7f7b2cf035acb98795ee467c26eb8cd9a1 | |
parent | d7affd0f58c9f68441b4ce631d07fad2e6a448db (diff) | |
download | linux-stable-2515ab628f227b0711393993fe3228e167cc988f.tar.gz linux-stable-2515ab628f227b0711393993fe3228e167cc988f.tar.bz2 linux-stable-2515ab628f227b0711393993fe3228e167cc988f.zip |
beceem: Add proper carrier and link management
Start with carrier off.
Don't track up/down status in driver private flag.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
-rw-r--r-- | drivers/staging/bcm/Adapter.h | 1 | ||||
-rw-r--r-- | drivers/staging/bcm/Bcmnet.c | 3 | ||||
-rw-r--r-- | drivers/staging/bcm/InterfaceRx.c | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h index 9c9dff3e0daa..c679b71848ac 100644 --- a/drivers/staging/bcm/Adapter.h +++ b/drivers/staging/bcm/Adapter.h @@ -498,7 +498,6 @@ struct _MINI_ADAPTER int irq; unsigned long chip_id; unsigned int bFlashBoot; - unsigned int if_up; // spinlock_t sleeper_lock; atomic_t rdm_wrm_access; atomic_t tx_rx_access; diff --git a/drivers/staging/bcm/Bcmnet.c b/drivers/staging/bcm/Bcmnet.c index c77c1d1e6157..9518e388b054 100644 --- a/drivers/staging/bcm/Bcmnet.c +++ b/drivers/staging/bcm/Bcmnet.c @@ -17,7 +17,6 @@ static INT bcm_open(struct net_device *dev) BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "======>"); if(Adapter->fw_download_done==FALSE) return -EINVAL; - Adapter->if_up=1; if(Adapter->LinkUpStatus == 1){ if(netif_queue_stopped(Adapter->dev)){ netif_carrier_on(Adapter->dev); @@ -34,7 +33,6 @@ static INT bcm_close(struct net_device *dev) PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(dev); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=====>"); - Adapter->if_up=0; if(!netif_queue_stopped(dev)) { netif_carrier_off(dev); netif_stop_queue(dev); @@ -145,6 +143,7 @@ int register_networkdev(PMINI_ADAPTER Adapter) net->ethtool_ops = &bcm_ethtool_ops; net->mtu = MTU_SIZE; /* 1400 Bytes */ net->tx_queue_len = TX_QLEN; + netif_carrier_off(net); SET_NETDEV_DEV(net, &uintf->dev); SET_NETDEV_DEVTYPE(net, &wimax_type); diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c index 128aa91f7434..ab33895bfe56 100644 --- a/drivers/staging/bcm/InterfaceRx.c +++ b/drivers/staging/bcm/InterfaceRx.c @@ -148,7 +148,7 @@ static void read_bulk_callback(struct urb *urb) atomic_add(pLeader->PLength, &Adapter->GoodRxByteCount); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Recived Data pkt of len :0x%X", pLeader->PLength); - if(Adapter->if_up) + if(netif_running(Adapter->dev)) { /* Moving ahead by ETH_HLEN to the data ptr as received from FW */ skb_pull(skb, ETH_HLEN); |