Commit 1ae00421 authored by Franky Lin's avatar Franky Lin Committed by John W. Linville

brcm80211: fmac: remove oneline proto block functions

brcmf_os_proto_block and brcmf_os_proto_unblock are oneline
functions handling proto_block mutex. Place the mutex interface
call inline to increase readability.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d08b6a37
...@@ -734,9 +734,6 @@ extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, ...@@ -734,9 +734,6 @@ extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
uint cmd, void *buf, uint len); uint cmd, void *buf, uint len);
/* OS independent layer functions */
extern int brcmf_os_proto_block(struct brcmf_pub *drvr);
extern int brcmf_os_proto_unblock(struct brcmf_pub *drvr);
#ifdef BCMDBG #ifdef BCMDBG
extern int brcmf_write_to_file(struct brcmf_pub *drvr, const u8 *buf, int size); extern int brcmf_write_to_file(struct brcmf_pub *drvr, const u8 *buf, int size);
#endif /* BCMDBG */ #endif /* BCMDBG */
......
...@@ -284,7 +284,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd, ...@@ -284,7 +284,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n"); brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n");
return ret; return ret;
} }
brcmf_os_proto_block(drvr); mutex_lock(&drvr->proto_block);
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
...@@ -338,7 +338,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd, ...@@ -338,7 +338,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
prot->pending = false; prot->pending = false;
done: done:
brcmf_os_proto_unblock(drvr); mutex_unlock(&drvr->proto_block);
return ret; return ret;
} }
...@@ -470,19 +470,19 @@ int brcmf_proto_init(struct brcmf_pub *drvr) ...@@ -470,19 +470,19 @@ int brcmf_proto_init(struct brcmf_pub *drvr)
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
brcmf_os_proto_block(drvr); mutex_lock(&drvr->proto_block);
/* Get the device MAC address */ /* Get the device MAC address */
strcpy(buf, "cur_etheraddr"); strcpy(buf, "cur_etheraddr");
ret = brcmf_proto_cdc_query_dcmd(drvr, 0, BRCMF_C_GET_VAR, ret = brcmf_proto_cdc_query_dcmd(drvr, 0, BRCMF_C_GET_VAR,
buf, sizeof(buf)); buf, sizeof(buf));
if (ret < 0) { if (ret < 0) {
brcmf_os_proto_unblock(drvr); mutex_unlock(&drvr->proto_block);
return ret; return ret;
} }
memcpy(drvr->mac, buf, ETH_ALEN); memcpy(drvr->mac, buf, ETH_ALEN);
brcmf_os_proto_unblock(drvr); mutex_unlock(&drvr->proto_block);
ret = brcmf_c_preinit_dcmds(drvr); ret = brcmf_c_preinit_dcmds(drvr);
......
...@@ -804,7 +804,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr) ...@@ -804,7 +804,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
int scan_unassoc_time = 40; int scan_unassoc_time = 40;
int i; int i;
brcmf_os_proto_block(drvr); mutex_lock(&drvr->proto_block);
/* Set Country code */ /* Set Country code */
if (drvr->country_code[0] != 0) { if (drvr->country_code[0] != 0) {
...@@ -873,7 +873,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr) ...@@ -873,7 +873,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
0, true); 0, true);
} }
brcmf_os_proto_unblock(drvr); mutex_unlock(&drvr->proto_block);
return 0; return 0;
} }
...@@ -1112,25 +1112,6 @@ void brcmf_detach(struct brcmf_pub *drvr) ...@@ -1112,25 +1112,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
} }
} }
int brcmf_os_proto_block(struct brcmf_pub *drvr)
{
if (drvr) {
mutex_lock(&drvr->proto_block);
return 1;
}
return 0;
}
int brcmf_os_proto_unblock(struct brcmf_pub *drvr)
{
if (drvr) {
mutex_unlock(&drvr->proto_block);
return 1;
}
return 0;
}
static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr) static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr)
{ {
return atomic_read(&drvr->pend_8021x_cnt); return atomic_read(&drvr->pend_8021x_cnt);
......
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