Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cc4bf501
Commit
cc4bf501
authored
Mar 08, 2012
by
Luciano Coelho
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wl12xx-next' into for-linville
parents
41b58f18
55df5afb
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
321 additions
and
205 deletions
+321
-205
drivers/net/wireless/wl12xx/cmd.c
drivers/net/wireless/wl12xx/cmd.c
+25
-1
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/conf.h
+3
-0
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/main.c
+246
-192
drivers/net/wireless/wl12xx/ps.c
drivers/net/wireless/wl12xx/ps.c
+1
-3
drivers/net/wireless/wl12xx/scan.c
drivers/net/wireless/wl12xx/scan.c
+6
-0
drivers/net/wireless/wl12xx/tx.c
drivers/net/wireless/wl12xx/tx.c
+34
-7
drivers/net/wireless/wl12xx/tx.h
drivers/net/wireless/wl12xx/tx.h
+1
-0
drivers/net/wireless/wl12xx/wl12xx.h
drivers/net/wireless/wl12xx/wl12xx.h
+5
-2
No files found.
drivers/net/wireless/wl12xx/cmd.c
View file @
cc4bf501
...
...
@@ -459,23 +459,39 @@ int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id)
int
wl12xx_allocate_link
(
struct
wl1271
*
wl
,
struct
wl12xx_vif
*
wlvif
,
u8
*
hlid
)
{
unsigned
long
flags
;
u8
link
=
find_first_zero_bit
(
wl
->
links_map
,
WL12XX_MAX_LINKS
);
if
(
link
>=
WL12XX_MAX_LINKS
)
return
-
EBUSY
;
/* these bits are used by op_tx */
spin_lock_irqsave
(
&
wl
->
wl_lock
,
flags
);
__set_bit
(
link
,
wl
->
links_map
);
__set_bit
(
link
,
wlvif
->
links_map
);
spin_unlock_irqrestore
(
&
wl
->
wl_lock
,
flags
);
*
hlid
=
link
;
return
0
;
}
void
wl12xx_free_link
(
struct
wl1271
*
wl
,
struct
wl12xx_vif
*
wlvif
,
u8
*
hlid
)
{
unsigned
long
flags
;
if
(
*
hlid
==
WL12XX_INVALID_LINK_ID
)
return
;
/* these bits are used by op_tx */
spin_lock_irqsave
(
&
wl
->
wl_lock
,
flags
);
__clear_bit
(
*
hlid
,
wl
->
links_map
);
__clear_bit
(
*
hlid
,
wlvif
->
links_map
);
spin_unlock_irqrestore
(
&
wl
->
wl_lock
,
flags
);
/*
* At this point op_tx() will not add more packets to the queues. We
* can purge them.
*/
wl1271_tx_reset_link_queues
(
wl
,
*
hlid
);
*
hlid
=
WL12XX_INVALID_LINK_ID
;
}
...
...
@@ -515,7 +531,7 @@ static int wl12xx_cmd_role_start_dev(struct wl1271 *wl,
goto
out_free
;
}
cmd
->
device
.
hlid
=
wlvif
->
dev_hlid
;
cmd
->
device
.
session
=
wl
vif
->
session_counter
;
cmd
->
device
.
session
=
wl
12xx_get_new_session_id
(
wl
,
wlvif
)
;
wl1271_debug
(
DEBUG_CMD
,
"role start: roleid=%d, hlid=%d, session=%d"
,
cmd
->
role_id
,
cmd
->
device
.
hlid
,
cmd
->
device
.
session
);
...
...
@@ -1802,6 +1818,14 @@ int wl12xx_croc(struct wl1271 *wl, u8 role_id)
goto
out
;
__clear_bit
(
role_id
,
wl
->
roc_map
);
/*
* Rearm the tx watchdog when removing the last ROC. This prevents
* recoveries due to just finished ROCs - when Tx hasn't yet had
* a chance to get out.
*/
if
(
find_first_bit
(
wl
->
roc_map
,
WL12XX_MAX_ROLES
)
>=
WL12XX_MAX_ROLES
)
wl12xx_rearm_tx_watchdog_locked
(
wl
);
out:
return
ret
;
}
...
...
drivers/net/wireless/wl12xx/conf.h
View file @
cc4bf501
...
...
@@ -690,6 +690,9 @@ struct conf_tx_settings {
*/
u8
tmpl_short_retry_limit
;
u8
tmpl_long_retry_limit
;
/* Time in ms for Tx watchdog timer to expire */
u32
tx_watchdog_timeout
;
};
enum
{
...
...
drivers/net/wireless/wl12xx/main.c
View file @
cc4bf501
This diff is collapsed.
Click to expand it.
drivers/net/wireless/wl12xx/ps.c
View file @
cc4bf501
...
...
@@ -69,8 +69,6 @@ void wl1271_elp_work(struct work_struct *work)
mutex_unlock
(
&
wl
->
mutex
);
}
#define ELP_ENTRY_DELAY 5
/* Routines to toggle sleep mode while in ELP */
void
wl1271_ps_elp_sleep
(
struct
wl1271
*
wl
)
{
...
...
@@ -90,7 +88,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
}
ieee80211_queue_delayed_work
(
wl
->
hw
,
&
wl
->
elp_work
,
msecs_to_jiffies
(
ELP_ENTRY_DELAY
));
msecs_to_jiffies
(
wl
->
conf
.
conn
.
dynamic_ps_timeout
));
}
int
wl1271_ps_elp_wakeup
(
struct
wl1271
*
wl
)
...
...
drivers/net/wireless/wl12xx/scan.c
View file @
cc4bf501
...
...
@@ -55,6 +55,12 @@ void wl1271_scan_complete_work(struct work_struct *work)
vif
=
wl
->
scan_vif
;
wlvif
=
wl12xx_vif_to_data
(
vif
);
/*
* Rearm the tx watchdog just before idling scan. This
* prevents just-finished scans from triggering the watchdog
*/
wl12xx_rearm_tx_watchdog_locked
(
wl
);
wl
->
scan
.
state
=
WL1271_SCAN_STATE_IDLE
;
memset
(
wl
->
scan
.
scanned_ch
,
0
,
sizeof
(
wl
->
scan
.
scanned_ch
));
wl
->
scan
.
req
=
NULL
;
...
...
drivers/net/wireless/wl12xx/tx.c
View file @
cc4bf501
...
...
@@ -226,6 +226,10 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
wl
->
tx_blocks_available
-=
total_blocks
;
wl
->
tx_allocated_blocks
+=
total_blocks
;
/* If the FW was empty before, arm the Tx watchdog */
if
(
wl
->
tx_allocated_blocks
==
total_blocks
)
wl12xx_rearm_tx_watchdog_locked
(
wl
);
ac
=
wl1271_tx_get_queue
(
skb_get_queue_mapping
(
skb
));
wl
->
tx_allocated_pkts
[
ac
]
++
;
...
...
@@ -527,6 +531,7 @@ static struct sk_buff *wl12xx_lnk_skb_dequeue(struct wl1271 *wl,
if
(
skb
)
{
int
q
=
wl1271_tx_get_queue
(
skb_get_queue_mapping
(
skb
));
spin_lock_irqsave
(
&
wl
->
wl_lock
,
flags
);
WARN_ON_ONCE
(
wl
->
tx_queue_count
[
q
]
<=
0
);
wl
->
tx_queue_count
[
q
]
--
;
spin_unlock_irqrestore
(
&
wl
->
wl_lock
,
flags
);
}
...
...
@@ -571,6 +576,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
struct
wl12xx_vif
*
wlvif
=
wl
->
last_wlvif
;
struct
sk_buff
*
skb
=
NULL
;
/* continue from last wlvif (round robin) */
if
(
wlvif
)
{
wl12xx_for_each_wlvif_continue
(
wl
,
wlvif
)
{
skb
=
wl12xx_vif_skb_dequeue
(
wl
,
wlvif
);
...
...
@@ -581,7 +587,11 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
}
}
/* do another pass */
/* dequeue from the system HLID before the restarting wlvif list */
if
(
!
skb
)
skb
=
wl12xx_lnk_skb_dequeue
(
wl
,
&
wl
->
links
[
wl
->
system_hlid
]);
/* do a new pass over the wlvif list */
if
(
!
skb
)
{
wl12xx_for_each_wlvif
(
wl
,
wlvif
)
{
skb
=
wl12xx_vif_skb_dequeue
(
wl
,
wlvif
);
...
...
@@ -589,12 +599,16 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
wl
->
last_wlvif
=
wlvif
;
break
;
}
/*
* No need to continue after last_wlvif. The previous
* pass should have found it.
*/
if
(
wlvif
==
wl
->
last_wlvif
)
break
;
}
}
if
(
!
skb
)
skb
=
wl12xx_lnk_skb_dequeue
(
wl
,
&
wl
->
links
[
wl
->
system_hlid
]);
if
(
!
skb
&&
test_and_clear_bit
(
WL1271_FLAG_DUMMY_PACKET_PENDING
,
&
wl
->
flags
))
{
int
q
;
...
...
@@ -602,6 +616,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
skb
=
wl
->
dummy_packet
;
q
=
wl1271_tx_get_queue
(
skb_get_queue_mapping
(
skb
));
spin_lock_irqsave
(
&
wl
->
wl_lock
,
flags
);
WARN_ON_ONCE
(
wl
->
tx_queue_count
[
q
]
<=
0
);
wl
->
tx_queue_count
[
q
]
--
;
spin_unlock_irqrestore
(
&
wl
->
wl_lock
,
flags
);
}
...
...
@@ -959,7 +974,6 @@ void wl12xx_tx_reset_wlvif(struct wl1271 *wl, struct wl12xx_vif *wlvif)
else
wlvif
->
sta
.
ba_rx_bitmap
=
0
;
wl1271_tx_reset_link_queues
(
wl
,
i
);
wl
->
links
[
i
].
allocated_pkts
=
0
;
wl
->
links
[
i
].
prev_freed_pkts
=
0
;
}
...
...
@@ -973,8 +987,14 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
struct
sk_buff
*
skb
;
struct
ieee80211_tx_info
*
info
;
/* only reset the queues if something bad happened */
if
(
WARN_ON_ONCE
(
wl1271_tx_total_queue_count
(
wl
)
!=
0
))
{
for
(
i
=
0
;
i
<
WL12XX_MAX_LINKS
;
i
++
)
wl1271_tx_reset_link_queues
(
wl
,
i
);
for
(
i
=
0
;
i
<
NUM_TX_QUEUES
;
i
++
)
wl
->
tx_queue_count
[
i
]
=
0
;
}
wl
->
stopped_queues_map
=
0
;
...
...
@@ -1024,6 +1044,7 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
void
wl1271_tx_flush
(
struct
wl1271
*
wl
)
{
unsigned
long
timeout
;
int
i
;
timeout
=
jiffies
+
usecs_to_jiffies
(
WL1271_TX_FLUSH_TIMEOUT
);
while
(
!
time_after
(
jiffies
,
timeout
))
{
...
...
@@ -1041,6 +1062,12 @@ void wl1271_tx_flush(struct wl1271 *wl)
}
wl1271_warning
(
"Unable to flush all TX buffers, timed out."
);
/* forcibly flush all Tx buffers on our queues */
mutex_lock
(
&
wl
->
mutex
);
for
(
i
=
0
;
i
<
WL12XX_MAX_LINKS
;
i
++
)
wl1271_tx_reset_link_queues
(
wl
,
i
);
mutex_unlock
(
&
wl
->
mutex
);
}
u32
wl1271_tx_min_rate_get
(
struct
wl1271
*
wl
,
u32
rate_set
)
...
...
drivers/net/wireless/wl12xx/tx.h
View file @
cc4bf501
...
...
@@ -227,5 +227,6 @@ void wl12xx_rearm_rx_streaming(struct wl1271 *wl, unsigned long *active_hlids);
/* from main.c */
void
wl1271_free_sta
(
struct
wl1271
*
wl
,
struct
wl12xx_vif
*
wlvif
,
u8
hlid
);
void
wl12xx_rearm_tx_watchdog_locked
(
struct
wl1271
*
wl
);
#endif
drivers/net/wireless/wl12xx/wl12xx.h
View file @
cc4bf501
...
...
@@ -260,11 +260,13 @@ enum wl12xx_flags {
WL1271_FLAG_SOFT_GEMINI
,
WL1271_FLAG_RECOVERY_IN_PROGRESS
,
WL1271_FLAG_VIF_CHANGE_IN_PROGRESS
,
WL1271_FLAG_INTENDED_FW_RECOVERY
,
};
enum
wl12xx_vif_flags
{
WLVIF_FLAG_INITIALIZED
,
WLVIF_FLAG_STA_ASSOCIATED
,
WLVIF_FLAG_STA_AUTHORIZED
,
WLVIF_FLAG_IBSS_JOINED
,
WLVIF_FLAG_AP_STARTED
,
WLVIF_FLAG_IN_PS
,
...
...
@@ -452,8 +454,6 @@ struct wl1271 {
bool
enable_11a
;
struct
list_head
list
;
/* Most recently reported noise in dBm */
s8
noise
;
...
...
@@ -495,6 +495,9 @@ struct wl1271 {
/* last wlvif we transmitted from */
struct
wl12xx_vif
*
last_wlvif
;
/* work to fire when Tx is stuck */
struct
delayed_work
tx_watchdog_work
;
};
struct
wl1271_station
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment