madwifi: properly fix build against Linux 3.7 and later

git-svn-id: svn://svn.openwrt.org/openwrt/packages@36762 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2013-05-29 16:08:13 +00:00
parent ee2527a1e4
commit 208c0aaf5a
66 changed files with 199 additions and 185 deletions

View File

@ -195,6 +195,7 @@ MAKE_ARGS:= \
TOOLPREFIX="$(KERNEL_CROSS)" \
TOOLPATH="$(KERNEL_CROSS)" \
KERNELPATH="$(LINUX_DIR)" \
KERNELRELEASE="$(LINUX_VERSION)" \
LDOPTS="--no-warn-mismatch " \
ATH_RATE="$(RATE_CONTROL)" \
ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \

View File

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

View File

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

View File

@ -278,7 +278,7 @@
bad4:
--- a/ath/if_ath_pci.c
+++ b/ath/if_ath_pci.c
@@ -123,6 +123,33 @@ static u16 ath_devidmap[][2] = {
@@ -125,6 +125,33 @@ static u16 ath_devidmap[][2] = {
{ 0xff1a, 0x001a }
};
@ -312,7 +312,7 @@
static int
ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
@@ -257,6 +284,10 @@ ath_pci_probe(struct pci_dev *pdev, cons
@@ -259,6 +286,10 @@ ath_pci_probe(struct pci_dev *pdev, cons
printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n",
dev_info, dev->name, athname ? athname : "Atheros ???", phymem, dev->irq);

View File

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

View File

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

View File

@ -842,7 +842,7 @@
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
--- a/ath/if_ath_pci.c
+++ b/ath/if_ath_pci.c
@@ -226,7 +226,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
@@ -228,7 +228,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
printk(KERN_ERR "%s: no memory for device state\n", dev_info);
goto bad2;
}
@ -851,7 +851,7 @@
sc->aps_sc.sc_dev = dev;
sc->aps_sc.sc_iobase = mem;
@@ -309,7 +309,7 @@ static void
@@ -311,7 +311,7 @@ static void
ath_pci_remove(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
@ -860,7 +860,7 @@
ath_detach(dev);
if (dev->irq)
@@ -327,7 +327,7 @@ ath_pci_suspend(struct pci_dev *pdev, pm
@@ -329,7 +329,7 @@ ath_pci_suspend(struct pci_dev *pdev, pm
struct net_device *dev = pci_get_drvdata(pdev);
ath_suspend(dev);
@ -869,7 +869,7 @@
pci_disable_device(pdev);
return pci_set_power_state(pdev, PCI_D3hot);
}
@@ -344,7 +344,7 @@ ath_pci_resume(struct pci_dev *pdev)
@@ -346,7 +346,7 @@ ath_pci_resume(struct pci_dev *pdev)
return err;
/* XXX - Should this return nonzero on fail? */

View File

@ -14,7 +14,7 @@
if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) ||
--- a/ath/if_ath_pci.c
+++ b/ath/if_ath_pci.c
@@ -236,6 +236,11 @@ ath_pci_probe(struct pci_dev *pdev, cons
@@ -238,6 +238,11 @@ ath_pci_probe(struct pci_dev *pdev, cons
*/
sc->aps_sc.sc_invalid = 1;

View File

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

View File

@ -451,7 +451,7 @@
module_exit(exit_ath_ahb);
--- a/ath/if_ath_pci.c
+++ b/ath/if_ath_pci.c
@@ -415,11 +415,19 @@ MODULE_SUPPORTED_DEVICE("Atheros WLAN ca
@@ -417,11 +417,19 @@ MODULE_SUPPORTED_DEVICE("Atheros WLAN ca
MODULE_LICENSE("Dual BSD/GPL");
#endif
@ -471,7 +471,7 @@
if (pci_register_driver(&ath_pci_driver) < 0) {
printk(KERN_ERR "%s: No devices found, driver not installed.\n", dev_info);
return (-ENODEV);
@@ -434,6 +442,10 @@ exit_ath_pci(void)
@@ -436,6 +444,10 @@ exit_ath_pci(void)
{
ath_sysctl_unregister();
pci_unregister_driver(&ath_pci_driver);

View File

@ -1,6 +1,6 @@
--- a/ath/if_ath_pci.c
+++ b/ath/if_ath_pci.c
@@ -264,6 +264,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
@@ -266,6 +266,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
}
}
@ -8,7 +8,7 @@
/*
* Auto-enable soft led processing for IBM cards and for
* 5211 minipci cards. Users can also manually enable/disable
@@ -279,6 +280,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
@@ -281,6 +282,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
sc->aps_sc.sc_softled = 1;
sc->aps_sc.sc_ledpin = 1;
}

View File

@ -7,9 +7,9 @@
- { 0x168c, 0x0023, PCI_ANY_ID, PCI_ANY_ID },
- { 0x168c, 0x0024, PCI_ANY_ID, PCI_ANY_ID },
{ 0x168c, 0x9013, PCI_ANY_ID, PCI_ANY_ID }, /* sonicwall */
{ 0x168c, 0xff16, PCI_ANY_ID, PCI_ANY_ID },
{ 0x168c, 0xff1a, PCI_ANY_ID, PCI_ANY_ID },
{ 0 }
@@ -146,8 +144,6 @@ static const struct ath_hw_detect cards[
@@ -148,8 +146,6 @@ static const struct ath_hw_detect cards[
{ ubnt, "SR4C", 0x168c, 0x0013, 0x7777, 0x1004, 6 },
{ ubnt, "SR5", 0x168c, 0x0013, 0x168c, 0x2042, 7 },
{ ubnt, "SR9", 0x168c, 0x0013, 0x7777, 0x2009, 12 },

View File

@ -0,0 +1,13 @@
--- a/include/compat.h
+++ b/include/compat.h
@@ -204,6 +204,10 @@ static inline int timeval_compare(struct
#define CTLNAME(x)
#endif
+#ifndef __devinitdata
+#define __devinitdata
+#endif
+
#endif /* __KERNEL__ */
#endif /* _ATH_COMPAT_H_ */