提交 05f3820b 编写于 作者: A Arend van Spriel 提交者: John W. Linville

brcmfmac: rework rx path bus interface

The brcmfmac has common and bus specific part. The rx function api
was using sk_buff_head. Changed to sk_buff instead.
Reviewed-by: NHante Meuleman <meuleman@broadcom.com>
Reviewed-by: NFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: NPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 f2c44fe7
...@@ -136,7 +136,7 @@ extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, ...@@ -136,7 +136,7 @@ extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
struct sk_buff *pkt, int prec); struct sk_buff *pkt, int prec);
/* Receive frame for delivery to OS. Callee disposes of rxp. */ /* Receive frame for delivery to OS. Callee disposes of rxp. */
extern void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist); extern void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp);
/* Indication from bus module regarding presence/insertion of dongle. */ /* Indication from bus module regarding presence/insertion of dongle. */
extern int brcmf_attach(uint bus_hdrlen, struct device *dev); extern int brcmf_attach(uint bus_hdrlen, struct device *dev);
......
...@@ -509,9 +509,8 @@ static void brcmf_rxreorder_process_info(struct brcmf_if *ifp, u8 *reorder_data, ...@@ -509,9 +509,8 @@ static void brcmf_rxreorder_process_info(struct brcmf_if *ifp, u8 *reorder_data,
} }
} }
void brcmf_rx_frames(struct device *dev, struct sk_buff_head *skb_list) void brcmf_rx_frame(struct device *dev, struct sk_buff *skb)
{ {
struct sk_buff *skb, *pnext;
struct brcmf_if *ifp; struct brcmf_if *ifp;
struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_pub *drvr = bus_if->drvr; struct brcmf_pub *drvr = bus_if->drvr;
...@@ -519,29 +518,24 @@ void brcmf_rx_frames(struct device *dev, struct sk_buff_head *skb_list) ...@@ -519,29 +518,24 @@ void brcmf_rx_frames(struct device *dev, struct sk_buff_head *skb_list)
u8 ifidx; u8 ifidx;
int ret; int ret;
brcmf_dbg(DATA, "Enter: %s: count=%u\n", dev_name(dev), brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb);
skb_queue_len(skb_list));
skb_queue_walk_safe(skb_list, skb, pnext) { /* process and remove protocol-specific header */
skb_unlink(skb, skb_list); ret = brcmf_proto_hdrpull(drvr, true, &ifidx, skb);
ifp = drvr->iflist[ifidx];
/* process and remove protocol-specific header */
ret = brcmf_proto_hdrpull(drvr, true, &ifidx, skb);
ifp = drvr->iflist[ifidx];
if (ret || !ifp || !ifp->ndev) {
if ((ret != -ENODATA) && ifp)
ifp->stats.rx_errors++;
brcmu_pkt_buf_free_skb(skb);
continue;
}
rd = (struct brcmf_skb_reorder_data *)skb->cb; if (ret || !ifp || !ifp->ndev) {
if (rd->reorder) if ((ret != -ENODATA) && ifp)
brcmf_rxreorder_process_info(ifp, rd->reorder, skb); ifp->stats.rx_errors++;
else brcmu_pkt_buf_free_skb(skb);
brcmf_netif_rx(ifp, skb); return;
} }
rd = (struct brcmf_skb_reorder_data *)skb->cb;
if (rd->reorder)
brcmf_rxreorder_process_info(ifp, rd->reorder, skb);
else
brcmf_netif_rx(ifp, skb);
} }
void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
......
...@@ -1492,13 +1492,12 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1492,13 +1492,12 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
bus->glom.qlen, pfirst, pfirst->data, bus->glom.qlen, pfirst, pfirst->data,
pfirst->len, pfirst->next, pfirst->len, pfirst->next,
pfirst->prev); pfirst->prev);
skb_unlink(pfirst, &bus->glom);
brcmf_rx_frame(bus->sdiodev->dev, pfirst);
bus->sdcnt.rxglompkts++;
} }
/* sent any remaining packets up */
if (bus->glom.qlen)
brcmf_rx_frames(bus->sdiodev->dev, &bus->glom);
bus->sdcnt.rxglomframes++; bus->sdcnt.rxglomframes++;
bus->sdcnt.rxglompkts += bus->glom.qlen;
} }
return num; return num;
} }
...@@ -1643,7 +1642,6 @@ static void brcmf_pad(struct brcmf_sdio *bus, u16 *pad, u16 *rdlen) ...@@ -1643,7 +1642,6 @@ static void brcmf_pad(struct brcmf_sdio *bus, u16 *pad, u16 *rdlen)
static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
{ {
struct sk_buff *pkt; /* Packet for event or data frames */ struct sk_buff *pkt; /* Packet for event or data frames */
struct sk_buff_head pktlist; /* needed for bus interface */
u16 pad; /* Number of pad bytes to read */ u16 pad; /* Number of pad bytes to read */
uint rxleft = 0; /* Remaining number of frames allowed */ uint rxleft = 0; /* Remaining number of frames allowed */
int ret; /* Return code from calls */ int ret; /* Return code from calls */
...@@ -1845,9 +1843,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1845,9 +1843,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
continue; continue;
} }
skb_queue_head_init(&pktlist); brcmf_rx_frame(bus->sdiodev->dev, pkt);
skb_queue_tail(&pktlist, pkt);
brcmf_rx_frames(bus->sdiodev->dev, &pktlist);
} }
rxcount = maxframes - rxleft; rxcount = maxframes - rxleft;
......
...@@ -435,7 +435,6 @@ static void brcmf_usb_rx_complete(struct urb *urb) ...@@ -435,7 +435,6 @@ static void brcmf_usb_rx_complete(struct urb *urb)
struct brcmf_usbreq *req = (struct brcmf_usbreq *)urb->context; struct brcmf_usbreq *req = (struct brcmf_usbreq *)urb->context;
struct brcmf_usbdev_info *devinfo = req->devinfo; struct brcmf_usbdev_info *devinfo = req->devinfo;
struct sk_buff *skb; struct sk_buff *skb;
struct sk_buff_head skbq;
brcmf_dbg(USB, "Enter, urb->status=%d\n", urb->status); brcmf_dbg(USB, "Enter, urb->status=%d\n", urb->status);
brcmf_usb_del_fromq(devinfo, req); brcmf_usb_del_fromq(devinfo, req);
...@@ -450,10 +449,8 @@ static void brcmf_usb_rx_complete(struct urb *urb) ...@@ -450,10 +449,8 @@ static void brcmf_usb_rx_complete(struct urb *urb)
} }
if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) { if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) {
skb_queue_head_init(&skbq);
skb_queue_tail(&skbq, skb);
skb_put(skb, urb->actual_length); skb_put(skb, urb->actual_length);
brcmf_rx_frames(devinfo->dev, &skbq); brcmf_rx_frame(devinfo->dev, skb);
brcmf_usb_rx_refill(devinfo, req); brcmf_usb_rx_refill(devinfo, req);
} else { } else {
brcmu_pkt_buf_free_skb(skb); brcmu_pkt_buf_free_skb(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册