Commit 80fd2dbe authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville

brcmfmac: Return correct error on netdev xmit.

Netdev xmit routine brcfm_netdev_start_xmit was defined
incorrectly and used wrong return codes. Always eat the
packet and return ok. Remove drvr_up check since it is not
relevant.
Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 03abad08
...@@ -160,7 +160,8 @@ static void brcmf_netdev_set_multicast_list(struct net_device *ndev) ...@@ -160,7 +160,8 @@ static void brcmf_netdev_set_multicast_list(struct net_device *ndev)
schedule_work(&ifp->multicast_work); schedule_work(&ifp->multicast_work);
} }
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev) static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
struct net_device *ndev)
{ {
int ret; int ret;
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
...@@ -169,20 +170,21 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -169,20 +170,21 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
/* Reject if down */ /* Can the device send data? */
if (!drvr->bus_if->drvr_up || if (drvr->bus_if->state != BRCMF_BUS_DATA) {
(drvr->bus_if->state != BRCMF_BUS_DATA)) { brcmf_err("xmit rejected state=%d\n", drvr->bus_if->state);
brcmf_err("xmit rejected drvup=%d state=%d\n",
drvr->bus_if->drvr_up,
drvr->bus_if->state);
netif_stop_queue(ndev); netif_stop_queue(ndev);
return -ENODEV; dev_kfree_skb(skb);
ret = -ENODEV;
goto done;
} }
if (!drvr->iflist[ifp->idx]) { if (!drvr->iflist[ifp->idx]) {
brcmf_err("bad ifidx %d\n", ifp->idx); brcmf_err("bad ifidx %d\n", ifp->idx);
netif_stop_queue(ndev); netif_stop_queue(ndev);
return -ENODEV; dev_kfree_skb(skb);
ret = -ENODEV;
goto done;
} }
/* Make sure there's enough room for any header */ /* Make sure there's enough room for any header */
...@@ -230,7 +232,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -230,7 +232,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
drvr->bus_if->dstats.tx_packets++; drvr->bus_if->dstats.tx_packets++;
/* Return ok: we always eat the packet */ /* Return ok: we always eat the packet */
return 0; return NETDEV_TX_OK;
} }
void brcmf_txflowblock(struct device *dev, bool state) void brcmf_txflowblock(struct device *dev, bool state)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment