package/madwifi: refresh madwifi patches

SVN-Revision: 23971
v19.07.3_mercusys_ac12_duma
Alexandros C. Couloumbis 14 years ago
parent 79a27bd7b2
commit 5eef1e4f29

@ -73,6 +73,7 @@
- ieee80211_ref_node(SKB_CB(skb)->ni); - ieee80211_ref_node(SKB_CB(skb)->ni);
- /* Unshare the node, decrementing users in the old skb */ - /* Unshare the node, decrementing users in the old skb */
- skb = skb_unshare(skb, GFP_ATOMIC); - skb = skb_unshare(skb, GFP_ATOMIC);
- }
+ need_headroom -= skb_headroom(skb); + need_headroom -= skb_headroom(skb);
+ if (isff) + if (isff)
+ need_tailroom -= skb_tailroom(skb2); + need_tailroom -= skb_tailroom(skb2);
@ -83,42 +84,32 @@
+ need_headroom = 0; + need_headroom = 0;
+ if (need_tailroom < 0) + if (need_tailroom < 0)
+ need_tailroom = 0; + need_tailroom = 0;
+
+ if (skb_cloned(skb) || (need_headroom > 0) ||
+ (!isff && (need_tailroom > 0))) {
+
+ if (pskb_expand_head(skb, need_headroom, need_tailroom, GFP_ATOMIC)) {
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
+ "%s: cannot expand storage (tail)\n", __func__);
+ goto error;
+ }
}
#ifdef ATH_SUPERG_FF -#ifdef ATH_SUPERG_FF
if (isff) { - if (isff) {
- if (skb == NULL) { - if (skb == NULL) {
- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
- "%s: cannot unshare for encapsulation\n", - "%s: cannot unshare for encapsulation\n",
- __func__); - __func__);
- vap->iv_stats.is_tx_nobuf++; - vap->iv_stats.is_tx_nobuf++;
- ieee80211_dev_kfree_skb(&skb2); - ieee80211_dev_kfree_skb(&skb2);
- + if (skb_cloned(skb) || (need_headroom > 0) ||
+ (!isff && (need_tailroom > 0))) {
- return NULL; - return NULL;
- } + if (pskb_expand_head(skb, need_headroom, need_tailroom, GFP_ATOMIC)) {
+ inter_headroom -= skb_headroom(skb2); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
+ if (inter_headroom < 0) + "%s: cannot expand storage (tail)\n", __func__);
+ inter_headroom = 0; + goto error;
+ if ((skb_cloned(skb2) || }
+ (inter_headroom > 0) || (need_tailroom > 0))) { + }
- /* first skb header */ - /* first skb header */
- if (skb_headroom(skb) < need_headroom) { - if (skb_headroom(skb) < need_headroom) {
- struct sk_buff *tmp = skb; - struct sk_buff *tmp = skb;
- skb = skb_realloc_headroom(skb, need_headroom); - skb = skb_realloc_headroom(skb, need_headroom);
- if (skb == NULL) { - if (skb == NULL) {
+ if (pskb_expand_head(skb2, inter_headroom, - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
+ need_tailroom, GFP_ATOMIC)) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
- "%s: cannot expand storage (head1)\n", - "%s: cannot expand storage (head1)\n",
- __func__); - __func__);
- vap->iv_stats.is_tx_nobuf++; - vap->iv_stats.is_tx_nobuf++;
@ -130,7 +121,14 @@
- /* NB: cb[] area was copied, but not next ptr. must do that - /* NB: cb[] area was copied, but not next ptr. must do that
- * prior to return on success. */ - * prior to return on success. */
- } - }
- +#ifdef ATH_SUPERG_FF
+ if (isff) {
+ inter_headroom -= skb_headroom(skb2);
+ if (inter_headroom < 0)
+ inter_headroom = 0;
+ if ((skb_cloned(skb2) ||
+ (inter_headroom > 0) || (need_tailroom > 0))) {
- /* second skb with header and tail adjustments possible */ - /* second skb with header and tail adjustments possible */
- if (skb_tailroom(skb2) < need_tailroom) { - if (skb_tailroom(skb2) < need_tailroom) {
- int n = 0; - int n = 0;
@ -139,7 +137,9 @@
- if (pskb_expand_head(skb2, n, - if (pskb_expand_head(skb2, n,
- need_tailroom - skb_tailroom(skb2), GFP_ATOMIC)) { - need_tailroom - skb_tailroom(skb2), GFP_ATOMIC)) {
- ieee80211_dev_kfree_skb(&skb2); - ieee80211_dev_kfree_skb(&skb2);
- IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + if (pskb_expand_head(skb2, inter_headroom,
+ need_tailroom, GFP_ATOMIC)) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
- "%s: cannot expand storage (tail2)\n", - "%s: cannot expand storage (tail2)\n",
- __func__); - __func__);
- vap->iv_stats.is_tx_nobuf++; - vap->iv_stats.is_tx_nobuf++;
@ -163,10 +163,10 @@
- } else - } else
- ieee80211_skb_copy_noderef(tmp, skb); - ieee80211_skb_copy_noderef(tmp, skb);
- ieee80211_dev_kfree_skb(&tmp); - ieee80211_dev_kfree_skb(&tmp);
} - }
- if (skb) { - if (skb) {
- skb->next = skb2; - skb->next = skb2;
- } }
- return skb; - return skb;
+ skb->next = skb2; + skb->next = skb2;
} }

@ -1176,12 +1176,12 @@
+ struct ieee80211_frame *wh; + struct ieee80211_frame *wh;
+ int len = sizeof(struct ieee80211_frame); + int len = sizeof(struct ieee80211_frame);
+ int opmode = vap->iv_opmode; + int opmode = vap->iv_opmode;
+
+ if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { + if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) {
+ if ((opmode == IEEE80211_M_STA) && + if ((opmode == IEEE80211_M_STA) &&
+ (vap->iv_flags_ext & IEEE80211_FEXT_WDS)) + (vap->iv_flags_ext & IEEE80211_FEXT_WDS))
+ opmode = IEEE80211_M_WDS; + opmode = IEEE80211_M_WDS;
+
+ if (opmode == IEEE80211_M_WDS) + if (opmode == IEEE80211_M_WDS)
+ len = sizeof(struct ieee80211_frame_addr4); + len = sizeof(struct ieee80211_frame_addr4);
+ } + }

@ -63,7 +63,7 @@
+ if (vap->iv_max_nodes > 0) { + if (vap->iv_max_nodes > 0) {
+ unsigned int active_nodes = 0; + unsigned int active_nodes = 0;
+ struct ieee80211_node *tni; + struct ieee80211_node *tni;
+
+ IEEE80211_NODE_TABLE_LOCK_IRQ(&ic->ic_sta); + IEEE80211_NODE_TABLE_LOCK_IRQ(&ic->ic_sta);
+ TAILQ_FOREACH(tni, &ic->ic_sta.nt_node, ni_list) { + TAILQ_FOREACH(tni, &ic->ic_sta.nt_node, ni_list) {
+ if (tni->ni_vap != vap) + if (tni->ni_vap != vap)
@ -73,7 +73,7 @@
+ active_nodes++; + active_nodes++;
+ } + }
+ IEEE80211_NODE_TABLE_UNLOCK_IRQ(&ic->ic_sta); + IEEE80211_NODE_TABLE_UNLOCK_IRQ(&ic->ic_sta);
+
+ if (active_nodes >= vap->iv_max_nodes) { + if (active_nodes >= vap->iv_max_nodes) {
+ /* too many nodes connected */ + /* too many nodes connected */
+ ieee80211_node_leave(ni); + ieee80211_node_leave(ni);

@ -196,10 +196,12 @@
static inline void ath_hal_beaconinit(struct ath_hal *ah, u_int32_t nexttbtt, static inline void ath_hal_beaconinit(struct ath_hal *ah, u_int32_t nexttbtt,
u_int32_t intval) u_int32_t intval)
{ {
@@ -841,6 +852,17 @@ static inline HAL_BOOL ath_hal_setslotti @@ -839,6 +850,17 @@ static inline HAL_BOOL ath_hal_setslotti
ath_hal_set_function(NULL);
ATH_HAL_UNLOCK_IRQ(ah->ah_sc);
return ret; return ret;
} +}
+
+static inline HAL_BOOL ath_hal_seteifstime(struct ath_hal *ah, u_int a1) +static inline HAL_BOOL ath_hal_seteifstime(struct ath_hal *ah, u_int a1)
+{ +{
+ HAL_BOOL ret; + HAL_BOOL ret;
@ -209,11 +211,9 @@
+ ath_hal_set_function(NULL); + ath_hal_set_function(NULL);
+ ATH_HAL_UNLOCK_IRQ(ah->ah_sc); + ATH_HAL_UNLOCK_IRQ(ah->ah_sc);
+ return ret; + return ret;
+} }
+
static inline void ath_hal_setledstate(struct ath_hal *ah, HAL_LED_STATE a1) static inline void ath_hal_setledstate(struct ath_hal *ah, HAL_LED_STATE a1)
{
ATH_HAL_LOCK_IRQ(ah->ah_sc);
--- a/ath/if_athvar.h --- a/ath/if_athvar.h
+++ b/ath/if_athvar.h +++ b/ath/if_athvar.h
@@ -613,6 +613,15 @@ struct ath_rp { @@ -613,6 +613,15 @@ struct ath_rp {

@ -36,13 +36,13 @@
struct ieee80211vap *vap = ni->ni_vap; struct ieee80211vap *vap = ni->ni_vap;
- struct ether_header *eh = (struct ether_header *) skb->data; - struct ether_header *eh = (struct ether_header *) skb->data;
- int v_wme_ac = 0, d_wme_ac = 0; - int v_wme_ac = 0, d_wme_ac = 0;
-
- /* default priority */ - /* default priority */
- skb->priority = WME_AC_BE; - skb->priority = WME_AC_BE;
- -
- if (!(ni->ni_flags & IEEE80211_NODE_QOS)) - if (!(ni->ni_flags & IEEE80211_NODE_QOS))
- return 0; - return 0;
-
- /* - /*
- * If node has a vlan tag then all traffic - * If node has a vlan tag then all traffic
- * to it must have a matching vlan id. - * to it must have a matching vlan id.

@ -1,5 +1,5 @@
--- a/ath/if_ath.c 2010-07-13 22:58:23.000000000 +0200 --- a/ath/if_ath.c
+++ b/ath/if_ath.c 2010-07-13 23:03:20.000000000 +0200 +++ b/ath/if_ath.c
@@ -63,6 +63,8 @@ @@ -63,6 +63,8 @@
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/time.h> #include <linux/time.h>
@ -9,7 +9,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "if_ethersubr.h" /* for ETHER_IS_MULTICAST */ #include "if_ethersubr.h" /* for ETHER_IS_MULTICAST */
@@ -587,6 +589,10 @@ @@ -587,6 +589,10 @@ ath_attach(u_int16_t devid, struct net_d
unsigned int i; unsigned int i;
int autocreatemode = -1; int autocreatemode = -1;
u_int8_t csz; u_int8_t csz;
@ -20,7 +20,7 @@
sc->devid = devid; sc->devid = devid;
#ifdef AR_DEBUG #ifdef AR_DEBUG
@@ -648,6 +654,13 @@ @@ -648,6 +654,13 @@ ath_attach(u_int16_t devid, struct net_d
} }
sc->sc_ah = ah; sc->sc_ah = ah;

@ -1,9 +1,11 @@
--- a/ath/if_athvar.h --- a/ath/if_athvar.h
+++ b/ath/if_athvar.h +++ b/ath/if_athvar.h
@@ -991,5 +991,5 @@ @@ -974,7 +974,7 @@ typedef void (*ath_callback) (struct ath
#endif #endif
/* Protects the device from concurrent accesses */ /* Protects the device from concurrent accesses */
-#define ATH_LOCK_INIT(_sc) init_MUTEX(&(_sc)->sc_lock) -#define ATH_LOCK_INIT(_sc) init_MUTEX(&(_sc)->sc_lock)
+#define ATH_LOCK_INIT(_sc) sema_init(&(_sc)->sc_lock, 1) +#define ATH_LOCK_INIT(_sc) sema_init(&(_sc)->sc_lock, 1)
#define ATH_LOCK_DESTROY(_sc) #define ATH_LOCK_DESTROY(_sc)
#define ATH_LOCK(_sc) down(&(_sc)->sc_lock) #define ATH_LOCK(_sc) down(&(_sc)->sc_lock)
#define ATH_UNLOCK(_sc) up(&(_sc)->sc_lock)

Loading…
Cancel
Save