staging: brcm80211: brcmfmac driver cleanup
cover staging: brcm80211: brcmfmac driver cleanup
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Message-ID: <[email protected]>
Arend van Spriel (1):
staging: brcm80211: use wait queues instead of semaphores in
wl_cfg80211.c
Franky Lin (13):
staging: brcm80211: remove iovar IOV_BLOCKSIZE in brcmfmac
staging: brcm80211: remove struct sdioh_info from brcmfmac
staging: brcm80211: remove global var gInstance from brcmfmac
staging: brcm80211: remove wext traces in fullmac
staging: brcm80211: absorb brcmf_sdioh_iovar_op into
brcmf_sdcard_iovar_op
staging: brcm80211: absorb brcmf_sdioh_interrupt_register into
brcmf_sdcard_intr_reg
staging: brcm80211: absorb brcmf_sdioh_interrupt_deregister into
brcmf_sdcard_intr_dereg
staging: brcm80211: absorb brcmf_sdioh_abort into brcmf_sdcard_abort
staging: brcm80211: remove dead code from dhd_sdio.c
staging: brcm80211: remove wrapper functions in bcmsdh_sdmmc.c
staging: brcm80211: remove unused parameter from data interface in
fullmac
staging: brcm80211: remove dead SDTEST code from fullmac
staging: brcm80211: remove unused func parameter in wl_cfg80211 of
fullmac
drivers/staging/brcm80211/Kconfig | 2 - drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 197 +++++- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 555 ++++------------ drivers/staging/brcm80211/brcmfmac/dhd.h | 37 - drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 744 ++------------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 80 +-- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 74 ++- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 5 +- 8 files changed, 409 insertions(+), 1285 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/14 staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
In wl_cfg80211.c two semaphores were used to trigger a task to process an event. The wait queues are better suited for that purpose. This also removes checkpatch warning on sema_init() calls in this source file.
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 49 +++++++++++++++------- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 5 +- 2 files changed, 36 insertions(+), 18 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +34 -15
@@ -3162,7 +3162,7 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)static s32 brcmf_create_event_handler (struct brcmf_cfg80211_priv *cfg_priv) { -sema_init (&cfg_priv->event_sync,0 ); +init_waitqueue_head (&cfg_priv->event_waitq); cfg_priv->event_tsk =kthread_run (brcmf_event_handler, cfg_priv,"wl_event_handler" );if (IS_ERR (cfg_priv->event_tsk)) {
@@ -3224,7 +3224,7 @@ static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan) {if (likely (iscan->state !=WL_ISCAN_STATE_IDLE )) {WL_SCAN ("wake up iscan\n" ); -up (&iscan->sync); +wake_up (&iscan->waitq);return 0 ; }
@@ -3330,13 +3330,19 @@ static s32 brcmf_iscan_thread(void *data) (struct brcmf_cfg80211_iscan_ctrl *)data;struct brcmf_cfg80211_priv *cfg_priv =iscan_to_cfg (iscan);struct brcmf_cfg80211_iscan_eloop *el = &iscan->el; +DECLARE_WAITQUEUE (wait, current);u32 status;int err =0 ;sched_setscheduler (current,SCHED_FIFO , ¶m);allow_signal (SIGTERM ); status =BRCMF_SCAN_RESULTS_PARTIAL ; -while (likely (!down_interruptible (&iscan->sync))) { +add_wait_queue (&iscan->waitq, &wait); +while (1 ) { +prepare_to_wait (&iscan->waitq, &wait,TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ;if (iscan->timer_on) {
@@ -3353,6 +3359,7 @@ static s32 brcmf_iscan_thread(void *data)rtnl_unlock (); el->handler[status](cfg_priv); } +finish_wait (&iscan->waitq, &wait);if (iscan->timer_on) {del_timer_sync (&iscan->timer); iscan->timer_on =0 ;
@@ -3380,7 +3387,7 @@ static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)if (cfg_priv->iscan_on && !iscan->tsk) { iscan->state =WL_ISCAN_STATE_IDLE ; -sema_init (&iscan->sync,0 ); +init_waitqueue_head (&iscan->waitq); iscan->tsk =kthread_run (brcmf_iscan_thread, iscan,"wl_iscan" );if (IS_ERR (iscan->tsk)) {WL_ERR ("Could not create iscan thread\n" );
@@ -3528,7 +3535,7 @@ void brcmf_cfg80211_detach(void)static void brcmf_wakeup_event (struct brcmf_cfg80211_priv *cfg_priv) { -up (&cfg_priv->event_sync); +wake_up (&cfg_priv->event_waitq); }static s32 brcmf_event_handler (void *data)
@@ -3537,27 +3544,39 @@ static s32 brcmf_event_handler(void *data) (struct brcmf_cfg80211_priv *)data;struct sched_param param = {.sched_priority =MAX_RT_PRIO -1 };struct brcmf_cfg80211_event_q *e; +DECLARE_WAITQUEUE (wait, current);sched_setscheduler (current,SCHED_FIFO , ¶m);allow_signal (SIGTERM ); -while (likely (!down_interruptible (&cfg_priv->event_sync))) { +add_wait_queue (&cfg_priv->event_waitq, &wait); +while (1 ) { +prepare_to_wait (&cfg_priv->event_waitq, &wait, +TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ; + e =brcmf_deq_event (cfg_priv);if (unlikely (!e)) {WL_ERR ("event queue empty...\n" ); -BUG (); +continue ; } -WL_INFO ("event type (%d)\n" , e->etype); -if (cfg_priv->el.handler[e->etype]) - cfg_priv->el.handler[e->etype](cfg_priv, -cfg_to_ndev (cfg_priv), - &e->emsg, e->edata); -else -WL_INFO ("Unknown Event (%d): ignoring\n" , e->etype); -brcmf_put_event (e); +do { +WL_INFO ("event type (%d)\n" , e->etype); +if (cfg_priv->el.handler[e->etype]) + cfg_priv->el.handler[e->etype](cfg_priv, +cfg_to_ndev (cfg_priv), + &e->emsg, e->edata); +else +WL_INFO ("Unknown Event (%d): ignoring\n" , + e->etype); +brcmf_put_event (e); + }while ((e =brcmf_deq_event (cfg_priv))); } +finish_wait (&cfg_priv->event_waitq, &wait);WL_INFO ("was terminated\n" );return 0 ; }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +2 -3
@@ -249,7 +249,7 @@ struct brcmf_cfg80211_iscan_ctrl {u32 timer_on;s32 state;struct task_struct *tsk; -struct semaphore sync; +wait_queue_head_t waitq;struct brcmf_cfg80211_iscan_eloop el;void *data;s8 ioctl_buf[BRCMF_C_IOCTL_SMLEN ];
@@ -295,13 +295,12 @@ struct brcmf_cfg80211_priv {cfg80211 layer */ struct brcmf_cfg80211_ie ie;/* information element object for internal purpose */ -struct semaphore event_sync;/* for synchronization of main event -thread */ struct brcmf_cfg80211_profile *profile;/* holding dongle profile */ struct brcmf_cfg80211_iscan_ctrl *iscan;/* iscan controller */ struct brcmf_cfg80211_connect_info conn_info;/* association info */ struct brcmf_cfg80211_pmk_list *pmk_list;/* wpa2 pmk list */ struct task_struct *event_tsk;/* task of main event handler thread */ +wait_queue_head_t event_waitq;/* wait queue for main event handling */ unsigned long status;/* current dongle status */ void *pub;u32 channel;/* current channel */
Signature · 1 line
1.7.4.1
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
MjAxMS84LzEyIEFyZW5kIHZhbiBTcHJpZWwgPGFyZW5kQGJyb2FkY29tLmNvbT46Cj4gQEAgLTM1 MzcsMjcgKzM1NDQsMzkgQEAgc3RhdGljIHMzMiBicmNtZl9ldmVudF9oYW5kbGVyKHZvaWQgKmRh dGEpCj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAoc3RydWN0IGJyY21mX2Nm ZzgwMjExX3ByaXYgKilkYXRhOwo+IMKgIMKgIMKgIMKgc3RydWN0IHNjaGVkX3BhcmFtIHBhcmFt ID0gey5zY2hlZF9wcmlvcml0eSA9IE1BWF9SVF9QUklPIC0gMSB9Owo+IMKgIMKgIMKgIMKgc3Ry dWN0IGJyY21mX2Nm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instead of semaphores in wl_cfg80211.c
Quoted 49 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 35 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +11
-10@@ -3537,27 +3544,39 @@ static s32 brcmf_event_handler(void *data) (struct brcmf_cfg80211_priv *)data;struct sched_param param = {.sched_priority =MAX_RT_PRIO -1 };struct brcmf_cfg80211_event_q *e; +DECLARE_WAITQUEUE (wait, current);sched_setscheduler (current,SCHED_FIFO ,¶m);allow_signal (SIGTERM ); -while (likely (!down_interruptible (&cfg_priv->event_sync))) { +add_wait_queue (&cfg_priv->event_waitq,&wait); +while (1 ) { +prepare_to_wait (&cfg_priv->event_waitq,&wait, +TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ; + e =brcmf_deq_event (cfg_priv);if (unlikely (!e)) {WL_ERR ("event queue empty...\n" ); -BUG (); +continue ; } -WL_INFO ("event type (%d)\n" , e->etype); -if (cfg_priv->el.handler[e->etype]) - cfg_priv->el.handler[e->etype](cfg_priv, -cfg_to_ndev (cfg_priv), -&e->emsg, e->edata); -else -WL_INFO ("Unknown Event (%d): ignoring\n" , e->etype); -brcmf_put_event (e); + do {drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c static s32 brcmf_event_handler(void *data) · line 3577
Quoted 10 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +10
-0+WL_INFO ("event type (%d)\n" , e->etype); +if (cfg_priv->el.handler[e->etype]) + cfg_priv->el.handler[e->etype](cfg_priv, +cfg_to_ndev (cfg_priv), +&e->emsg, e->edata); +else +WL_INFO ("Unknown Event (%d): ignoring\n" , + e->etype); +brcmf_put_event (e); + }while ((e =brcmf_deq_event (cfg_priv)));if (((((
care_coding_style)))))fix();
Quoted 2 lines
:-)
I assume you refer to the indents above. Not sure what exactly happened there, but the patch email as I received it looks. Could it be a mail reader issue?
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 50 lines · Arend van Spriel
Quoted 49 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 35 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +11
-10@@ -3537,27 +3544,39 @@ static s32 brcmf_event_handler(void *data) (struct brcmf_cfg80211_priv *)data;struct sched_param param = {.sched_priority =MAX_RT_PRIO -1 };struct brcmf_cfg80211_event_q *e; +DECLARE_WAITQUEUE (wait, current);sched_setscheduler (current,SCHED_FIFO ,¶m);allow_signal (SIGTERM ); -while (likely (!down_interruptible (&cfg_priv->event_sync))) { +add_wait_queue (&cfg_priv->event_waitq,&wait); +while (1 ) { +prepare_to_wait (&cfg_priv->event_waitq,&wait, +TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ; + e =brcmf_deq_event (cfg_priv);if (unlikely (!e)) {WL_ERR ("event queue empty...\n" ); -BUG (); +continue ; } -WL_INFO ("event type (%d)\n" , e->etype); -if (cfg_priv->el.handler[e->etype]) - cfg_priv->el.handler[e->etype](cfg_priv, -cfg_to_ndev (cfg_priv), -&e->emsg, e->edata); -else -WL_INFO ("Unknown Event (%d): ignoring\n" , e->etype); -brcmf_put_event (e); + do {drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c static s32 brcmf_event_handler(void *data) · line 3577
Quoted 10 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +10
-0+WL_INFO ("event type (%d)\n" , e->etype); +if (cfg_priv->el.handler[e->etype]) + cfg_priv->el.handler[e->etype](cfg_priv, +cfg_to_ndev (cfg_priv), +&e->emsg, e->edata); +else +WL_INFO ("Unknown Event (%d): ignoring\n" , + e->etype); +brcmf_put_event (e); + }while ((e =brcmf_deq_event (cfg_priv)));if (((((
care_coding_style)))))fix();
Quoted 7 lines
Quoted 2 lines
:-)
I assume you refer to the indents above. Not sure what exactly happened there, but the patch email as I received it looks. Could it be a mail reader issue?
Gr. AvS
A colleague pointed out you probably meant the while condition. The extra braces may be there because an assignment is done, but in this case it does not make much sense.
I will fix it.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 10 lines · Arend van Spriel
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
+ } while ((e =
brcmf_deq_event(cfg_priv)));if (((((
care_coding_style)))))fix();:-)
I assume you refer to the indents above. Not sure what exactly happened there, but the patch email as I received it looks. Could it be a mail reader issue?
Quoted 5 lines
Quoted 1 line
Gr. AvS
A colleague pointed out you probably meant the while condition. The extra braces may be there because an assignment is done, but in this case it does not make much sense.
Doesn't gcc warn if you don't have two parentheses?
johannes
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
In reply to Arend van SprielQuoted 50 lines · Arend van Spriel
Quoted 49 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 35 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +11
-10@@ -3537,27 +3544,39 @@ static s32 brcmf_event_handler(void *data) (struct brcmf_cfg80211_priv *)data;struct sched_param param = {.sched_priority =MAX_RT_PRIO -1 };struct brcmf_cfg80211_event_q *e; +DECLARE_WAITQUEUE (wait, current);sched_setscheduler (current,SCHED_FIFO ,¶m);allow_signal (SIGTERM ); -while (likely (!down_interruptible (&cfg_priv->event_sync))) { +add_wait_queue (&cfg_priv->event_waitq,&wait); +while (1 ) { +prepare_to_wait (&cfg_priv->event_waitq,&wait, +TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ; + e =brcmf_deq_event (cfg_priv);if (unlikely (!e)) {WL_ERR ("event queue empty...\n" ); -BUG (); +continue ; } -WL_INFO ("event type (%d)\n" , e->etype); -if (cfg_priv->el.handler[e->etype]) - cfg_priv->el.handler[e->etype](cfg_priv, -cfg_to_ndev (cfg_priv), -&e->emsg, e->edata); -else -WL_INFO ("Unknown Event (%d): ignoring\n" , e->etype); -brcmf_put_event (e); + do {drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c static s32 brcmf_event_handler(void *data) · line 3577
Quoted 10 lines
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +10
-0+WL_INFO ("event type (%d)\n" , e->etype); +if (cfg_priv->el.handler[e->etype]) + cfg_priv->el.handler[e->etype](cfg_priv, +cfg_to_ndev (cfg_priv), +&e->emsg, e->edata); +else +WL_INFO ("Unknown Event (%d): ignoring\n" , + e->etype); +brcmf_put_event (e); + }while ((e =brcmf_deq_event (cfg_priv)));if (((((
care_coding_style)))))fix();
Quoted 6 lines
Quoted 2 lines
:-)
I assume you refer to the indents above. Not sure what exactly happened there, but the patch email as I received it looks. Could it be a mail reader issue?
Hi Rafał,
If you are refering to this line
Quoted 1 line
Quoted 1 line
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c static s32 brcmf_event_handler(void *data) · line 3577
Quoted 1 line
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +1
-0+ }while ((e =brcmf_deq_event (cfg_priv)));
The extra parentheses are added to fix a compiler warning:
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c: In function ‘brcmf_event_handler’: drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c:3576: warning: suggest
parentheses around assignment used as truth value
Thanks
Franky
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 8 lines · Franky Lin
If you are refering to this line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ } while ((e =
brcmf_deq_event(cfg_priv)));The extra parentheses are added to fix a compiler warning:
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c: In function ‘brcmf_event_handler’:drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c:3576: warning: suggest parentheses around assignment used as truth value
Does checkpatch allow that assignment in the while statement? I would expect it to want you to
e = brcmf_deq_event(cfg_priv); } while (e);
Larry
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 9 lines · Larry Finger
Quoted 8 lines · Franky Lin
If you are refering to this line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ } while ((e =
brcmf_deq_event(cfg_priv)));The extra parentheses are added to fix a compiler warning:
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c: In function ‘brcmf_event_handler’:drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c:3576: warning: suggest parentheses around assignment used as truth value
Quoted 8 lines
Does checkpatch allow that assignment in the while statement? I would expect it to want you to
e = brcmf_deq_event(cfg_priv); } while (e);Larry
Yep. That is the v2 I sent. btw checkpatch did not complain on the original patch.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCH 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
In reply to Franky LinMjAxMS84LzEyIEZyYW5reSBMaW4gPGZyYW5reWxAYnJvYWRjb20uY29tPjoKPiBPbiAwOC8xMi8y MDExIDA5OjQ0IEFNLCBBcmVuZCB2YW4gU3ByaWVsIHdyb3RlOgo+Pgo+PiBPbiAwOC8xMi8yMDEx IDA0OjA3IFBNLCBSYWZhxYIgTWnFgmVja2kgd3JvdGU6Cj4+Pgo+Pj4gMjAxMS84LzEyIEFyZW5k IHZhbiBTcHJpZWw8YXJlbmRAYnJvYWRjb20uY29tPjoKPj4+Pgo+Pj4+IEBAIC0zNTM3LDI3ICsz NTQ0LDM5IEBAIHN0YXRpYyBzMzIgYnJjbWZfZXZlbnRfaGFuZGxlcih2b2lkICpkYXRhKQo+Pj4+ IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIChzdHJ1Y3QgYnJjbWZfY2ZnODAy MTFfcHJpdiAqKWRhdGE7Cj4+Pj4gwqAgwqAgwqAgwqAgc3RydWN0IHNjaGVkX3BhcmFtIHBhcmFt ID0gey5zY2hlZF9wc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Bhc3N1bWUgeW91IHJl ZmVyIHRvIHRoZSBpbmRlbnRzIGFib3ZlLiBOb3Qgc3VyZSB3aGF0IGV4YWN0bHkgaGFwcGVuZWQK Pj4gdGhlcmUsIGJ1dCB0aGUgcGF0Y2ggZW1haWwgYXMgSSByZWNlaXZlZCBpdCBsb29rcy4gQ291 bGQgaXQgYmUgYSBtYWlsCj4+IHJlYWRlciBpc3N1ZT8KPgo+IEhpIFJhZmHFgiwKPgo+IElmIHlv dSBhcmUgcmVmZXJpbmcgdG8gdGhpcyBsaW5lCj4+Pj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCB9 IHdoaWxlICgoZSA9IGJyY21mX2RlcV9ldmVudChjZmdfcHJpdikpKTsKPgo+IFRoZSBleHRyYSBw YXJlbnRoZXNlcyBhcmUgYWRkZWQgdG8gZml4IGEgY29tcGlsZXIgd2FybmluZzoKPiDCoCDCoCDC oCDCoGRyaXZlcnMvc3RhZ2luZy9icmNtODAyMTEvYnJjbWZtYWMvd2xfY2ZnODAyMTEuYzogSW4g ZnVuY3Rpb24KPiDigJhicmNtZl9ldmVudF9oYW5kbGVy4oCZOgo+IMKgIMKgIMKgIMKgZHJpdmVy cy9zdGFnaW5nL2JyY204MDIxMS9icmNtZm1hYy93bF9jZmc4MDIxMS5jOjM1NzY6IHdhcm5pbmc6 Cj4gc3VnZ2VzdCBwYXJlbnRoZXNlcyBhcm91bmQgYXNzaWdubWVudCB1c2VkIGFzIHRydXRoIHZh bHVlCgpTb3JyeSBmb3IgY29uZnVzaW5nIHlvdSwgSSB0aG91Z2ggaXQncyBPSyB0byB1c2UKd2hp bGUgKGUgPSBzdGgoKSkKSSBjYXVzZWQgYSBsaXR0bGUgb2YgbWVzcyBhbmQgZGlzY3Vzc2lvbiwg dXBzIDp8CgotLSAKUmFmYcWCCg==
PATCH v2 1/14 staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
In reply to Arend van SprielIn wl_cfg80211.c two semaphores were used to trigger a task to process an event. The wait queues are better suited for that purpose. This also removes checkpatch warning on sema_init() calls in this source file.
---
Hi Greg,
This patch replaces the original submitted [01/14] patch identified by:
Message-ID: <[email protected]>
Gr. AvS
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 49 +++++++++++++++------- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 5 +- 2 files changed, 36 insertions(+), 18 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +35 -15
@@ -3162,7 +3162,7 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)static s32 brcmf_create_event_handler (struct brcmf_cfg80211_priv *cfg_priv) { -sema_init (&cfg_priv->event_sync,0 ); +init_waitqueue_head (&cfg_priv->event_waitq); cfg_priv->event_tsk =kthread_run (brcmf_event_handler, cfg_priv,"wl_event_handler" );if (IS_ERR (cfg_priv->event_tsk)) {
@@ -3224,7 +3224,7 @@ static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan) {if (likely (iscan->state !=WL_ISCAN_STATE_IDLE )) {WL_SCAN ("wake up iscan\n" ); -up (&iscan->sync); +wake_up (&iscan->waitq);return 0 ; }
@@ -3330,13 +3330,19 @@ static s32 brcmf_iscan_thread(void *data) (struct brcmf_cfg80211_iscan_ctrl *)data;struct brcmf_cfg80211_priv *cfg_priv =iscan_to_cfg (iscan);struct brcmf_cfg80211_iscan_eloop *el = &iscan->el; +DECLARE_WAITQUEUE (wait, current);u32 status;int err =0 ;sched_setscheduler (current,SCHED_FIFO , ¶m);allow_signal (SIGTERM ); status =BRCMF_SCAN_RESULTS_PARTIAL ; -while (likely (!down_interruptible (&iscan->sync))) { +add_wait_queue (&iscan->waitq, &wait); +while (1 ) { +prepare_to_wait (&iscan->waitq, &wait,TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ;if (iscan->timer_on) {
@@ -3353,6 +3359,7 @@ static s32 brcmf_iscan_thread(void *data)rtnl_unlock (); el->handler[status](cfg_priv); } +finish_wait (&iscan->waitq, &wait);if (iscan->timer_on) {del_timer_sync (&iscan->timer); iscan->timer_on =0 ;
@@ -3380,7 +3387,7 @@ static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)if (cfg_priv->iscan_on && !iscan->tsk) { iscan->state =WL_ISCAN_STATE_IDLE ; -sema_init (&iscan->sync,0 ); +init_waitqueue_head (&iscan->waitq); iscan->tsk =kthread_run (brcmf_iscan_thread, iscan,"wl_iscan" );if (IS_ERR (iscan->tsk)) {WL_ERR ("Could not create iscan thread\n" );
@@ -3528,7 +3535,7 @@ void brcmf_cfg80211_detach(void)static void brcmf_wakeup_event (struct brcmf_cfg80211_priv *cfg_priv) { -up (&cfg_priv->event_sync); +wake_up (&cfg_priv->event_waitq); }static s32 brcmf_event_handler (void *data)
@@ -3537,27 +3544,40 @@ static s32 brcmf_event_handler(void *data) (struct brcmf_cfg80211_priv *)data;struct sched_param param = {.sched_priority =MAX_RT_PRIO -1 };struct brcmf_cfg80211_event_q *e; +DECLARE_WAITQUEUE (wait, current);sched_setscheduler (current,SCHED_FIFO , ¶m);allow_signal (SIGTERM ); -while (likely (!down_interruptible (&cfg_priv->event_sync))) { +add_wait_queue (&cfg_priv->event_waitq, &wait); +while (1 ) { +prepare_to_wait (&cfg_priv->event_waitq, &wait, +TASK_INTERRUPTIBLE ); + +schedule (); +if (kthread_should_stop ())break ; + e =brcmf_deq_event (cfg_priv);if (unlikely (!e)) {WL_ERR ("event queue empty...\n" ); -BUG (); +continue ; } -WL_INFO ("event type (%d)\n" , e->etype); -if (cfg_priv->el.handler[e->etype]) - cfg_priv->el.handler[e->etype](cfg_priv, -cfg_to_ndev (cfg_priv), - &e->emsg, e->edata); -else -WL_INFO ("Unknown Event (%d): ignoring\n" , e->etype); -brcmf_put_event (e); +do { +WL_INFO ("event type (%d)\n" , e->etype); +if (cfg_priv->el.handler[e->etype]) + cfg_priv->el.handler[e->etype](cfg_priv, +cfg_to_ndev (cfg_priv), + &e->emsg, e->edata); +else +WL_INFO ("Unknown Event (%d): ignoring\n" , + e->etype); +brcmf_put_event (e); + e =brcmf_deq_event (cfg_priv); + }while (e !=NULL ); } +finish_wait (&cfg_priv->event_waitq, &wait);WL_INFO ("was terminated\n" );return 0 ; }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +2 -3
@@ -249,7 +249,7 @@ struct brcmf_cfg80211_iscan_ctrl {u32 timer_on;s32 state;struct task_struct *tsk; -struct semaphore sync; +wait_queue_head_t waitq;struct brcmf_cfg80211_iscan_eloop el;void *data;s8 ioctl_buf[BRCMF_C_IOCTL_SMLEN ];
@@ -295,13 +295,12 @@ struct brcmf_cfg80211_priv {cfg80211 layer */ struct brcmf_cfg80211_ie ie;/* information element object for internal purpose */ -struct semaphore event_sync;/* for synchronization of main event -thread */ struct brcmf_cfg80211_profile *profile;/* holding dongle profile */ struct brcmf_cfg80211_iscan_ctrl *iscan;/* iscan controller */ struct brcmf_cfg80211_connect_info conn_info;/* association info */ struct brcmf_cfg80211_pmk_list *pmk_list;/* wpa2 pmk list */ struct task_struct *event_tsk;/* task of main event handler thread */ +wait_queue_head_t event_waitq;/* wait queue for main event handling */ unsigned long status;/* current dongle status */ void *pub;u32 channel;/* current channel */
Signature · 1 line
1.7.4.1
Re: [PATCHv2 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 11 lines · Arend van Spriel
In
wl_cfg80211.ctwo semaphores were used to trigger a task to process an event. The wait queues are better suited for that purpose. This also removes checkpatch warning onsema_init()calls in this source file.Reviewed-by Rafal Milecki<[email protected]>Reviewed-by Roland Vossen<[email protected]>Reviewed-by Franky Lin<[email protected]>Signed-off-by Arend van Spriel<[email protected]>---
Hi Greg,
Quoted 6 lines
This patch replaces the original submitted [01/14] patch identified by:
Message-ID:<[email protected]>
Gr. AvS
---
I should have compiled it before sending v2. Please drop this one and stick with the original patch.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCHv2 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 14 lines · Arend van Spriel
Quoted 13 lines · Arend van Spriel
In
wl_cfg80211.ctwo semaphores were used to trigger a task to process an event. The wait queues are better suited for that purpose. This also removes checkpatch warning onsema_init()calls in this source file.Reviewed-by Rafal Milecki<[email protected]>Reviewed-by Roland Vossen<[email protected]>Reviewed-by Franky Lin<[email protected]>Signed-off-by Arend van Spriel<[email protected]>---
Hi Greg,This patch replaces the original submitted [01/14] patch identified by:
Quoted 9 lines
Quoted 4 lines
Message-ID:<[email protected]>
Gr. AvS
---I should have compiled it before sending v2. Please drop this one and stick with the original patch.
Gr. AvS
Or have people vote which version they prefer. I prefer v2.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCHv2 01/14] staging: brcm80211: use wait queues instead of semaphores in wl_cfg80211.c
Quoted 3 lines · Arend van Spriel
Or have people vote which version they prefer. I prefer v2.
It doesn't really matter either way, but I prefer the original one.
Checkpatch.pl only cares about if statements. This is fairly idiomatic C. After all we wouldn't write a while statement like:
foo = some_func();
while (foo) {
frob();
frob();
foo = some_func();
}We'd just write:
while ((foo = some_func())) {
frob();
frob();
}And do while() feels the same to me.
regards,
dan carpenter
PATCH 2/14 staging: brcm80211: remove iovar IOV_BLOCKSIZE in brcmfmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Iovar IOV_BLOCKSIZE code is not actually setting the sdio function's block size. Use cur_blksize provided by mmc core where necessary.
--- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 52 --------------------- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 31 +------------ drivers/staging/brcm80211/brcmfmac/sdio_host.h | 1 - 3 files changed, 1 insertions(+), 83 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -52
@@ -169,14 +169,12 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0) } sd->num_funcs =2 ; - sd->client_block_size[0 ] =64 ; gInstance->sd = sd;/* Claim host controller */ sdio_claim_host (gInstance->func[1 ]); - sd->client_block_size[1 ] =64 ; err_ret =sdio_set_block_size (gInstance->func[1 ],64 );if (err_ret)BRCMF_ERROR (("%s: Failed to set F1 blocksize\n" , __func__));
@@ -188,7 +186,6 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0)/* Claim host controller F2 */ sdio_claim_host (gInstance->func[2 ]); - sd->client_block_size[2 ] = sd_f2_blocksize; err_ret =sdio_set_block_size (gInstance->func[2 ], sd_f2_blocksize);if (err_ret)
@@ -273,7 +270,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)/* IOVar table */ enum {IOV_MSGLEVEL =1 , -IOV_BLOCKSIZE ,IOV_NUMINTS ,IOV_DEVREG ,IOV_HCIREGS ,
@@ -281,8 +277,6 @@ enum { };const struct brcmu_iovar sdioh_iovars[] = { - {"sd_blocksize" ,IOV_BLOCKSIZE ,0 ,IOVT_UINT32 ,0 },/* ((fn << 16) | -size) */ {"sd_numints" ,IOV_NUMINTS ,0 ,IOVT_UINT32 ,0 }, {"sd_devreg" ,IOV_DEVREG ,0 ,IOVT_BUFFER ,sizeof (struct brcmf_sdreg )} ,
@@ -346,52 +340,6 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name, actionid = set ?IOV_SVAL (vi->varid) :IOV_GVAL (vi->varid);switch (actionid) { -case IOV_GVAL (IOV_BLOCKSIZE ): -if ((u32 ) int_val > si->num_funcs) { - bcmerror = -EINVAL ; -break ; - } - int_val = (s32 ) si->client_block_size[int_val]; -memcpy (arg, &int_val, val_size); -break ; - -case IOV_SVAL (IOV_BLOCKSIZE ): - { -uint func = ((u32 ) int_val >>16 ); -uint blksize = (u16 ) int_val; -uint maxsize; - -if (func > si->num_funcs) { - bcmerror = -EINVAL ; -break ; - } - -switch (func) { -case 0 : - maxsize =32 ; -break ; -case 1 : - maxsize =64 ; -break ; -case 2 : - maxsize =512 ; -break ; -default : - maxsize =0 ; - } -if (blksize > maxsize) { - bcmerror = -EINVAL ; -break ; - } -if (!blksize) - blksize = maxsize; - -/* Now set it */ - si->client_block_size[func] = blksize; - -break ; - } -case IOV_GVAL (IOV_RXCHAIN ): int_val = false;memcpy (arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -30
@@ -3168,24 +3168,6 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name, bcmerror =brcmf_sdcard_iovar_op (bus->sdiodev, name, params, plen, arg, len, set); -/* Similar check for blocksize change */ -if (set &&strcmp (name,"sd_blocksize" ) ==0 ) { -s32 fnum =2 ; -if (brcmf_sdcard_iovar_op - (bus->sdiodev,"sd_blocksize" , &fnum,sizeof (s32), - &bus->blocksize,sizeof (s32), - false) !=0 ) { - bus->blocksize =0 ; -BRCMF_ERROR (("%s: fail on %s get\n" , __func__, -"sd_blocksize" )); - }else { -BRCMF_INFO (("%s: noted sd_blocksize update," -" value now %d\n" , __func__, - bus->blocksize)); - } - } - bus->roundup =min (max_roundup, bus->blocksize); -if (bus->idletime ==BRCMF_IDLE_IMMEDIATE && !bus->dpc_sched) { bus->activity = false;
@@ -5679,8 +5661,6 @@ fail:static bool brcmf_sdbrcm_probe_init (struct brcmf_bus *bus) { -s32 fnum; -BRCMF_TRACE (("%s: Enter\n" , __func__));#ifdef SDTEST
@@ -5705,16 +5685,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus) bus->idleclock =BRCMF_IDLE_ACTIVE ;/* Query the F2 block size, set roundup accordingly */ - fnum =2 ; -if (brcmf_sdcard_iovar_op (bus->sdiodev,"sd_blocksize" , &fnum, -sizeof (s32), &bus->blocksize, -sizeof (s32), false) !=0 ) { - bus->blocksize =0 ; -BRCMF_ERROR (("%s: fail on %s get\n" , __func__,"sd_blocksize" )); - }else { -BRCMF_INFO (("%s: Initial value for %s is %d\n" , - __func__,"sd_blocksize" , bus->blocksize)); - } + bus->blocksize = bus->sdiodev->func2->cur_blksize; bus->roundup =min (max_roundup, bus->blocksize);/* Query if bus module supports packet chaining,
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -1
@@ -129,7 +129,6 @@ struct sdioh_info {int intrcount;/* Client interrupts */ bool sd_blockmode;/* sd_blockmode == false => 64 Byte Cmd 53s. */ /* Must be on for sd_multiblock to be effective */ -int client_block_size[SDIOD_MAX_IOFUNCS ];/* Blocksize */ u8 num_funcs;/* Supported funcs on client */ u32 com_cis_ptr;u32 func_cis_ptr[SDIOD_MAX_IOFUNCS ];
Signature · 1 line
1.7.4.1
Re: [PATCH 02/14] staging: brcm80211: remove iovar IOV_BLOCKSIZE in brcmfmac
2011/8/12 Arend van Spriel <[email protected]>:
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) · line 275
Quoted 8 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0
-1@@ -273,7 +270,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) /* IOVar table */ enum { IOV_MSGLEVEL = 1, - IOV_BLOCKSIZE, IOV_NUMINTS, IOV_DEVREG, IOV_HCIREGS,
You are forcing IOV_MSGLEVEL to 1, so I expected values of IOV_* are really important in some piece of code. Now you change them. AFAIU it means you break something, or you can drop " = 1".
Signature · 1 line
Rafał
Re: [PATCH 02/14] staging: brcm80211: remove iovar IOV_BLOCKSIZE in brcmfmac
Quoted 12 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) · line 275
Quoted 8 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0
-1@@ -273,7 +270,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)/* IOVar table */ enum {IOV_MSGLEVEL =1 , -IOV_BLOCKSIZE ,IOV_NUMINTS ,IOV_DEVREG ,IOV_HCIREGS ,You are forcing
IOV_MSGLEVELto 1, so I expected values of IOV_* are really important in some piece of code. Now you change them. AFAIU it means you break something, or you can drop " = 1".
IOCTL codes do have a strong ordering as user-space application and driver need to have the same code for the same entity. IOVs are internal numbers for the driver only so there is no issue in renumbering those.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
Re: [PATCH 02/14] staging: brcm80211: remove iovar IOV_BLOCKSIZE in brcmfmac
W dniu 12 sierpnia 2011 18:37 użytkownik Arend van Spriel
Quoted 18 lines · <[email protected]> napisał:
Quoted 16 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 10 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0
-1@@ -273,7 +270,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd) /* IOVar table */ enum { IOV_MSGLEVEL = 1, - IOV_BLOCKSIZE, IOV_NUMINTS, IOV_DEVREG,IOV_HCIREGS,
You are forcing
IOV_MSGLEVELto 1, so I expected values of IOV_* are really important in some piece of code. Now you change them. AFAIU it means you break something, or you can drop " = 1".
Quoted 3 lines
IOCTL codes do have a strong ordering as user-space application and driver need to have the same code for the same entity. IOVs are internal numbers for the driver only so there is no issue in renumbering those.
Then you can note dropping " = 1" to avoid confusion for new-code-readers :) For your TODO.
Signature · 1 line
Rafał
PATCH 3/14 staging: brcm80211: remove struct sdioh_info from brcmfmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Use brcmf_sdio_dev as the unified structure to store information of device.
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 35 ++--- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 186 +++++++++------------ drivers/staging/brcm80211/brcmfmac/sdio_host.h | 59 +++----- 3 files changed, 115 insertions(+), 165 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +15 -20
@@ -49,18 +49,18 @@ int brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name, void *params, int plen, void *arg, int len, bool set) { - return brcmf_sdioh_iovar_op(sdiodev->sdioh, name, params, plen, arg, + return brcmf_sdioh_iovar_op(sdiodev, name, params, plen, arg, len, set); }int brcmf_sdcard_intr_reg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_register (sdiodev->sdioh); +return brcmf_sdioh_interrupt_register (); }int brcmf_sdcard_intr_dereg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_deregister (sdiodev->sdioh); +return brcmf_sdioh_interrupt_deregister (); } u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,
@@ -74,7 +74,7 @@ u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,if (retry)/* wait for 1 ms till bus get settled down */ udelay (1000 ); status = -brcmf_sdioh_cfg_read (sdiodev->sdioh, fnc_num, addr, +brcmf_sdioh_cfg_read (sdiodev, fnc_num, addr, (u8 *) &data); }while (status !=0 && (retry++ <SDIOH_API_ACCESS_RETRY_LIMIT ));
@@ -98,7 +98,7 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,if (retry)/* wait for 1 ms till bus get settled down */ udelay (1000 ); status = -brcmf_sdioh_cfg_write (sdiodev->sdioh, fnc_num, addr, +brcmf_sdioh_cfg_write (sdiodev, fnc_num, addr, (u8 *) &data); }while (status !=0 && (retry++ <SDIOH_API_ACCESS_RETRY_LIMIT ));
@@ -119,7 +119,7 @@ int brcmf_sdcard_cis_read(struct brcmf_sdio_dev *sdiodev, uint func, u8 * cis,bool ascii = func & ~0xf ; func &=0x7 ; - status =brcmf_sdioh_cis_read (sdiodev->sdioh, func, cis, length); + status =brcmf_sdioh_cis_read (sdiodev, func, cis, length);if (ascii) {/* Move binary bits to tmp and format them
@@ -181,7 +181,7 @@ u32 brcmf_sdcard_reg_read(struct brcmf_sdio_dev *sdiodev, u32 addr, uint size)if (size ==4 ) addr |=SBSDIO_SB_ACCESS_2_4B_FLAG ; - status =brcmf_sdioh_request_word (sdiodev->sdioh,SDIOH_CMD_TYPE_NORMAL , + status =brcmf_sdioh_request_word (sdiodev,SDIOH_CMD_TYPE_NORMAL ,SDIOH_READ ,SDIO_FUNC_1 , addr, &word, size); sdiodev->regfail = (status !=0 );
@@ -231,7 +231,7 @@ u32 brcmf_sdcard_reg_write(struct brcmf_sdio_dev *sdiodev, u32 addr, uint size,if (size ==4 ) addr |=SBSDIO_SB_ACCESS_2_4B_FLAG ; status = -brcmf_sdioh_request_word (sdiodev->sdioh,SDIOH_CMD_TYPE_NORMAL , +brcmf_sdioh_request_word (sdiodev,SDIOH_CMD_TYPE_NORMAL ,SDIOH_WRITE ,SDIO_FUNC_1 , addr, &data, size); sdiodev->regfail = (status !=0 );
@@ -284,7 +284,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,if (width ==4 ) addr |=SBSDIO_SB_ACCESS_2_4B_FLAG ; - status =brcmf_sdioh_request_buffer (sdiodev->sdioh,SDIOH_DATA_PIO , + status =brcmf_sdioh_request_buffer (sdiodev,SDIOH_DATA_PIO , incr_fix,SDIOH_READ , fn, addr, width, nbytes, buf, pkt);return status;
@@ -324,7 +324,7 @@ brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,if (width ==4 ) addr |=SBSDIO_SB_ACCESS_2_4B_FLAG ; -return brcmf_sdioh_request_buffer (sdiodev->sdioh,SDIOH_DATA_PIO , +return brcmf_sdioh_request_buffer (sdiodev,SDIOH_DATA_PIO , incr_fix,SDIOH_WRITE , fn, addr, width, nbytes, buf, pkt); }
@@ -334,14 +334,14 @@ int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr, addr &=SBSDIO_SB_OFT_ADDR_MASK ; addr |=SBSDIO_SB_ACCESS_2_4B_FLAG ; -return brcmf_sdioh_request_buffer (sdiodev->sdioh,SDIOH_DATA_PIO , +return brcmf_sdioh_request_buffer (sdiodev,SDIOH_DATA_PIO ,SDIOH_DATA_INC , (rw ?SDIOH_WRITE :SDIOH_READ ),SDIO_FUNC_1 , addr,4 , nbytes, buf,NULL ); }int brcmf_sdcard_abort (struct brcmf_sdio_dev *sdiodev,uint fn) { -return brcmf_sdioh_abort (sdiodev->sdioh, fn); +return brcmf_sdioh_abort (sdiodev, fn); }u32 brcmf_sdcard_cur_sbwad (struct brcmf_sdio_dev *sdiodev)
@@ -354,11 +354,9 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)u32 regs =0 ;int ret =0 ; - sdiodev->sdioh =brcmf_sdioh_attach ((void *)0 ); -if (!sdiodev->sdioh) { - ret = -ENODEV ; + ret =brcmf_sdioh_attach (sdiodev); +if (ret) goto out; - } regs =SI_ENUM_BASE ;
@@ -388,10 +386,7 @@ int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev) sdiodev->bus =NULL ; } -if (sdiodev->sdioh) { -brcmf_sdioh_detach (sdiodev->sdioh); - sdiodev->sdioh =NULL ; - } +brcmf_sdioh_detach (sdiodev); sdiodev->sbwad =0 ;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +80 -106
428 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sdio_host.h +20 -39
107 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 4/14 staging: brcm80211: remove global var gInstance from brcmfmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Use sdio function pointer stored in struct brcmf_sdio_dev instead of those in gInstance.
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 5 +- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 198 +++++++++------------ drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 7 +- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 18 +-- 4 files changed, 99 insertions(+), 129 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +3 -2
@@ -21,6 +21,7 @@#include <linux/pci_ids.h> #include <linux/sched.h> #include <linux/completion.h> +#include <linux/mmc/card.h> #include <defs.h> #include <brcm_hw_ids.h>
@@ -55,12 +56,12 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name,int brcmf_sdcard_intr_reg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_register (); +return brcmf_sdioh_interrupt_register (sdiodev); }int brcmf_sdcard_intr_dereg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_deregister (); +return brcmf_sdioh_interrupt_deregister (sdiodev); } u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +88 -110
446 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +4 -3
@@ -24,6 +24,7 @@#include <linux/sched.h> #include <linux/mmc/sdio.h> #include <linux/mmc/sdio_func.h> +#include <linux/mmc/card.h> #include <linux/semaphore.h> #include <linux/firmware.h> #include <asm/unaligned.h>
@@ -5685,7 +5686,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus) bus->idleclock =BRCMF_IDLE_ACTIVE ;/* Query the F2 block size, set roundup accordingly */ - bus->blocksize = bus->sdiodev->func2->cur_blksize; + bus->blocksize = bus->sdiodev->func[2 ]->cur_blksize; bus->roundup =min (max_roundup, bus->blocksize);/* Query if bus module supports packet chaining,
@@ -5828,7 +5829,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus) bus->fw_name =BCM4329_FW_NAME ; ret =request_firmware (&bus->firmware, bus->fw_name, - &gInstance->func[2 ]->dev); + &bus->sdiodev->func[2 ]->dev);if (ret) {BRCMF_ERROR (("%s: Fail to request firmware %d\n" , __func__, ret));
@@ -5930,7 +5931,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus) bus->nv_name =BCM4329_NV_NAME ; ret =request_firmware (&bus->firmware, bus->nv_name, - &gInstance->func[2 ]->dev); + &bus->sdiodev->func[2 ]->dev);if (ret) {BRCMF_ERROR (("%s: Fail to request nvram %d\n" , __func__, ret));return ret;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +4 -14
@@ -122,20 +122,14 @@ struct brcmf_sdreg {int value; }; -struct brcmf_sdmmc_instance { -struct sdio_func *func[SDIOD_MAX_IOFUNCS ]; -u32 host_claimed; -atomic_t suspend;/* suspend flag */ -}; -struct brcmf_sdio_dev { -struct sdio_func *func1; -struct sdio_func *func2; +struct sdio_func *func[SDIO_MAX_FUNCS ];u8 num_funcs;/* Supported funcs on client */ u32 func_cis_ptr[SDIOD_MAX_IOFUNCS ];u32 sbwad;/* Save backplane window address */ bool regfail;/* status of last reg_r/w call */ void *bus; +atomic_t suspend;/* suspend flag */ };/* Register/deregister device interrupt handler. */
@@ -253,10 +247,8 @@ extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev);extern int brcmf_sdioh_attach (struct brcmf_sdio_dev *sdiodev);extern void brcmf_sdioh_detach (struct brcmf_sdio_dev *sdiodev); -extern int -brcmf_sdioh_interrupt_register (void ); - -extern int brcmf_sdioh_interrupt_deregister (void ); +extern int brcmf_sdioh_interrupt_register (struct brcmf_sdio_dev *sdiodev); +extern int brcmf_sdioh_interrupt_deregister (struct brcmf_sdio_dev *sdiodev);/* read or write one byte using cmd52 */ extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw,
@@ -298,8 +290,6 @@ extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,extern uint sd_f2_blocksize; -extern struct brcmf_sdmmc_instance *gInstance; -extern void *brcmf_sdbrcm_probe (u16 bus_no,u16 slot,u16 func,uint bustype,u32 regsva,struct brcmf_sdio_dev *sdiodev);extern void brcmf_sdbrcm_disconnect (void *ptr);
Signature · 1 line
1.7.4.1
PATCH 5/14 staging: brcm80211: remove wext traces in fullmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
wext support code have been removed a while ago. This patch removes the traces left behind.
--- drivers/staging/brcm80211/Kconfig | 2 -- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 1 - 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/Kconfig +0 -2
@@ -22,8 +22,6 @@ config BRCMFMAC depends on WLAN && CFG80211 select BRCMUTIL select FW_LOADER - select WIRELESS_EXT - select WEXT_PRIV ---help--- This module adds support for embedded wireless adapters based on Broadcom IEEE802.11n FullMAC chipsets. This driver uses the kernel's
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -1
@@ -21,7 +21,6 @@#include <linux/netdevice.h> #include <linux/sched.h> #include <linux/etherdevice.h> -#include <linux/wireless.h> #include <linux/ieee80211.h> #include <linux/mmc/sdio_func.h> #include <linux/uaccess.h>
Signature · 1 line
1.7.4.1
PATCH 6/14 staging: brcm80211: absorb brcmf_sdioh_iovar_op into brcmf_sdcard_iovar_op
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
fullmac wrapper function cleanup.
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 112 +++++++++++++++++++- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 116 --------------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 5 - 3 files changed, 110 insertions(+), 123 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +110 -2
@@ -46,12 +46,120 @@module_param (sd_f2_blocksize, int,0 ); +/* IOVar table */ +enum { +IOV_MSGLEVEL =1 , +IOV_DEVREG , +IOV_HCIREGS , +IOV_RXCHAIN +}; + +const struct brcmu_iovar sdioh_iovars[] = { + {"sd_devreg" ,IOV_DEVREG ,0 ,IOVT_BUFFER ,sizeof (struct brcmf_sdreg )} + , + {"sd_rxchain" ,IOV_RXCHAIN ,0 ,IOVT_BOOL ,0 } + , + {NULL ,0 ,0 ,0 ,0 } +}; +int brcmf_sdcard_iovar_op (struct brcmf_sdio_dev *sdiodev,const char *name,void *params,int plen,void *arg,int len,bool set) { -return brcmf_sdioh_iovar_op (sdiodev, name, params, plen, arg, - len, set); +const struct brcmu_iovar *vi =NULL ; +int bcmerror =0 ; +int val_size; +s32 int_val =0 ; +bool bool_val; +u32 actionid; + +if (name ==NULL || len <0 ) +return -EINVAL ; + +/* Set does not take qualifiers */ +if (set && (params || plen)) +return -EINVAL ; + +/* Get must have return space;*/ +if (!set && !(arg && len)) +return -EINVAL ; + +BRCMF_TRACE (("%s: Enter (%s %s)\n" , __func__, (set ?"set" :"get" ), + name)); + + vi =brcmu_iovar_lookup (sdioh_iovars, name); +if (vi ==NULL ) { + bcmerror = -ENOTSUPP ; + goto exit; + } + + bcmerror =brcmu_iovar_lencheck (vi, arg, len, set); +if (bcmerror !=0 ) + goto exit; + +/* Set up params so get and set can share the convenience variables */ +if (params ==NULL ) { + params = arg; + plen = len; + } + +if (vi->type ==IOVT_VOID ) + val_size =0 ; +else if (vi->type ==IOVT_BUFFER ) + val_size = len; +else + val_size =sizeof (int ); + +if (plen >= (int )sizeof (int_val)) +memcpy (&int_val, params,sizeof (int_val)); + + bool_val = (int_val !=0 ) ? true : false; + + actionid = set ?IOV_SVAL (vi->varid) :IOV_GVAL (vi->varid); +switch (actionid) { +case IOV_GVAL (IOV_RXCHAIN ): + int_val = false; +memcpy (arg, &int_val, val_size); +break ; + +case IOV_GVAL (IOV_DEVREG ): + { +struct brcmf_sdreg *sd_ptr = + (struct brcmf_sdreg *) params; +u8 data =0 ; + +if (brcmf_sdioh_cfg_read + (sdiodev, sd_ptr->func, sd_ptr->offset, &data)) { + bcmerror = -EIO ; +break ; + } + + int_val = (int )data; +memcpy (arg, &int_val,sizeof (int_val)); +break ; + } + +case IOV_SVAL (IOV_DEVREG ): + { +struct brcmf_sdreg *sd_ptr = + (struct brcmf_sdreg *) params; +u8 data = (u8 ) sd_ptr->value; + +if (brcmf_sdioh_cfg_write + (sdiodev, sd_ptr->func, sd_ptr->offset, &data)) { + bcmerror = -EIO ; +break ; + } +break ; + } + +default : + bcmerror = -ENOTSUPP ; +break ; + } +exit: + +return bcmerror; }int brcmf_sdcard_intr_reg (struct brcmf_sdio_dev *sdiodev)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -116
122 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -5
@@ -276,11 +276,6 @@ extern int brcmf_sdioh_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fuc,extern int brcmf_sdioh_cfg_write (struct brcmf_sdio_dev *sdiodev,uint fuc,u32 addr,u8 *data); -/* handle iovars */ -extern int brcmf_sdioh_iovar_op (struct brcmf_sdio_dev *sdiodev, -const char *name,void *params,int plen, -void *arg,int len,bool set); -/* Issue abort to the specified function and clear controller as needed */ extern int brcmf_sdioh_abort (struct brcmf_sdio_dev *sdiodev,uint fnc);
Signature · 1 line
1.7.4.1
PATCH 7/14 staging: brcm80211: absorb brcmf_sdioh_interrupt_register into brcmf_sdcard_intr_reg
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
brcmfmac wrapper function cleanup
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 22 ++++++++++- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 43 --------------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 1 - 3 files changed, 21 insertions(+), 45 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +21 -1
@@ -21,6 +21,7 @@#include <linux/pci_ids.h> #include <linux/sched.h> #include <linux/completion.h> +#include <linux/mmc/sdio_func.h> #include <linux/mmc/card.h> #include <defs.h>
@@ -162,9 +163,28 @@ exit:return bcmerror; } +static void brcmf_sdioh_irqhandler (struct sdio_func *func) +{ +struct brcmf_sdio_dev *sdiodev =dev_get_drvdata (&func->card->dev); + +BRCMF_TRACE (("brcmf: ***IRQHandler\n" )); + +sdio_release_host (func); + +brcmf_sdbrcm_isr (sdiodev->bus); + +sdio_claim_host (func); +} +int brcmf_sdcard_intr_reg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_register (sdiodev); +BRCMF_TRACE (("%s: Entering\n" , __func__)); + +sdio_claim_host (sdiodev->func[1 ]); +sdio_claim_irq (sdiodev->func[1 ], brcmf_sdioh_irqhandler); +sdio_release_host (sdiodev->func[1 ]); + +return 0 ; }int brcmf_sdcard_intr_dereg (struct brcmf_sdio_dev *sdiodev)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -43
61 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -1
@@ -247,7 +247,6 @@ extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev);extern int brcmf_sdioh_attach (struct brcmf_sdio_dev *sdiodev);extern void brcmf_sdioh_detach (struct brcmf_sdio_dev *sdiodev); -extern int brcmf_sdioh_interrupt_register (struct brcmf_sdio_dev *sdiodev);extern int brcmf_sdioh_interrupt_deregister (struct brcmf_sdio_dev *sdiodev);/* read or write one byte using cmd52 */
Signature · 1 line
1.7.4.1
Re: [PATCH 07/14] staging: brcm80211: absorb brcmf_sdioh_interrupt_register into brcmf_sdcard_intr_reg
2011/8/12 Arend van Spriel <[email protected]>:
Quoted 3 lines
+
BRCMF_TRACE(("brcmf: ***IRQHandler\n"));+
BRCMF_TRACE(("%s: Entering\n", __func__));
I guess I'd be way easier to modify your macro instead of having to remember about double braces every time (assuming there are needed at all).
Signature · 1 line
Rafał
PATCH 8/14 staging: brcm80211: absorb brcmf_sdioh_interrupt_deregister into brcmf_sdcard_intr_dereg
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
brcmfmac wrapper function cleanup
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 8 ++++++- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 22 --------------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 2 - 3 files changed, 7 insertions(+), 25 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +7 -1
@@ -189,7 +189,13 @@ int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)int brcmf_sdcard_intr_dereg (struct brcmf_sdio_dev *sdiodev) { -return brcmf_sdioh_interrupt_deregister (sdiodev); +BRCMF_TRACE (("%s: Entering\n" , __func__)); + +sdio_claim_host (sdiodev->func[1 ]); +sdio_release_irq (sdiodev->func[1 ]); +sdio_release_host (sdiodev->func[1 ]); + +return 0 ; } u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -22
@@ -190,28 +190,6 @@ void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev) } -int brcmf_sdioh_interrupt_deregister (struct brcmf_sdio_dev *sdiodev) -{ -BRCMF_TRACE (("%s: Entering\n" , __func__)); - -if (sdiodev->func[1 ]) { -/* register and unmask irq */ -sdio_claim_host (sdiodev->func[1 ]); -sdio_release_irq (sdiodev->func[1 ]); -sdio_release_host (sdiodev->func[1 ]); - } - -if (sdiodev->func[2 ]) { -/* Claim host controller F2 */ -sdio_claim_host (sdiodev->func[2 ]); -sdio_release_irq (sdiodev->func[2 ]); -/* Release host controller F2 */ -sdio_release_host (sdiodev->func[2 ]); - } - -return 0 ; -} -extern int brcmf_sdioh_cfg_read (struct brcmf_sdio_dev *sdiodev,uint fnc_num,u32 addr,u8 *data)
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -2
@@ -247,8 +247,6 @@ extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev);extern int brcmf_sdioh_attach (struct brcmf_sdio_dev *sdiodev);extern void brcmf_sdioh_detach (struct brcmf_sdio_dev *sdiodev); -extern int brcmf_sdioh_interrupt_deregister (struct brcmf_sdio_dev *sdiodev); -/* read or write one byte using cmd52 */ extern int brcmf_sdioh_request_byte (struct brcmf_sdio_dev *sdiodev,uint rw,uint fnc,uint addr,u8 *byte);
Signature · 1 line
1.7.4.1
PATCH 9/14 staging: brcm80211: absorb brcmf_sdioh_abort into brcmf_sdcard_abort
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
brcmfmac wrapper function cleanup
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 11 ++++++++++- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 14 -------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 3 --- 3 files changed, 10 insertions(+), 18 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +10 -1
@@ -21,6 +21,7 @@#include <linux/pci_ids.h> #include <linux/sched.h> #include <linux/completion.h> +#include <linux/mmc/sdio.h> #include <linux/mmc/sdio_func.h> #include <linux/mmc/card.h>
@@ -476,7 +477,15 @@ int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,int brcmf_sdcard_abort (struct brcmf_sdio_dev *sdiodev,uint fn) { -return brcmf_sdioh_abort (sdiodev, fn); +char t_func = (char )fn; +BRCMF_TRACE (("%s: Enter\n" , __func__)); + +/* issue abort cmd52 command through F0 */ +brcmf_sdioh_request_byte (sdiodev,SDIOH_WRITE ,SDIO_FUNC_0 , +SDIO_CCCR_ABORT , &t_func); + +BRCMF_TRACE (("%s: Exit\n" , __func__)); +return 0 ; }u32 brcmf_sdcard_cur_sbwad (struct brcmf_sdio_dev *sdiodev)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -14
@@ -576,20 +576,6 @@ brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev, uint pio_dma,return Status; } -/* this function performs "abort" for both of host & device */ -extern int brcmf_sdioh_abort (struct brcmf_sdio_dev *sdiodev,uint func) -{ -char t_func = (char )func; -BRCMF_TRACE (("%s: Enter\n" , __func__)); - -/* issue abort cmd52 command through F0 */ -brcmf_sdioh_request_byte (sdiodev,SDIOH_WRITE ,SDIO_FUNC_0 , -SDIO_CCCR_ABORT , &t_func); - -BRCMF_TRACE (("%s: Exit\n" , __func__)); -return 0 ; -} -/* Read client card reg */ int brcmf_sdioh_card_regread(struct brcmf_sdio_dev *sdiodev, int func, u32 regaddr,
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -3
@@ -273,9 +273,6 @@ extern int brcmf_sdioh_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fuc,extern int brcmf_sdioh_cfg_write (struct brcmf_sdio_dev *sdiodev,uint fuc,u32 addr,u8 *data); -/* Issue abort to the specified function and clear controller as needed */ -extern int brcmf_sdioh_abort (struct brcmf_sdio_dev *sdiodev,uint fnc); -/* Watchdog timer interface for pm ops */ extern void brcmf_sdio_wdtmr_enable (struct brcmf_sdio_dev *sdiodev,bool enable);
Signature · 1 line
1.7.4.1
PATCH 10/14 staging: brcm80211: remove dead code from dhd_sdio.c
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Code cleanup for brcmfmac
--- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 222 +++++------------------- 1 files changed, 47 insertions(+), 175 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +47 -175
@@ -38,28 +38,6 @@ #ifdef BCMDBG /* ARM trap handling */ - -/* Trap types defined by ARM (see arminc.h) */ - -#if defined(__ARM_ARCH_4T__) -#define MAX_TRAP_TYPE (TR_FIQ + 1) -#elif defined(__ARM_ARCH_7M__) -#define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS) -#endif /* __ARM_ARCH_7M__ */ - -/* The trap structure is defined here as offsets for assembly */ -#define TR_TYPE 0x00 -#define TR_EPC 0x04 -#define TR_CPSR 0x08 -#define TR_SPSR 0x0c -#define TR_REGS 0x10 -#define TR_REG(n) (TR_REGS + (n) * 4) -#define TR_SP TR_REG(13) -#define TR_LR TR_REG(14) -#define TR_PC TR_REG(15) - -#define TRAP_T_SIZE 80 - struct brcmf_trap { u32 type; u32 epc;
@@ -620,7 +598,6 @@ struct brcmf_bus {u32 ramsize;/* Size of RAM in SOCRAM (bytes) */ u32 orig_ramsize;/* Size of RAM in SOCRAM (bytes) */ -u32 bus;/* gSPI or SDIO bus */ u32 hostintmask;/* Copy of Host Interrupt Mask */ u32 intstatus;/* Intstatus bits (events) pending */ bool dpc_sched;/* Indicates DPC schedule (intrpt rcvd) */
@@ -801,8 +778,6 @@ struct sbconfig {#define CLK_PENDING 2/* Not used yet */ #define CLK_AVAIL 3 -#define BRCMF_NOPMU (brcmf) (false) -#ifdef BCMDBG static int qcount[NUMPRIO ];static int tx_packets[NUMPRIO ];
@@ -862,12 +837,9 @@ module_param(brcmf_dongle_memsize, int, 0);static bool brcmf_alignctl; -static bool sd1idle; -static bool retrydata;#define RETRYCHAN (chan) (((chan) == SDPCM_EVENT_CHANNEL) || retrydata) -static const uint watermark =8 ;static const uint firstread =BRCMF_FIRSTREAD ;/* Retry count for register access failures */
@@ -939,8 +911,6 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar) } } -#define BRCMF_BUS SDIO_BUS -#define PKT_AVAILABLE () (intstatus & I_HMB_FRAME_IND)#define HOSTINTMASK (I_HMB_SW_MASK | I_CHIPACTIVE)
@@ -1012,7 +982,7 @@ static int brcmf_sdbrcm_ioctl_resp_wake(struct brcmf_bus *bus);*/ static void brcmf_sdbrcm_pktfree2 (struct brcmf_bus *bus,struct sk_buff *pkt) { -if ((bus->bus !=SPI_BUS ) || bus->usebufpool) +if (bus->usebufpool)brcmu_pkt_buf_free_skb (pkt); }
@@ -1890,18 +1860,15 @@ enum {IOV_ALIGNCTL ,IOV_SDALIGN ,IOV_DEVRESET , -IOV_CPU , #ifdef SDTESTIOV_PKTGEN ,IOV_EXTLOOP , #endif /* SDTEST */ -IOV_SPROM ,IOV_TXBOUND ,IOV_RXBOUND ,IOV_TXMINMAX ,IOV_IDLETIME ,IOV_IDLECLOCK , -IOV_SD1IDLE ,IOV_SLEEP ,IOV_WDTICK , IOV_IOCTLTIMEOUT,
@@ -1914,7 +1881,6 @@ const struct brcmu_iovar brcmf_sdio_iovars[] = { {"pollrate", IOV_POLLRATE, 0, IOVT_UINT32, 0}, {"idletime", IOV_IDLETIME, 0, IOVT_INT32, 0}, {"idleclock", IOV_IDLECLOCK, 0, IOVT_INT32, 0}, - {"sd1idle", IOV_SD1IDLE, 0, IOVT_BOOL, 0}, {"membytes", IOV_MEMBYTES, 0, IOVT_BUFFER, 2 * sizeof(int)}, {"memsize", IOV_MEMSIZE, 0, IOVT_UINT32, 0}, {"download", IOV_DOWNLOAD, 0, IOVT_BOOL, 0},
@@ -1946,8 +1912,6 @@ const struct brcmu_iovar brcmf_sdio_iovars[] = { , {"txminmax", IOV_TXMINMAX, 0, IOVT_UINT32, 0} , - {"cpu", IOV_CPU, 0, IOVT_BOOL, 0} - , {"checkdied", IOV_CHECKDIED, 0, IOVT_BUFFER, 0} , #endif /* BCMDBG */
@@ -2636,15 +2600,6 @@ static int brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, bus->idleclock = int_val;break ; -case IOV_GVAL (IOV_SD1IDLE ): - int_val = (s32 ) sd1idle; -memcpy (arg, &int_val, val_size); -break ; - -case IOV_SVAL (IOV_SD1IDLE ): - sd1idle = bool_val; -break ; -case IOV_SVAL (IOV_MEMBYTES ):case IOV_GVAL (IOV_MEMBYTES ): {
@@ -3370,7 +3325,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex) offsetof(struct sdpcmd_regs, hostintmask), &retries);brcmf_sdcard_cfg_write (bus->sdiodev,SDIO_FUNC_1 , -SBSDIO_WATERMARK , (u8 ) watermark, &err); +SBSDIO_WATERMARK ,8 , &err);/* Set bus state according to enable result */ drvr->busstate =BRCMF_BUS_DATA ;
@@ -3484,10 +3439,6 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)BRCMF_TRACE (("%s: Enter\n" , __func__)); -/* Control data already received in aligned rxctl */ -if ((bus->bus ==SPI_BUS ) && (!bus->usebufpool)) - goto gotpkt; -/* Set rxctl for frame (w/optional alignment) */ bus->rxctl = bus->rxbuf;if (brcmf_alignctl) {
@@ -3503,12 +3454,6 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)if (len <= firstread) goto gotpkt; -/* Copy the full data pkt in gSPI case and process ioctl. */ -if (bus->bus ==SPI_BUS ) { -memcpy (bus->rxctl, hdr, len); - goto gotpkt; - } -/* Raise rdlen to next SDIO block to avoid tail command */ rdlen = len - firstread;if (bus->roundup && bus->blocksize && (rdlen > bus->blocksize)) {
@@ -4039,26 +3984,22 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)u16 nextlen = bus->nextlen; bus->nextlen =0 ; -if (bus->bus ==SPI_BUS ) { - rdlen = len = nextlen; - }else { - rdlen = len = nextlen <<4 ; - -/* Pad read to blocksize for efficiency */ -if (bus->roundup && bus->blocksize - && (rdlen > bus->blocksize)) { - pad = - bus->blocksize - - (rdlen % bus->blocksize); -if ((pad <= bus->roundup) - && (pad < bus->blocksize) - && ((rdlen + pad + firstread) < -MAX_RX_DATASZ )) - rdlen += pad; - }else if (rdlen %BRCMF_SDALIGN ) { - rdlen +=BRCMF_SDALIGN - - (rdlen %BRCMF_SDALIGN ); - } + rdlen = len = nextlen <<4 ; + +/* Pad read to blocksize for efficiency */ +if (bus->roundup && bus->blocksize + && (rdlen > bus->blocksize)) { + pad = + bus->blocksize - + (rdlen % bus->blocksize); +if ((pad <= bus->roundup) + && (pad < bus->blocksize) + && ((rdlen + pad + firstread) < +MAX_RX_DATASZ )) + rdlen += pad; + }else if (rdlen %BRCMF_SDALIGN ) { + rdlen +=BRCMF_SDALIGN - + (rdlen %BRCMF_SDALIGN ); }/* We use bus->rxctl buffer in WinXP for initial
@@ -4074,60 +4015,15 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)/* Allocate a packet buffer */ pkt =brcmu_pkt_buf_get_skb (rdlen +BRCMF_SDALIGN );if (!pkt) { -if (bus->bus ==SPI_BUS ) { - bus->usebufpool = false; - bus->rxctl = bus->rxbuf; -if (brcmf_alignctl) { - bus->rxctl += firstread; - pad = ((unsigned long )bus->rxctl - %BRCMF_SDALIGN ); -if (pad) - bus->rxctl += - (BRCMF_SDALIGN - pad); - bus->rxctl -= firstread; - } - rxbuf = bus->rxctl; -/* Read the entire frame */ - sdret =brcmf_sdcard_recv_buf ( - bus->sdiodev, -brcmf_sdcard_cur_sbwad ( - bus->sdiodev), -SDIO_FUNC_2 ,F2SYNC , - rxbuf, rdlen, -NULL ,NULL ,NULL ); - bus->f2rxdata++; - -/* Control frame failures need -retransmission */ -if (sdret <0 ) { -BRCMF_ERROR (("%s: read %d " -"control bytes " -"failed: %d\n" , - __func__, - rdlen, sdret)); -/* dhd.rx_ctlerrs is higher */ - bus->rxc_errors++; -brcmf_sdbrcm_rxfail (bus, true, - (bus->bus == -SPI_BUS ) ? false - : true); -continue ; - } - }else { -/* Give up on data, -request rtx of events */ -BRCMF_ERROR (("%s (nextlen): " -"brcmu_pkt_buf_get_skb " -"failed:" -" len %d rdlen %d expected" -" rxseq %d\n" , __func__, - len, rdlen, rxseq)); -continue ; - } +/* Give up on data, request rtx of events */ +BRCMF_ERROR (("%s (nextlen): " +"brcmu_pkt_buf_get_skb " +"failed:" +" len %d rdlen %d expected" +" rxseq %d\n" , __func__, + len, rdlen, rxseq)); +continue ; }else { -if (bus->bus ==SPI_BUS ) - bus->usebufpool = true; -PKTALIGN (pkt, rdlen,BRCMF_SDALIGN ); rxbuf = (u8 *) (pkt->data);/* Read the entire frame */
@@ -4149,10 +4045,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)* Don't attempt NAK for * gSPI */ -brcmf_sdbrcm_rxfail (bus, true, - (bus->bus == -SPI_BUS ) ? false : - true); +brcmf_sdbrcm_rxfail (bus, true, true);continue ; } }
@@ -4202,8 +4095,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)"expected rxseq %d\n" , __func__, nextlen, len, roundup(len, 16), rxseq)); -brcmf_sdbrcm_rxfail (bus, true, - bus->bus !=SPI_BUS ); +brcmf_sdbrcm_rxfail (bus, true, true);brcmf_sdbrcm_pktfree2 (bus, pkt);continue ; }
@@ -4275,29 +4167,16 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)#endif if (chan ==SDPCM_CONTROL_CHANNEL ) { -if (bus->bus ==SPI_BUS ) { -brcmf_sdbrcm_read_control (bus, rxbuf, - len, doff); - }else { -BRCMF_ERROR (("%s (nextlen): readahead" -" on control packet %d?\n" , - __func__, seq)); -/* Force retry w/normal header read */ - bus->nextlen =0 ; -brcmf_sdbrcm_rxfail (bus, false, true); - } +BRCMF_ERROR (("%s (nextlen): readahead" +" on control packet %d?\n" , + __func__, seq)); +/* Force retry w/normal header read */ + bus->nextlen =0 ; +brcmf_sdbrcm_rxfail (bus, false, true);brcmf_sdbrcm_pktfree2 (bus, pkt);continue ; } -if ((bus->bus ==SPI_BUS ) && !bus->usebufpool) { -BRCMF_ERROR (("Received %d bytes on %d channel." -" Running out of " "rx pktbuf's or" -" not yet malloced.\n" , - len, chan)); -continue ; - } -/* Validate data offset */ if ((doff <SDPCM_HDRLEN ) || (doff > len)) { BRCMF_ERROR(("%s (nextlen): bad data offset %d:"
@@ -4311,9 +4190,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)/* All done with this one -- now deliver the packet */ goto deliver; } -/* gSPI frames should not be handled in fractions */ -if (bus->bus ==SPI_BUS ) -break ;/* Read frame header (hardware and software) */ sdret = brcmf_sdcard_recv_buf(bus->sdiodev,
@@ -5384,7 +5260,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype, brcmf_txbound =BRCMF_TXBOUND ; brcmf_rxbound =BRCMF_RXBOUND ; brcmf_alignctl = true; - sd1idle = true; brcmf_readahead = true; retrydata = false; brcmf_dongle_memsize =0 ;
@@ -5408,7 +5283,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype, } bus->sdiodev = sdiodev; sdiodev->bus = bus; - bus->bus =BRCMF_BUS ; bus->tx_seq =SDPCM_SEQUENCE_WRAP -1 ; bus->usebufpool = false;/* Use bufpool if allocated, else use locally malloced rxbuf */
@@ -5578,22 +5452,20 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)brcmf_sdbrcm_sdiod_drive_strength_init (bus, brcmf_sdiod_drive_strength);/* Get info on the ARM and SOCRAM cores... */ -if (!BRCMF_NOPMU (bus)) { -brcmf_sdcard_reg_read (bus->sdiodev, -CORE_SB (bus->ci->armcorebase, sbidhigh),4 ); - bus->orig_ramsize = bus->ci->ramsize; -if (!(bus->orig_ramsize)) { -BRCMF_ERROR (("%s: failed to find SOCRAM memory!\n" , - __func__)); - goto fail; - } - bus->ramsize = bus->orig_ramsize; -if (brcmf_dongle_memsize) -brcmf_sdbrcm_setmemsize (bus, brcmf_dongle_memsize); - -BRCMF_ERROR (("DHD: dongle ram size is set to %d(orig %d)\n" , - bus->ramsize, bus->orig_ramsize)); +brcmf_sdcard_reg_read (bus->sdiodev, +CORE_SB (bus->ci->armcorebase, sbidhigh),4 ); + bus->orig_ramsize = bus->ci->ramsize; +if (!(bus->orig_ramsize)) { +BRCMF_ERROR (("%s: failed to find SOCRAM memory!\n" , + __func__)); + goto fail; } + bus->ramsize = bus->orig_ramsize; +if (brcmf_dongle_memsize) +brcmf_sdbrcm_setmemsize (bus, brcmf_dongle_memsize); + +BRCMF_ERROR (("DHD: dongle ram size is set to %d(orig %d)\n" , + bus->ramsize, bus->orig_ramsize));/* Set core control so an SDIO reset does a backplane reset */ reg_addr = bus->ci->buscorebase +
Signature · 1 line
1.7.4.1
PATCH 11/14 staging: brcm80211: remove wrapper functions in bcmsdh_sdmmc.c
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Use brcmf_sdioh_request_byte directly instead of calling brcmf_sdioh_cfg_read and brcmf_sdioh_cfg_write in brcmfmac
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 18 +++++++--------- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 22 --------------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 5 ---- 3 files changed, 8 insertions(+), 37 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +8 -10
@@ -130,8 +130,8 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name, (struct brcmf_sdreg *) params;u8 data =0 ; -if (brcmf_sdioh_cfg_read - (sdiodev, sd_ptr->func, sd_ptr->offset, &data)) { +if (brcmf_sdioh_request_byte (sdiodev,SDIOH_READ , + sd_ptr->func, sd_ptr->offset, &data)) { bcmerror = -EIO ;break ; }
@@ -147,8 +147,8 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name, (struct brcmf_sdreg *) params;u8 data = (u8 ) sd_ptr->value; -if (brcmf_sdioh_cfg_write - (sdiodev, sd_ptr->func, sd_ptr->offset, &data)) { +if (brcmf_sdioh_request_byte (sdiodev,SDIOH_WRITE , + sd_ptr->func, sd_ptr->offset, &data)) { bcmerror = -EIO ;break ; }
@@ -209,9 +209,8 @@ u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,do {if (retry)/* wait for 1 ms till bus get settled down */ udelay (1000 ); - status = -brcmf_sdioh_cfg_read (sdiodev, fnc_num, addr, - (u8 *) &data); + status =brcmf_sdioh_request_byte (sdiodev,SDIOH_READ , fnc_num, + addr, (u8 *) &data); }while (status !=0 && (retry++ <SDIOH_API_ACCESS_RETRY_LIMIT ));if (err)
@@ -233,9 +232,8 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,do {if (retry)/* wait for 1 ms till bus get settled down */ udelay (1000 ); - status = -brcmf_sdioh_cfg_write (sdiodev, fnc_num, addr, - (u8 *) &data); + status =brcmf_sdioh_request_byte (sdiodev,SDIOH_WRITE , fnc_num, + addr, (u8 *) &data); }while (status !=0 && (retry++ <SDIOH_API_ACCESS_RETRY_LIMIT ));if (err)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -22
@@ -190,28 +190,6 @@ void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev) } -extern int -brcmf_sdioh_cfg_read (struct brcmf_sdio_dev *sdiodev,uint fnc_num,u32 addr, -u8 *data) -{ -int status; -/* No lock needed since brcmf_sdioh_request_byte does locking */ - status =brcmf_sdioh_request_byte (sdiodev,SDIOH_READ , fnc_num, - addr, data); -return status; -} - -extern int -brcmf_sdioh_cfg_write (struct brcmf_sdio_dev *sdiodev,uint fnc_num,u32 addr, -u8 *data) -{ -/* No lock needed since brcmf_sdioh_request_byte does locking */ -int status; - status =brcmf_sdioh_request_byte (sdiodev,SDIOH_WRITE , fnc_num, - addr, data); -return status; -} -static int brcmf_sdioh_get_cisaddr (struct brcmf_sdio_dev *sdiodev,u32 regaddr) {/* read 24 bits and return valid 17 bit addr */
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -5
@@ -268,11 +268,6 @@ brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev, uint pio_dma,extern int brcmf_sdioh_cis_read (struct brcmf_sdio_dev *sdiodev,uint fuc,u8 *cis,u32 length); -extern int brcmf_sdioh_cfg_read (struct brcmf_sdio_dev *sdiodev,uint fuc, -u32 addr,u8 *data); -extern int brcmf_sdioh_cfg_write (struct brcmf_sdio_dev *sdiodev,uint fuc, -u32 addr,u8 *data); -/* Watchdog timer interface for pm ops */ extern void brcmf_sdio_wdtmr_enable (struct brcmf_sdio_dev *sdiodev,bool enable);
Signature · 1 line
1.7.4.1
PATCH 12/14 staging: brcm80211: remove unused parameter from data interface in fullmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Remove redundant complete function pointer in send/recv buffer interface.
--- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 10 +------ drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 31 +++++++++-------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 10 +------ 3 files changed, 16 insertions(+), 35 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +2 -8
@@ -385,10 +385,7 @@ bool brcmf_sdcard_regfail(struct brcmf_sdio_dev *sdiodev)int brcmf_sdcard_recv_buf (struct brcmf_sdio_dev *sdiodev,u32 addr,uint fn,uint flags, -u8 *buf,uint nbytes,struct sk_buff *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle) +u8 *buf,uint nbytes,struct sk_buff *pkt) {int status;uint incr_fix;
@@ -426,10 +423,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,int brcmf_sdcard_send_buf (struct brcmf_sdio_dev *sdiodev,u32 addr,uint fn, -uint flags,u8 *buf,uint nbytes,void *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle) +uint flags,u8 *buf,uint nbytes,struct sk_buff *pkt) {uint incr_fix;uint width;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +12 -19
@@ -941,10 +941,7 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len);static void brcmf_sdbrcm_setmemsize (struct brcmf_bus *bus,int mem_size);static int brcmf_sdbrcm_send_buf (struct brcmf_bus *bus,u32 addr,uint fn,uint flags,u8 *buf,uint nbytes, -struct sk_buff *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle); +struct sk_buff *pkt);static bool brcmf_sdbrcm_download_firmware (struct brcmf_bus *bus,void *card);static int _brcmf_sdbrcm_download_firmware (struct brcmf_bus *bus);
@@ -1413,7 +1410,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, do { ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(bus->sdiodev), - SDIO_FUNC_2, F2SYNC, frame, len, pkt, NULL, NULL); + SDIO_FUNC_2, F2SYNC, frame, len, pkt); bus->f2txdata++; if (ret < 0) {
@@ -1731,7 +1728,7 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen) ret =brcmf_sdbrcm_send_buf (bus,brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 , -F2SYNC , frame, len,NULL ,NULL ,NULL ); +F2SYNC , frame, len,NULL );if (ret <0 ) {/* On failure, abort the command and
@@ -3493,7 +3490,7 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , (bus->rxctl + firstread), rdlen, - NULL, NULL, NULL); + NULL); bus->f2rxdata++;/* Control frame failures need retransmission */
@@ -3657,13 +3654,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , (u8 *) pfirst->data, dlen, - pfirst, NULL, NULL); + pfirst); }else if (bus->dataptr) { errcode =brcmf_sdcard_recv_buf (bus->sdiodev,brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , bus->dataptr, dlen, -NULL ,NULL ,NULL ); +NULL ); sublen = (u16 )brcmu_pktfrombuf (pfirst,0 , dlen, bus->dataptr);if (sublen != dlen) {
@@ -4032,7 +4029,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished) bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , rxbuf, rdlen, - pkt, NULL, NULL); + pkt); bus->f2rxdata++;if (sdret <0 ) {
@@ -4195,7 +4192,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished) sdret =brcmf_sdcard_recv_buf (bus->sdiodev,brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , bus->rxhdr, firstread, -NULL ,NULL ,NULL ); +NULL ); bus->f2rxhdrs++;if (sdret <0 ) {
@@ -4352,7 +4349,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished) sdret =brcmf_sdcard_recv_buf (bus->sdiodev,brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , ((u8 *) (pkt->data)), - rdlen, pkt,NULL ,NULL ); + rdlen, pkt); bus->f2rxdata++;if (sdret <0 ) {
@@ -4689,7 +4686,7 @@ clkwait: ret =brcmf_sdbrcm_send_buf (bus,brcmf_sdcard_cur_sbwad (bus->sdiodev),SDIO_FUNC_2 ,F2SYNC , (u8 *) bus->ctrl_frame_buf, - (u32 ) bus->ctrl_frame_len,NULL ,NULL ,NULL ); + (u32 ) bus->ctrl_frame_len,NULL );if (ret <0 ) {/* On failure, abort the command and
@@ -5885,14 +5882,10 @@ err:static int brcmf_sdbrcm_send_buf (struct brcmf_bus *bus,u32 addr,uint fn,uint flags, -u8 *buf,uint nbytes,struct sk_buff *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle) +u8 *buf,uint nbytes,struct sk_buff *pkt) {return brcmf_sdcard_send_buf - (bus->sdiodev, addr, fn, flags, buf, nbytes, pkt, complete, - handle); + (bus->sdiodev, addr, fn, flags, buf, nbytes, pkt); }int brcmf_bus_devreset (struct brcmf_pub *drvr,u8 flag)
drivers/staging/brcm80211/brcmfmac/sdio_host.h +2 -8
@@ -188,16 +188,10 @@ extern bool brcmf_sdcard_regfail(struct brcmf_sdio_dev *sdiodev);*/ extern int brcmf_sdcard_send_buf (struct brcmf_sdio_dev *sdiodev,u32 addr,uint fn, -uint flags,u8 *buf,uint nbytes,void *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle); +uint flags,u8 *buf,uint nbytes,struct sk_buff *pkt);extern int brcmf_sdcard_recv_buf (struct brcmf_sdio_dev *sdiodev,u32 addr,uint fn, -uint flags,u8 *buf,uint nbytes,struct sk_buff *pkt, -void (*complete)(void *handle,int status, -bool sync_waiting), -void *handle); +uint flags,u8 *buf,uint nbytes,struct sk_buff *pkt);/* Flags bits */
Signature · 1 line
1.7.4.1
PATCH 13/14 staging: brcm80211: remove dead SDTEST code from fullmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Remove legacy dead code of SDTEST
--- drivers/staging/brcm80211/brcmfmac/dhd.h | 37 -- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 455 +------------------------ 2 files changed, 1 insertions(+), 491 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -37
@@ -672,15 +672,6 @@ extern uint brcmf_radio_up;/* Override to force tx queueing all the time */ extern uint brcmf_force_tx_queueing; -#ifdef SDTEST -/* Echo packet generator (SDIO), pkts/s */ -extern uint brcmf_pktgen; - -/* Echo packet len (0 => sawtooth, max 1800) */ -extern uint brcmf_pktgen_len; -#define BRCMF_MAX_PKTGEN_LEN 1800 -#endif -extern const struct bcmevent_name bcmevent_names[];extern const int bcmevent_names_size;
@@ -823,34 +814,6 @@ struct brcmf_c_ioctl {#define BRCMF_BTA_VAL 0x1000#define BRCMF_ISCAN_VAL 0x2000 -#ifdef SDTEST -/* For pktgen iovar */ -struct brcmf_pktgen { -uint version;/* To allow structure change tracking */ -uint freq;/* Max ticks between tx/rx attempts */ -uint count;/* Test packets to send/rcv each attempt */ -uint print;/* Print counts every <print> attempts */ -uint total;/* Total packets (or bursts) */ -uint minlen;/* Minimum length of packets to send */ -uint maxlen;/* Maximum length of packets to send */ -uint numsent;/* Count of test packets sent */ -uint numrcvd;/* Count of test packets received */ -uint numfail;/* Count of test send failures */ -uint mode;/* Test mode (type of test packets) */ -uint stop;/* Stop after this many tx failures */ -}; - -/* Version in case structure changes */ -#define BRCMF_PKTGEN_VERSION 2 - -/* Type of test packets to use */ -#define BRCMF_PKTGEN_ECHO 1/* Send echo requests */ -#define BRCMF_PKTGEN_SEND 2/* Send discard packets */ -#define BRCMF_PKTGEN_RXBURST 3/* Request dongle send N packets */ -#define BRCMF_PKTGEN_RECV 4/* Continuous rx from continuous -tx dongle */ -#endif /* SDTEST */ -/* Enter idle immediately (no timeout) */ #define BRCMF_IDLE_IMMEDIATE (-1)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -454
563 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 14/14 staging: brcm80211: remove unused func parameter in wl_cfg80211 of fullmac
In reply to Arend van SprielFrom: Franky Lin <[email protected]>
Get rid of some unused void *data parameter
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 24 +++++++++++----------- 1 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +12 -12
@@ -117,7 +117,7 @@ static void brcmf_init_eloop_handler(struct brcmf_cfg80211_event_loop *el);static struct brcmf_cfg80211_event_q *brcmf_deq_event (struct brcmf_cfg80211_priv *cfg_priv);static s32 brcmf_enq_event (struct brcmf_cfg80211_priv *cfg_priv,u32 type, -const struct brcmf_event_msg *msg,void *data); +const struct brcmf_event_msg *msg);static void brcmf_put_event (struct brcmf_cfg80211_event_q *e);static void brcmf_wakeup_event (struct brcmf_cfg80211_priv *cfg_priv); static s32 brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,
@@ -134,11 +134,11 @@ static s32 brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv, void *data);static s32 brcmf_bss_connect_done (struct brcmf_cfg80211_priv *cfg_priv,struct net_device *ndev, -const struct brcmf_event_msg *e,void *data, +const struct brcmf_event_msg *e,bool completed);static s32 brcmf_bss_roaming_done (struct brcmf_cfg80211_priv *cfg_priv,struct net_device *ndev, -const struct brcmf_event_msg *e,void *data); +const struct brcmf_event_msg *e);static s32 brcmf_notify_mic_status (struct brcmf_cfg80211_priv *cfg_priv,struct net_device *ndev,const struct brcmf_event_msg *e,void *data);
@@ -2631,7 +2631,7 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,clear_bit (WL_STATUS_CONNECTING , &cfg_priv->status);set_bit (WL_STATUS_CONNECTED , &cfg_priv->status); }else -brcmf_bss_connect_done (cfg_priv, ndev, e, data, true); +brcmf_bss_connect_done (cfg_priv, ndev, e, true); }else if (brcmf_is_linkdown (cfg_priv, e)) {WL_CONN ("Linkdown\n" );if (brcmf_is_ibssmode (cfg_priv)) {
@@ -2640,7 +2640,7 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv, &cfg_priv->status))brcmf_link_down (cfg_priv); }else { -brcmf_bss_connect_done (cfg_priv, ndev, e, data, false); +brcmf_bss_connect_done (cfg_priv, ndev, e, false);if (test_and_clear_bit (WL_STATUS_CONNECTED , &cfg_priv->status)) { cfg80211_disconnected(ndev, 0, NULL, 0,
@@ -2653,7 +2653,7 @@ brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,if (brcmf_is_ibssmode (cfg_priv))clear_bit (WL_STATUS_CONNECTING , &cfg_priv->status);else -brcmf_bss_connect_done (cfg_priv, ndev, e, data, false); +brcmf_bss_connect_done (cfg_priv, ndev, e, false); }return err;
@@ -2670,9 +2670,9 @@ brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,if (event ==BRCMF_E_ROAM && status ==BRCMF_E_STATUS_SUCCESS ) {if (test_bit (WL_STATUS_CONNECTED , &cfg_priv->status)) -brcmf_bss_roaming_done (cfg_priv, ndev, e, data); +brcmf_bss_roaming_done (cfg_priv, ndev, e);else -brcmf_bss_connect_done (cfg_priv, ndev, e, data, true); +brcmf_bss_connect_done (cfg_priv, ndev, e, true); }return err;
@@ -2883,7 +2883,7 @@ update_bss_info_out:static s32 brcmf_bss_roaming_done (struct brcmf_cfg80211_priv *cfg_priv,struct net_device *ndev, -const struct brcmf_event_msg *e,void *data) +const struct brcmf_event_msg *e) {struct brcmf_cfg80211_connect_info *conn_info =cfg_to_conn (cfg_priv);struct wiphy *wiphy =cfg_to_wiphy (cfg_priv);
@@ -2927,7 +2927,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,static s32 brcmf_bss_connect_done (struct brcmf_cfg80211_priv *cfg_priv,struct net_device *ndev,const struct brcmf_event_msg *e, -void *data,bool completed) +bool completed) {struct brcmf_cfg80211_connect_info *conn_info =cfg_to_conn (cfg_priv);s32 err =0 ;
@@ -3587,7 +3587,7 @@ brcmf_cfg80211_event(struct net_device *ndev,u32 event_type =be32_to_cpu (e->event_type);struct brcmf_cfg80211_priv *cfg_priv =ndev_to_cfg (ndev); -if (likely (!brcmf_enq_event (cfg_priv, event_type, e, data))) +if (likely (!brcmf_enq_event (cfg_priv, event_type, e)))brcmf_wakeup_event (cfg_priv); }
@@ -3637,7 +3637,7 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event(static s32 brcmf_enq_event (struct brcmf_cfg80211_priv *cfg_priv,u32 event, -const struct brcmf_event_msg *msg,void *data) +const struct brcmf_event_msg *msg) {struct brcmf_cfg80211_event_q *e;s32 err =0 ;
Signature · 1 line
1.7.4.1
2011/8/12 Arend van Spriel <[email protected]>:
Quoted 5 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Signature · 1 line
Rafał
Quoted 7 lines · Rafał Miłecki
2011/8/12 Arend van Spriel <[email protected]>:
Quoted 5 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 8 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Is there also a softmac version of the BCM4329 available? The wl driver shipped with the vendor firmware of my BCM4716 device detects one of the wifi chips as BCM4329. I think it is the one in the BCM4716 and that is already supported by b43. Or is this a wrong information?
Here is the output of the kernel log:
eth0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.10.144.3
eth1: Broadcom BCM4329 802.11 Wireless Controller 5.10.144.5
PCI: Enabling device 01:01.0 (0000 -> 0002)
eth2: Broadcom BCMa8d8 802.11 Wireless Controller 5.10.144.5
Hauke
W dniu 12 sierpnia 2011 17:14 użytkownik Hauke Mehrtens
Quoted 22 lines · <[email protected]> napisał:
Quoted 7 lines · Rafał Miłecki
2011/8/12 Arend van Spriel <[email protected]>:
Quoted 5 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 8 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Is there also a softmac version of the BCM4329 available? The wl driver shipped with the vendor firmware of my BCM4716 device detects one of the wifi chips as BCM4329. I think it is the one in the BCM4716 and that is already supported by b43. Or is this a wrong information?
Quoted 5 lines
Here is the output of the kernel log:
eth0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.10.144.3
eth1: Broadcom BCM4329 802.11 Wireless Controller 5.10.144.5
PCI: Enabling device 01:01.0 (0000 -> 0002)
eth2: Broadcom BCMa8d8 802.11 Wireless Controller 5.10.144.5
Please, try lspci and if you can, b43. I believe that is 14e4:4329 which is BCM4321.
Why wl can't properly print chipset name - ask Broadcom.
Signature · 1 line
Rafał
Quoted 5 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 4 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
Quoted 8 lines
Quoted 1 line
This series applies to staging-next and depends on the following patch set:
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under drivers/staging contain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a cfg80211 driver.
We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
W dniu 12 sierpnia 2011 18:32 użytkownik Arend van Spriel
Quoted 25 lines · <[email protected]> napisał:
Quoted 10 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 7 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 7 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under
drivers/stagingcontain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a cfg80211 driver.
Quoted 4 lines
We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Is there a chance you can donate me with such a adapter and card?
Signature · 1 line
Rafał
Quoted 23 lines · Rafał Miłecki
W dniu 12 sierpnia 2011 18:32 użytkownik Arend van Spriel
Quoted 21 lines · <[email protected]> napisał:
Quoted 7 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 6 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 7 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under
drivers/stagingcontain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a cfg80211 driver.
Quoted 5 lines
Quoted 4 lines
We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Is there a chance you can donate me with such a adapter and card?
Hi Rafał,
If your interest is getting SDIO supported in bcma this card is not very useful to you. The bcm4329 is using the SSB interconnect.
Gr. AvS
Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --
W dniu 13 sierpnia 2011 09:47 użytkownik Arend van Spriel
Quoted 37 lines · <[email protected]> napisał:
Quoted 36 lines · Rafał Miłecki
W dniu 12 sierpnia 2011 18:32 użytkownik Arend van Spriel
Quoted 32 lines · <[email protected]> napisał:
Quoted 10 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 7 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 7 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under
drivers/stagingcontain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the
SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a
cfg80211 driver.We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Quoted 6 lines
Quoted 1 line
Is there a chance you can donate me with such a adapter and card?
Hi Rafał,
If your interest is getting SDIO supported in bcma this card is not very useful to you. The bcm4329 is using the SSB interconnect.
That surprised me, interesting. I've never dig into brcmfmac code.
This still should be possible to adopt brcmfmac to use ssb, right? A first random ssb-related function: dhdsdio_chip_resetcore. It duplicates ssb code.
I'm still willing to help in brcmfmac development.
Signature · 1 line
Rafał
W dniu 12 sierpnia 2011 22:04 użytkownik Rafał Miłecki
Quoted 27 lines · <[email protected]> napisał:
W dniu 12 sierpnia 2011 18:32 użytkownik Arend van Spriel
Quoted 25 lines · <[email protected]> napisał:
Quoted 10 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 7 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 7 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under
drivers/stagingcontain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a cfg80211 driver.
Quoted 6 lines
Quoted 4 lines
We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Is there a chance you can donate me with such a adapter and card?
Ping?
Signature · 1 line
Rafał
Quoted 29 lines · Rafał Miłecki
W dniu 12 sierpnia 2011 22:04 użytkownik Rafał Miłecki
Quoted 27 lines · <[email protected]> napisał:
W dniu 12 sierpnia 2011 18:32 użytkownik Arend van Spriel
Quoted 25 lines · <[email protected]> napisał:
Quoted 10 lines · Rafał Miłecki
2011/8/12 Arend van Spriel<[email protected]>:
Quoted 7 lines
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Quoted 7 lines
Are you testing patches on some hardware? Or just compile-testing?
I believe this driver is meant to support BCM4329, which is not PCI(e) board. What adapter do you use?
I've heard about Arasan adapter. Have you tried it? Is that something reachable from arasan.com?
Our brcm80211 source tree under
drivers/stagingcontain two drivers. The brcmsmac driver currently supporting the PCI(e) cards with bcm43224, bcm43225, and bcm4313 chips and the brcmfmac driver currently supporting the SDIO card with bcm4329 chip. brcmsmac is a mac80211 driver and brcmfmac is a cfg80211 driver.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
We indeed use the Arasan adapter and both drivers are running in nightly test cycle testing our common internal repository. So the drivers are functionally tested on the x86 platforms (32 and 64 bit). Also looking at sparc64 and powerpc64 but not in a nightly cycle.
Is there a chance you can donate me with such a adapter and card?
Ping?
Sorry, I meant to respond to this earlier. The Arasan adapters are in very short supply here, and honestly they have enough issues that we're looking for better options. A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel. However, I don't know of a specific platform at the moment to recommend.
A second choice would be something with a decent sdio controller built-in. Some older laptops worked ok (e.g. Dell E4100), but they're more and more diffucult to find.
- Henry
Quoted 4 lines · Henry Ptasinski
A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel. However, I don't know of a specific platform at the moment to recommend.
Nexus One phone?
hth,
Jason.
Quoted 7 lines · Jason
Quoted 4 lines · Henry Ptasinski
A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel. However, I don't know of a specific platform at the moment to recommend.
Nexus One phone?
That's a possibility. Are people running recent, relatively unmodified linux kernels on the Nexus One? (Or you could backport brcmfmac to the Android version of the kernel, perhaps using compat-wireless).
- Henry
Quoted 7 lines · Henry Ptasinski
Quoted 6 lines · Jason
Quoted 4 lines · Henry Ptasinski
A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel. However, I don't know of a specific platform at the moment to recommend.
Quoted 5 lines
Quoted 1 line
Nexus One phone?
That's a possibility. Are people running recent, relatively unmodified linux kernels on the Nexus One? (Or you could backport brcmfmac to the Android version of the kernel, perhaps using compat-wireless).
folks run debian from the sdcard [1], a mainline kernel shouldn't be too big of a stretch from there. Especially if the purpose is for testing wifi. Don't need PM, GSM, display, 3D, etc for that.
Note, I haven't tried it yet, myself. It's been on the _long_ list of projects. It would be higher on the list if brcmfmac supported all the normal Linux features like monitor mode, AP mode, multiple-VAPs, etc. Or, at least, was in mainline and would accept patches adding such features... ;-)
hth,
Jason.
Quoted 18 lines · Jason
Quoted 7 lines · Henry Ptasinski
Quoted 6 lines · Jason
Quoted 4 lines · Henry Ptasinski
A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel. However, I don't know of a specific platform at the moment to recommend.
Quoted 5 lines
Quoted 1 line
Nexus One phone?
That's a possibility. Are people running recent, relatively unmodified linux kernels on the Nexus One? (Or you could backport brcmfmac to the Android version of the kernel, perhaps using compat-wireless).
folks run debian from the sdcard [1], a mainline kernel shouldn't be too big of a stretch from there. Especially if the purpose is for testing wifi. Don't need PM, GSM, display, 3D, etc for that.
Quoted 5 lines
Note, I haven't tried it yet, myself. It's been on the _long_ list of projects. It would be higher on the list if brcmfmac supported all the normal Linux features like monitor mode, AP mode, multiple-VAPs, etc. Or, at least, was in mainline and would accept patches adding such features... ;-)
Would definitely accept patches for such features! We're definitely interested in them, and they're all on our list to add, but crossing the chasm is the first step.
- Henry
Quoted 7 lines · Arend van Spriel
Several cleanup patches to reduce code for the brcmfmac driver and get rid of a remaining checkpatch warning. The driver sources should be clear from checkpatch issue now.
This series applies to staging-next and depends on the following patch set:
Message-ID: <[email protected]>
All now applied, thanks.
greg k-h