Skip to content

Commit

Permalink
Wireless driver changes (existz) namely:
Browse files Browse the repository at this point in the history
net: wireless: bcm4329: Disable wake irq at driver stop
net: wireless: bcm4329: Allocate skb with GFP_KERNEL flag if possible
net: wireless: bcm4329: Reduce listen interval to 10 (from 20)
net: wireless: bcm4329: compile wifi driver as Os
net: wireless: bcm4329: Fix scan timeout for abg case
bcm4329: updates from samsung infuse source
Revert "bcm4329: updates from samsung infuse source"
bcm4329: driver update from infuse, minus the part that breaks mobileAP
bcm4329: include only the part of the infuse wifi patch that fixes wifi
  • Loading branch information
kangtastic committed Oct 19, 2011
1 parent 2f5edb7 commit a32bb85
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/kernel/drivers/net/wireless/bcm4329/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
subdir-ccflags-y += -Os

EXTRA_CFLAGS += -Dlinux -DLINUX -DBDC -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 \
-DDHD_GPL -DDHD_SCHED -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DDHD_BCMEVENTS \
-DSHOW_EVENTS -DANDROID_SPECIFIC -DENABLE_DEEP_SLEEP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,20 @@ int bcmsdh_register_oob_intr(void * dhdp)
return 0;
}

void bcmsdh_set_irq(int flag)
{
if (sdhcinfo->oob_irq_registered) {
SDLX_MSG(("%s Flag = %d", __FUNCTION__, flag));
if (flag) {
enable_irq(sdhcinfo->oob_irq);
enable_irq_wake(sdhcinfo->oob_irq);
} else {
disable_irq_wake(sdhcinfo->oob_irq);
disable_irq(sdhcinfo->oob_irq);
}
}
}

void bcmsdh_unregister_oob_intr(void)
{
SDLX_MSG(("%s: Enter\n", __FUNCTION__));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,9 @@ dhd_module_init(void)
printf("\n%s\n", dhd_version);
else {
DHD_ERROR(("%s: sdio_register_driver failed\n", __FUNCTION__));
#if defined(CUSTOMER_HW_SAMSUNG) && defined(CONFIG_WIFI_CONTROL_FUNC)
wifi_del_dev();
#endif
goto faild;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
Expand All @@ -2614,6 +2617,9 @@ dhd_module_init(void)
error = -EINVAL;
DHD_ERROR(("%s: sdio_register_driver timeout\n", __FUNCTION__));
dhd_bus_unregister();
#if defined(CUSTOMER_HW_SAMSUNG) && defined(CONFIG_WIFI_CONTROL_FUNC)
wifi_del_dev();
#endif
}
#endif
return error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len);

extern void bcmsdh_set_irq(int flag);

#ifdef DHD_DEBUG
/* Device console log buffer state */
typedef struct dhd_console {
Expand Down Expand Up @@ -1867,7 +1869,7 @@ dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
DHD_ERROR(("%s: %s\n", __FUNCTION__, strbuf.origbuf));
}

#ifdef DHD_DEBUG
#if 0
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
/* Mem dump to a file on device */
dhdsdio_mem_dump(bus);
Expand Down Expand Up @@ -5826,6 +5828,9 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
/* Stop the bus, disable F2 */
dhd_bus_stop(bus, FALSE);

#if defined(OOB_INTR_ONLY)
bcmsdh_set_irq(FALSE);
#endif /* defined(OOB_INTR_ONLY) */
/* Clean tx/rx buffer pointers, detach from the dongle */
dhdsdio_release_dongle(bus, bus->dhd->osh);

Expand Down Expand Up @@ -5861,6 +5866,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
bcmerror = dhd_bus_init((dhd_pub_t *) bus->dhd, FALSE);
if (bcmerror == BCME_OK) {
#if defined(OOB_INTR_ONLY)
bcmsdh_set_irq(TRUE);
dhd_enable_oob_intr(bus, TRUE);
#endif /* defined(OOB_INTR_ONLY) */

Expand Down
153 changes: 153 additions & 0 deletions src/kernel/drivers/net/wireless/bcm4329/src/include/spid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
* SPI device spec header file
*
* Copyright (C) 2010, Broadcom Corporation
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
* the contents of this file may not be disclosed to third parties, copied
* or duplicated in any form, in whole or in part, without the prior
* written permission of Broadcom Corporation.
*
* $Id: spid.h,v 1.7.10.1.16.3 2009/04/09 19:23:14 Exp $
*/

#ifndef _SPI_H
#define _SPI_H

/*
* Brcm SPI Device Register Map.
*
*/

typedef volatile struct {
uint8 config; /* 0x00, len, endian, clock, speed, polarity, wakeup */
uint8 response_delay; /* 0x01, read response delay in bytes (corerev < 3) */
uint8 status_enable; /* 0x02, status-enable, intr with status, response_delay
* function selection, command/data error check
*/
uint8 reset_bp; /* 0x03, reset on wlan/bt backplane reset (corerev >= 1) */
uint16 intr_reg; /* 0x04, Intr status register */
uint16 intr_en_reg; /* 0x06, Intr mask register */
uint32 status_reg; /* 0x08, RO, Status bits of last spi transfer */
uint16 f1_info_reg; /* 0x0c, RO, enabled, ready for data transfer, blocksize */
uint16 f2_info_reg; /* 0x0e, RO, enabled, ready for data transfer, blocksize */
uint16 f3_info_reg; /* 0x10, RO, enabled, ready for data transfer, blocksize */
uint32 test_read; /* 0x14, RO 0xfeedbead signature */
uint32 test_rw; /* 0x18, RW */
uint8 resp_delay_f0; /* 0x1c, read resp delay bytes for F0 (corerev >= 3) */
uint8 resp_delay_f1; /* 0x1d, read resp delay bytes for F1 (corerev >= 3) */
uint8 resp_delay_f2; /* 0x1e, read resp delay bytes for F2 (corerev >= 3) */
uint8 resp_delay_f3; /* 0x1f, read resp delay bytes for F3 (corerev >= 3) */
} spi_regs_t;

/* SPI device register offsets */
#define SPID_CONFIG 0x00
#define SPID_RESPONSE_DELAY 0x01
#define SPID_STATUS_ENABLE 0x02
#define SPID_RESET_BP 0x03 /* (corerev >= 1) */
#define SPID_INTR_REG 0x04 /* 16 bits - Interrupt status */
#define SPID_INTR_EN_REG 0x06 /* 16 bits - Interrupt mask */
#define SPID_STATUS_REG 0x08 /* 32 bits */
#define SPID_F1_INFO_REG 0x0C /* 16 bits */
#define SPID_F2_INFO_REG 0x0E /* 16 bits */
#define SPID_F3_INFO_REG 0x10 /* 16 bits */
#define SPID_TEST_READ 0x14 /* 32 bits */
#define SPID_TEST_RW 0x18 /* 32 bits */
#define SPID_RESP_DELAY_F0 0x1c /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F1 0x1d /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F2 0x1e /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F3 0x1f /* 8 bits (corerev >= 3) */

/* Bit masks for SPID_CONFIG device register */
#define WORD_LENGTH_32 0x1 /* 0/1 16/32 bit word length */
#define ENDIAN_BIG 0x2 /* 0/1 Little/Big Endian */
#define CLOCK_PHASE 0x4 /* 0/1 clock phase delay */
#define CLOCK_POLARITY 0x8 /* 0/1 Idle state clock polarity is low/high */
#define HIGH_SPEED_MODE 0x10 /* 1/0 High Speed mode / Normal mode */
#define INTR_POLARITY 0x20 /* 1/0 Interrupt active polarity is high/low */
#define WAKE_UP 0x80 /* 0/1 Wake-up command from Host to WLAN */

/* Bit mask for SPID_RESPONSE_DELAY device register */
#define RESPONSE_DELAY_MASK 0xFF /* Configurable rd response delay in multiples of 8 bits */

/* Bit mask for SPID_STATUS_ENABLE device register */
#define STATUS_ENABLE 0x1 /* 1/0 Status sent/not sent to host after read/write */
#define INTR_WITH_STATUS 0x2 /* 0/1 Do-not / do-interrupt if status is sent */
#define RESP_DELAY_ALL 0x4 /* Applicability of resp delay to F1 or all func's read */
#define DWORD_PKT_LEN_EN 0x8 /* Packet len denoted in dwords instead of bytes */
#define CMD_ERR_CHK_EN 0x20 /* Command error check enable */
#define DATA_ERR_CHK_EN 0x40 /* Data error check enable */

/* Bit mask for SPID_RESET_BP device register */
#define RESET_ON_WLAN_BP_RESET 0x4 /* enable reset for WLAN backplane */
#define RESET_ON_BT_BP_RESET 0x8 /* enable reset for BT backplane */
#define RESET_SPI 0x80 /* reset the above enabled logic */

/* Bit mask for SPID_INTR_REG device register */
#define DATA_UNAVAILABLE 0x0001 /* Requested data not available; Clear by writing a "1" */
#define F2_F3_FIFO_RD_UNDERFLOW 0x0002
#define F2_F3_FIFO_WR_OVERFLOW 0x0004
#define COMMAND_ERROR 0x0008 /* Cleared by writing 1 */
#define DATA_ERROR 0x0010 /* Cleared by writing 1 */
#define F2_PACKET_AVAILABLE 0x0020
#define F3_PACKET_AVAILABLE 0x0040
#define F1_OVERFLOW 0x0080 /* Due to last write. Bkplane has pending write requests */
#define MISC_INTR0 0x0100
#define MISC_INTR1 0x0200
#define MISC_INTR2 0x0400
#define MISC_INTR3 0x0800
#define MISC_INTR4 0x1000
#define F1_INTR 0x2000
#define F2_INTR 0x4000
#define F3_INTR 0x8000

/* Bit mask for 32bit SPID_STATUS_REG device register */
#define STATUS_DATA_NOT_AVAILABLE 0x00000001
#define STATUS_UNDERFLOW 0x00000002
#define STATUS_OVERFLOW 0x00000004
#define STATUS_F2_INTR 0x00000008
#define STATUS_F3_INTR 0x00000010
#define STATUS_F2_RX_READY 0x00000020
#define STATUS_F3_RX_READY 0x00000040
#define STATUS_HOST_CMD_DATA_ERR 0x00000080
#define STATUS_F2_PKT_AVAILABLE 0x00000100
#define STATUS_F2_PKT_LEN_MASK 0x000FFE00
#define STATUS_F2_PKT_LEN_SHIFT 9
#define STATUS_F3_PKT_AVAILABLE 0x00100000
#define STATUS_F3_PKT_LEN_MASK 0xFFE00000
#define STATUS_F3_PKT_LEN_SHIFT 21

/* Bit mask for 16 bits SPID_F1_INFO_REG device register */
#define F1_ENABLED 0x0001
#define F1_RDY_FOR_DATA_TRANSFER 0x0002
#define F1_MAX_PKT_SIZE 0x01FC

/* Bit mask for 16 bits SPID_F2_INFO_REG device register */
#define F2_ENABLED 0x0001
#define F2_RDY_FOR_DATA_TRANSFER 0x0002
#define F2_MAX_PKT_SIZE 0x3FFC

/* Bit mask for 16 bits SPID_F3_INFO_REG device register */
#define F3_ENABLED 0x0001
#define F3_RDY_FOR_DATA_TRANSFER 0x0002
#define F3_MAX_PKT_SIZE 0x3FFC

/* Bit mask for 32 bits SPID_TEST_READ device register read in 16bit LE mode */
#define TEST_RO_DATA_32BIT_LE 0xFEEDBEAD

/* Maximum number of I/O funcs */
#define SPI_MAX_IOFUNCS 4

#define SPI_MAX_PKT_LEN (2048*4)

/* Misc defines */
#define SPI_FUNC_0 0
#define SPI_FUNC_1 1
#define SPI_FUNC_2 2
#define SPI_FUNC_3 3

#define WAIT_F2RXFIFORDY 100
#define WAIT_F2RXFIFORDY_DELAY 20

#endif /* _SPI_H */
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ typedef struct wl_ioctl {
#define PM_MAX 1
#define PM_FAST 2

#define LISTEN_INTERVAL 20
#define LISTEN_INTERVAL 10

#define INTERFERE_NONE 0
#define NON_WLAN 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ void*
osl_pktget(osl_t *osh, uint len)
{
struct sk_buff *skb;
gfp_t flags;

if ((skb = dev_alloc_skb(len))) {
flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
if ((skb = __dev_alloc_skb(len, flags))) {
skb_put(skb, len);
skb->priority = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/net/wireless/bcm4329/src/wl/sys/wl_iw.c
Original file line number Diff line number Diff line change
Expand Up @@ -9045,7 +9045,7 @@ int wl_iw_attach(struct net_device *dev, void * dhdp)
#endif


iscan->timer_ms = 3000;
iscan->timer_ms = 8000;
init_timer(&iscan->timer);
iscan->timer.data = (ulong)iscan;
iscan->timer.function = wl_iw_timerfunc;
Expand Down

0 comments on commit a32bb85

Please sign in to comment.