Commit 44a94f62 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: cleaned up buffer len defines in fullmac

Code cleanup. Replaced identical definition BRCMF_C_DCMD_MAXLEN
by BRCMF_DCMD_MAXLEN. Renamed related buffer len definitions.
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2228b27d
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#define BRCMF_VERSION_STR "4.218.248.5" #define BRCMF_VERSION_STR "4.218.248.5"
#define BRCMF_C_DCMD_SMLEN 256 /* "small" cmd buffer required */
#define BRCMF_C_DCMD_MEDLEN 1536 /* "med" cmd buffer required */
#define BRCMF_C_DCMD_MAXLEN 8192
/******************************************************************************* /*******************************************************************************
* IO codes that are interpreted by dongle firmware * IO codes that are interpreted by dongle firmware
******************************************************************************/ ******************************************************************************/
...@@ -749,6 +745,8 @@ extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg); ...@@ -749,6 +745,8 @@ extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
int enable, int master_mode); int enable, int master_mode);
#define BRCMF_DCMD_SMLEN 256 /* "small" cmd buffer required */
#define BRCMF_DCMD_MEDLEN 1536 /* "med" cmd buffer required */
#define BRCMF_DCMD_MAXLEN 8192 /* max length cmd buffer required */ #define BRCMF_DCMD_MAXLEN 8192 /* max length cmd buffer required */
/* message levels */ /* message levels */
......
...@@ -97,7 +97,7 @@ struct brcmf_proto { ...@@ -97,7 +97,7 @@ struct brcmf_proto {
u32 lastcmd; u32 lastcmd;
u8 bus_header[BUS_HEADER_LEN]; u8 bus_header[BUS_HEADER_LEN];
struct brcmf_proto_cdc_dcmd msg; struct brcmf_proto_cdc_dcmd msg;
unsigned char buf[BRCMF_C_DCMD_MAXLEN + ROUND_UP_MARGIN]; unsigned char buf[BRCMF_DCMD_MAXLEN + ROUND_UP_MARGIN];
}; };
static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr) static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
...@@ -288,7 +288,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd, ...@@ -288,7 +288,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
if (len > BRCMF_C_DCMD_MAXLEN) if (len > BRCMF_DCMD_MAXLEN)
goto done; goto done;
if (prot->pending == true) { if (prot->pending == true) {
...@@ -435,7 +435,7 @@ int brcmf_proto_attach(struct brcmf_pub *drvr) ...@@ -435,7 +435,7 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
drvr->prot = cdc; drvr->prot = cdc;
drvr->hdrlen += BDC_HEADER_LEN; drvr->hdrlen += BDC_HEADER_LEN;
drvr->maxctl = BRCMF_C_DCMD_MAXLEN + drvr->maxctl = BRCMF_DCMD_MAXLEN +
sizeof(struct brcmf_proto_cdc_dcmd) + ROUND_UP_MARGIN; sizeof(struct brcmf_proto_cdc_dcmd) + ROUND_UP_MARGIN;
return 0; return 0;
......
...@@ -342,7 +342,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ...@@ -342,7 +342,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
static s32 brcmf_dev_intvar_set(struct net_device *ndev, s8 *name, s32 val) static s32 brcmf_dev_intvar_set(struct net_device *ndev, s8 *name, s32 val)
{ {
s8 buf[BRCMF_C_DCMD_SMLEN]; s8 buf[BRCMF_DCMD_SMLEN];
u32 len; u32 len;
s32 err = 0; s32 err = 0;
__le32 val_le; __le32 val_le;
...@@ -363,7 +363,7 @@ static s32 ...@@ -363,7 +363,7 @@ static s32
brcmf_dev_intvar_get(struct net_device *ndev, s8 *name, s32 *retval) brcmf_dev_intvar_get(struct net_device *ndev, s8 *name, s32 *retval)
{ {
union { union {
s8 buf[BRCMF_C_DCMD_SMLEN]; s8 buf[BRCMF_DCMD_SMLEN];
__le32 val; __le32 val;
} var; } var;
u32 len; u32 len;
...@@ -451,7 +451,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan, ...@@ -451,7 +451,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
params = kzalloc(params_size, GFP_KERNEL); params = kzalloc(params_size, GFP_KERNEL);
if (!params) if (!params)
return -ENOMEM; return -ENOMEM;
BUG_ON(params_size >= BRCMF_C_DCMD_SMLEN); BUG_ON(params_size >= BRCMF_DCMD_SMLEN);
wl_iscan_prep(&params->params_le, ssid); wl_iscan_prep(&params->params_le, ssid);
...@@ -460,7 +460,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan, ...@@ -460,7 +460,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
params->scan_duration = cpu_to_le16(0); params->scan_duration = cpu_to_le16(0);
err = brcmf_dev_iovar_setbuf(iscan->ndev, "iscan", params, params_size, err = brcmf_dev_iovar_setbuf(iscan->ndev, "iscan", params, params_size,
iscan->dcmd_buf, BRCMF_C_DCMD_SMLEN); iscan->dcmd_buf, BRCMF_DCMD_SMLEN);
if (err) { if (err) {
if (err == -EBUSY) if (err == -EBUSY)
WL_INFO("system busy : iscan canceled\n"); WL_INFO("system busy : iscan canceled\n");
......
...@@ -106,7 +106,7 @@ do { \ ...@@ -106,7 +106,7 @@ do { \
#define WL_DCMD_LEN_MAX 1024 #define WL_DCMD_LEN_MAX 1024
#define WL_EXTRA_BUF_MAX 2048 #define WL_EXTRA_BUF_MAX 2048
#define WL_ISCAN_BUF_MAX 2048 /* #define WL_ISCAN_BUF_MAX 2048 /*
* the buf length can be BRCMF_C_DCMD_MAXLEN * the buf length can be BRCMF_DCMD_MAXLEN
* to reduce iteration * to reduce iteration
*/ */
#define WL_ISCAN_TIMER_INTERVAL_MS 3000 #define WL_ISCAN_TIMER_INTERVAL_MS 3000
...@@ -251,7 +251,7 @@ struct brcmf_cfg80211_iscan_ctrl { ...@@ -251,7 +251,7 @@ struct brcmf_cfg80211_iscan_ctrl {
struct work_struct work; struct work_struct work;
struct brcmf_cfg80211_iscan_eloop el; struct brcmf_cfg80211_iscan_eloop el;
void *data; void *data;
s8 dcmd_buf[BRCMF_C_DCMD_SMLEN]; s8 dcmd_buf[BRCMF_DCMD_SMLEN];
s8 scan_buf[WL_ISCAN_BUF_MAX]; s8 scan_buf[WL_ISCAN_BUF_MAX];
}; };
......
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