Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dee77ba authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville
Browse files

brcmfmac: add separate function for passing bus tx overhead



The common driver needs the packet overhead for the bus in order
to reserve headroom for sk_buffs. For the SDIO driver this depends
on firmware features so it is not possible to provide it in the
brcmf_attach() call.

Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-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 1e86d696
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp);
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. */
int brcmf_attach(uint bus_hdrlen, struct device *dev);
int brcmf_attach(struct device *dev);
/* Indication from bus module regarding removal/absence of dongle */
/* Indication from bus module regarding removal/absence of dongle */
void brcmf_detach(struct device *dev);
void brcmf_detach(struct device *dev);
/* Indication from bus module that dongle should be reset */
/* Indication from bus module that dongle should be reset */
@@ -151,6 +151,7 @@ void brcmf_txflowblock(struct device *dev, bool state);
void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);
void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);


int brcmf_bus_start(struct device *dev);
int brcmf_bus_start(struct device *dev);
void brcmf_bus_add_txhdrlen(struct device *dev, uint len);


#ifdef CONFIG_BRCMFMAC_SDIO
#ifdef CONFIG_BRCMFMAC_SDIO
void brcmf_sdio_exit(void);
void brcmf_sdio_exit(void);
+12 −2
Original line number Original line Diff line number Diff line
@@ -1016,7 +1016,7 @@ void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx)
	}
	}
}
}


int brcmf_attach(uint bus_hdrlen, struct device *dev)
int brcmf_attach(struct device *dev)
{
{
	struct brcmf_pub *drvr = NULL;
	struct brcmf_pub *drvr = NULL;
	int ret = 0;
	int ret = 0;
@@ -1031,7 +1031,7 @@ int brcmf_attach(uint bus_hdrlen, struct device *dev)
	mutex_init(&drvr->proto_block);
	mutex_init(&drvr->proto_block);


	/* Link to bus module */
	/* Link to bus module */
	drvr->hdrlen = bus_hdrlen;
	drvr->hdrlen = 0;
	drvr->bus_if = dev_get_drvdata(dev);
	drvr->bus_if = dev_get_drvdata(dev);
	drvr->bus_if->drvr = drvr;
	drvr->bus_if->drvr = drvr;


@@ -1138,6 +1138,16 @@ int brcmf_bus_start(struct device *dev)
	return 0;
	return 0;
}
}


void brcmf_bus_add_txhdrlen(struct device *dev, uint len)
{
	struct brcmf_bus *bus_if = dev_get_drvdata(dev);
	struct brcmf_pub *drvr = bus_if->drvr;

	if (drvr) {
		drvr->hdrlen += len;
	}
}

static void brcmf_bus_detach(struct brcmf_pub *drvr)
static void brcmf_bus_detach(struct brcmf_pub *drvr)
{
{
	brcmf_dbg(TRACE, "Enter\n");
	brcmf_dbg(TRACE, "Enter\n");
+3 −1
Original line number Original line Diff line number Diff line
@@ -3983,7 +3983,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
	bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN;
	bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN;


	/* Attach to the common layer, reserve hdr space */
	/* Attach to the common layer, reserve hdr space */
	ret = brcmf_attach(bus->tx_hdrlen, bus->sdiodev->dev);
	ret = brcmf_attach(bus->sdiodev->dev);
	if (ret != 0) {
	if (ret != 0) {
		brcmf_err("brcmf_attach failed\n");
		brcmf_err("brcmf_attach failed\n");
		goto fail;
		goto fail;
@@ -4027,6 +4027,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
		list_add(&dlst->list, &bus->sdiodev->bus_if->dcmd_list);
		list_add(&dlst->list, &bus->sdiodev->bus_if->dcmd_list);
	}
	}


	brcmf_bus_add_txhdrlen(bus->sdiodev->dev, bus->tx_hdrlen);

	/* if firmware path present try to download and bring up bus */
	/* if firmware path present try to download and bring up bus */
	ret = brcmf_bus_start(bus->sdiodev->dev);
	ret = brcmf_bus_start(bus->sdiodev->dev);
	if (ret != 0) {
	if (ret != 0) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -1255,7 +1255,7 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo)
	bus->chiprev = bus_pub->chiprev;
	bus->chiprev = bus_pub->chiprev;


	/* Attach to the common driver interface */
	/* Attach to the common driver interface */
	ret = brcmf_attach(0, dev);
	ret = brcmf_attach(dev);
	if (ret) {
	if (ret) {
		brcmf_err("brcmf_attach failed\n");
		brcmf_err("brcmf_attach failed\n");
		goto fail;
		goto fail;
@@ -1454,7 +1454,7 @@ static int brcmf_usb_resume(struct usb_interface *intf)
	struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(&usb->dev);
	struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(&usb->dev);


	brcmf_dbg(USB, "Enter\n");
	brcmf_dbg(USB, "Enter\n");
	if (!brcmf_attach(0, devinfo->dev))
	if (!brcmf_attach(devinfo->dev))
		return brcmf_bus_start(&usb->dev);
		return brcmf_bus_start(&usb->dev);


	return 0;
	return 0;