2008-02-28 02:02:21

by John W. Linville

[permalink] [raw]
Subject: pull request: wireless-2.6 2008-02-27

Dave,

Here are some fixes intended for 2.6.25. Please let me know if there
are problems!

Thanks,

John

P.S. This will create a merge conflict with the code I already
requested that you pull for net-2.6.26. The merge is easily resolved,
since it is two "comment block + single statement" additions at the
same place in the file. Just take both sets of changes, and order
the "Evalue antenna setup" group _after_ the "Send a signal to the
led" group. I have the conflict corrected in my wireless-testing
tree for reference if you need it.

---

Individual patches are available here:

http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit d9595a7b9c777d45a74774f1428c263a0a47f4c0:
David S. Miller (1):
[AF_KEY]: Fix oops by converting to proc_net_*().

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Alexey Zaytsev (2):
Use a separate config option for the b43 pci to ssb bridge.
Don't build bcm43xx if SSB is static and b43 PCI-SSB bridge is enabled.

Gordon Farquharson (1):
Fix b43 driver build for arm

Ivo van Doorn (4):
rt2x00: Fix antenna diversity
rt2x00: Add link tuner safe RX toggle states
rt2x00: Don't switch to antenna with low rssi
rt2x00: Fix rt2x00lib_reset_link_tuner()

Johannes Berg (2):
rndis_wlan: fix sparse warnings
mac80211: fix kmalloc vs. net_ratelimit

Masakazu Mokuno (1):
PS3: gelic: Link the wireless net_device structure to the corresponding device structure

Roland Dreier (1):
libertas: Remove unused exports

Sebastian Siewior (1):
gelic wireless driver needs WIRELESS_EXT support

drivers/net/Kconfig | 1 +
drivers/net/ps3_gelic_wireless.c | 1 +
drivers/net/wireless/b43/Kconfig | 1 +
drivers/net/wireless/b43legacy/Kconfig | 1 +
drivers/net/wireless/bcm43xx/Kconfig | 2 +-
drivers/net/wireless/libertas/cmd.c | 2 -
drivers/net/wireless/libertas/decl.h | 1 -
drivers/net/wireless/libertas/main.c | 17 -------
drivers/net/wireless/rndis_wlan.c | 14 +++---
drivers/net/wireless/rt2x00/rt2400pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt2500pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt2500usb.c | 6 ++-
drivers/net/wireless/rt2x00/rt2x00config.c | 8 ++-
drivers/net/wireless/rt2x00/rt2x00dev.c | 73 ++++++++++++++-------------
drivers/net/wireless/rt2x00/rt2x00reg.h | 2 +
drivers/net/wireless/rt2x00/rt61pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt73usb.c | 6 ++-
drivers/ssb/Kconfig | 5 ++
drivers/ssb/Makefile | 2 +-
drivers/ssb/ssb_private.h | 4 +-
include/linux/mod_devicetable.h | 8 +++-
net/mac80211/ieee80211_sta.c | 7 ++-
22 files changed, 102 insertions(+), 77 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a20e72f..a0f0e60 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2368,6 +2368,7 @@ config GELIC_NET
config GELIC_WIRELESS
bool "PS3 Wireless support"
depends on GELIC_NET
+ select WIRELESS_EXT
help
This option adds the support for the wireless feature of PS3.
If you have the wireless-less model of PS3 or have no plan to
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 750d2a9..daf5aba 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2690,6 +2690,7 @@ int gelic_wl_driver_probe(struct gelic_card *card)
return -ENOMEM;

/* setup net_device structure */
+ SET_NETDEV_DEV(netdev, &card->dev->core);
gelic_wl_setup_netdev_ops(netdev);

/* setup some of net_device and register it */
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 1a2141d..8bc4bc4 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -32,6 +32,7 @@ config B43_PCI_AUTOSELECT
bool
depends on B43 && SSB_PCIHOST_POSSIBLE
select SSB_PCIHOST
+ select SSB_B43_PCI_BRIDGE
default y

# Auto-select SSB PCICORE driver, if possible
diff --git a/drivers/net/wireless/b43legacy/Kconfig b/drivers/net/wireless/b43legacy/Kconfig
index 6745579..13c65fa 100644
--- a/drivers/net/wireless/b43legacy/Kconfig
+++ b/drivers/net/wireless/b43legacy/Kconfig
@@ -25,6 +25,7 @@ config B43LEGACY_PCI_AUTOSELECT
bool
depends on B43LEGACY && SSB_PCIHOST_POSSIBLE
select SSB_PCIHOST
+ select SSB_B43_PCI_BRIDGE
default y

# Auto-select SSB PCICORE driver, if possible
diff --git a/drivers/net/wireless/bcm43xx/Kconfig b/drivers/net/wireless/bcm43xx/Kconfig
index 0159701..afb8f43 100644
--- a/drivers/net/wireless/bcm43xx/Kconfig
+++ b/drivers/net/wireless/bcm43xx/Kconfig
@@ -1,6 +1,6 @@
config BCM43XX
tristate "Broadcom BCM43xx wireless support (DEPRECATED)"
- depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && EXPERIMENTAL
+ depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && (!SSB_B43_PCI_BRIDGE || SSB != y) && EXPERIMENTAL
select WIRELESS_EXT
select FW_LOADER
select HW_RANDOM
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index eab0203..b3c1acb 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1040,7 +1040,6 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
lbs_deb_leave(LBS_DEB_CMD);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_mesh_access);

int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan)
{
@@ -1576,7 +1575,6 @@ done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_prepare_and_send_command);

/**
* @brief This function allocates the command buffer and link
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index aaacd9b..4e22341 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -69,7 +69,6 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev);
int lbs_remove_card(struct lbs_private *priv);
int lbs_start_card(struct lbs_private *priv);
int lbs_stop_card(struct lbs_private *priv);
-int lbs_reset_device(struct lbs_private *priv);
void lbs_host_to_card_done(struct lbs_private *priv);

int lbs_update_channel(struct lbs_private *priv);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 84fb49c..4d4e2f3 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1351,8 +1351,6 @@ done:
lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_add_mesh);
-

static void lbs_remove_mesh(struct lbs_private *priv)
{
@@ -1372,7 +1370,6 @@ static void lbs_remove_mesh(struct lbs_private *priv)
free_netdev(mesh_dev);
lbs_deb_leave(LBS_DEB_MESH);
}
-EXPORT_SYMBOL_GPL(lbs_remove_mesh);

/**
* @brief This function finds the CFP in
@@ -1458,20 +1455,6 @@ void lbs_interrupt(struct lbs_private *priv)
}
EXPORT_SYMBOL_GPL(lbs_interrupt);

-int lbs_reset_device(struct lbs_private *priv)
-{
- int ret;
-
- lbs_deb_enter(LBS_DEB_MAIN);
- ret = lbs_prepare_and_send_command(priv, CMD_802_11_RESET,
- CMD_ACT_HALT, 0, 0, NULL);
- msleep_interruptible(10);
-
- lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
- return ret;
-}
-EXPORT_SYMBOL_GPL(lbs_reset_device);
-
static int __init lbs_init_module(void)
{
lbs_deb_enter(LBS_DEB_MAIN);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 8ce2ddf..d9460ae 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -228,9 +228,9 @@ struct NDIS_WLAN_BSSID_EX {
struct NDIS_802_11_SSID Ssid;
__le32 Privacy;
__le32 Rssi;
- enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
+ __le32 NetworkTypeInUse;
struct NDIS_802_11_CONFIGURATION Configuration;
- enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
+ __le32 InfrastructureMode;
u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
__le32 IELength;
u8 IEs[0];
@@ -279,11 +279,11 @@ struct RNDIS_CONFIG_PARAMETER_INFOBUFFER {
} __attribute__((packed));

/* these have to match what is in wpa_supplicant */
-enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
-enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP, CIPHER_WEP104 }
- wpa_cipher;
-enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE, KEY_MGMT_802_1X_NO_WPA,
- KEY_MGMT_WPA_NONE } wpa_key_mgmt;
+enum wpa_alg { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP };
+enum wpa_cipher { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
+ CIPHER_WEP104 };
+enum wpa_key_mgmt { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
+ KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE };

/*
* private data
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index d6cba13..c69f85e 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -960,8 +960,12 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2400pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2400pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index e874fdc..91e87b5 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1112,8 +1112,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2500pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2500pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 4ca9730..638c3d2 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1001,8 +1001,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2500usb_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2500usb_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 72cfe00..07adc57 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -97,12 +97,16 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
libconf.ant.rx = rx;
libconf.ant.tx = tx;

+ if (rx == rt2x00dev->link.ant.active.rx &&
+ tx == rt2x00dev->link.ant.active.tx)
+ return;
+
/*
* Antenna setup changes require the RX to be disabled,
* else the changes will be ignored by the device.
*/
if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK);

/*
* Write new antenna setup to device and reset the link tuner.
@@ -116,7 +120,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
rt2x00dev->link.ant.active.tx = libconf.ant.tx;

if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
}

void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index c4be2ac..0d51f47 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -61,11 +61,33 @@ EXPORT_SYMBOL_GPL(rt2x00lib_get_ring);
/*
* Link tuning handlers
*/
-static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
+void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
{
+ if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
+ return;
+
+ /*
+ * Reset link information.
+ * Both the currently active vgc level as well as
+ * the link tuner counter should be reset. Resetting
+ * the counter is important for devices where the
+ * device should only perform link tuning during the
+ * first minute after being enabled.
+ */
rt2x00dev->link.count = 0;
rt2x00dev->link.vgc_level = 0;

+ /*
+ * Reset the link tuner.
+ */
+ rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
+}
+
+static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
+{
+ /*
+ * Clear all (possibly) pre-existing quality statistics.
+ */
memset(&rt2x00dev->link.qual, 0, sizeof(rt2x00dev->link.qual));

/*
@@ -79,10 +101,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
rt2x00dev->link.qual.rx_percentage = 50;
rt2x00dev->link.qual.tx_percentage = 50;

- /*
- * Reset the link tuner.
- */
- rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
+ rt2x00lib_reset_link_tuner(rt2x00dev);

queue_delayed_work(rt2x00dev->hw->workqueue,
&rt2x00dev->link.work, LINK_TUNE_INTERVAL);
@@ -93,15 +112,6 @@ static void rt2x00lib_stop_link_tuner(struct rt2x00_dev *rt2x00dev)
cancel_delayed_work_sync(&rt2x00dev->link.work);
}

-void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
-{
- if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- return;
-
- rt2x00lib_stop_link_tuner(rt2x00dev);
- rt2x00lib_start_link_tuner(rt2x00dev);
-}
-
/*
* Ring initialization
*/
@@ -260,19 +270,11 @@ static void rt2x00lib_evaluate_antenna_sample(struct rt2x00_dev *rt2x00dev)
if (sample_a == sample_b)
return;

- if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) {
- if (sample_a > sample_b && rx == ANTENNA_B)
- rx = ANTENNA_A;
- else if (rx == ANTENNA_A)
- rx = ANTENNA_B;
- }
+ if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY)
+ rx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

- if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY) {
- if (sample_a > sample_b && tx == ANTENNA_B)
- tx = ANTENNA_A;
- else if (tx == ANTENNA_A)
- tx = ANTENNA_B;
- }
+ if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)
+ tx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

rt2x00lib_config_antenna(rt2x00dev, rx, tx);
}
@@ -293,7 +295,7 @@ static void rt2x00lib_evaluate_antenna_eval(struct rt2x00_dev *rt2x00dev)
* sample the rssi from the other antenna to make a valid
* comparison between the 2 antennas.
*/
- if ((rssi_curr - rssi_old) > -5 || (rssi_curr - rssi_old) < 5)
+ if (abs(rssi_curr - rssi_old) < 5)
return;

rt2x00dev->link.ant.flags |= ANTENNA_MODE_SAMPLE;
@@ -319,15 +321,15 @@ static void rt2x00lib_evaluate_antenna(struct rt2x00_dev *rt2x00dev)
rt2x00dev->link.ant.flags &= ~ANTENNA_TX_DIVERSITY;

if (rt2x00dev->hw->conf.antenna_sel_rx == 0 &&
- rt2x00dev->default_ant.rx != ANTENNA_SW_DIVERSITY)
+ rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
rt2x00dev->link.ant.flags |= ANTENNA_RX_DIVERSITY;
if (rt2x00dev->hw->conf.antenna_sel_tx == 0 &&
- rt2x00dev->default_ant.tx != ANTENNA_SW_DIVERSITY)
+ rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
rt2x00dev->link.ant.flags |= ANTENNA_TX_DIVERSITY;

if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&
!(rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)) {
- rt2x00dev->link.ant.flags &= ~ANTENNA_MODE_SAMPLE;
+ rt2x00dev->link.ant.flags = 0;
return;
}

@@ -441,17 +443,18 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
rt2x00dev->ops->lib->link_tuner(rt2x00dev);

/*
- * Evaluate antenna setup.
- */
- rt2x00lib_evaluate_antenna(rt2x00dev);
-
- /*
* Precalculate a portion of the link signal which is
* in based on the tx/rx success/failure counters.
*/
rt2x00lib_precalculate_link_signal(&rt2x00dev->link.qual);

/*
+ * Evaluate antenna setup, make this the last step since this could
+ * possibly reset some statistics.
+ */
+ rt2x00lib_evaluate_antenna(rt2x00dev);
+
+ /*
* Increase tuner counter, and reschedule the next link tuner run.
*/
rt2x00dev->link.count++;
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index 8384212..b1915dc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -85,6 +85,8 @@ enum dev_state {
STATE_RADIO_OFF,
STATE_RADIO_RX_ON,
STATE_RADIO_RX_OFF,
+ STATE_RADIO_RX_ON_LINK,
+ STATE_RADIO_RX_OFF_LINK,
STATE_RADIO_IRQ_ON,
STATE_RADIO_IRQ_OFF,
};
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index b31f0c2..e808db9 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1482,8 +1482,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt61pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt61pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4d576ab..4fac2d4 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1208,8 +1208,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
rt73usb_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt73usb_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index 78fd331..adea792 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -35,6 +35,11 @@ config SSB_PCIHOST

If unsure, say Y

+config SSB_B43_PCI_BRIDGE
+ bool
+ depends on SSB_PCIHOST
+ default n
+
config SSB_PCMCIAHOST_POSSIBLE
bool
depends on SSB && (PCMCIA = y || PCMCIA = SSB) && EXPERIMENTAL
diff --git a/drivers/ssb/Makefile b/drivers/ssb/Makefile
index e235144..de94c2e 100644
--- a/drivers/ssb/Makefile
+++ b/drivers/ssb/Makefile
@@ -14,6 +14,6 @@ ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o

# b43 pci-ssb-bridge driver
# Not strictly a part of SSB, but kept here for convenience
-ssb-$(CONFIG_SSB_PCIHOST) += b43_pci_bridge.o
+ssb-$(CONFIG_SSB_B43_PCI_BRIDGE) += b43_pci_bridge.o

obj-$(CONFIG_SSB) += ssb.o
diff --git a/drivers/ssb/ssb_private.h b/drivers/ssb/ssb_private.h
index a789364..21eca2b 100644
--- a/drivers/ssb/ssb_private.h
+++ b/drivers/ssb/ssb_private.h
@@ -120,10 +120,10 @@ extern int ssb_devices_thaw(struct ssb_bus *bus);
extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev);

/* b43_pci_bridge.c */
-#ifdef CONFIG_SSB_PCIHOST
+#ifdef CONFIG_SSB_B43_PCI_BRIDGE
extern int __init b43_pci_ssb_bridge_init(void);
extern void __exit b43_pci_ssb_bridge_exit(void);
-#else /* CONFIG_SSB_PCIHOST */
+#else /* CONFIG_SSB_B43_PCI_BRIDGR */
static inline int b43_pci_ssb_bridge_init(void)
{
return 0;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 139d49d..fd217ae 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -351,7 +351,13 @@ struct sdio_device_id {
struct ssb_device_id {
__u16 vendor;
__u16 coreid;
- __u8 revision;
+ /* Explicit padding to support a broken sanity check in file2alias.c.
+ * The check compares the size of the structure in the kernel
+ * object file to the size of the structure reported in userspace for
+ * the system on which the kernel is compiled. The check breaks on
+ * cross-compilation, and the padding is a workaround for this. */
+ __u8 revision
+ __attribute__((aligned(sizeof(__u32))));
};
#define SSB_DEVICE(_vendor, _coreid, _revision) \
{ .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 2019b4f..9aeed53 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1116,9 +1116,10 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
/* prepare reordering buffer */
tid_agg_rx->reorder_buf =
kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);
- if ((!tid_agg_rx->reorder_buf) && net_ratelimit()) {
- printk(KERN_ERR "can not allocate reordering buffer "
- "to tid %d\n", tid);
+ if (!tid_agg_rx->reorder_buf) {
+ if (net_ratelimit())
+ printk(KERN_ERR "can not allocate reordering buffer "
+ "to tid %d\n", tid);
goto end;
}
memset(tid_agg_rx->reorder_buf, 0,
--
John W. Linville
[email protected]


2008-02-29 19:34:08

by John W. Linville

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Fri, Feb 29, 2008 at 05:34:13PM +0100, Johannes Berg wrote:
>
> On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> >
> > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> >
> > Sounds reasonable to me.
>
> In fact, file2alias shouldn't need a command line argument ...
>
> > > in that case. Is there any easy and reliable way to find out whether we
> > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> >
> > Non-empty CROSS_COMPILE definition?
>
> ... it can just check whether CROSS_COMPILE is set in its environment.
> No?

Not a bad idea...something like this?

---

modpost: avoid user/kernel struct size compat check if cross-compiling

Signed-off-by: John W. Linville <[email protected]>
---
scripts/mod/file2alias.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9ddf944..040721e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -10,6 +10,7 @@
* of the GNU General Public License, incorporated herein by reference.
*/

+#include <stdlib.h>
#include "modpost.h"

/* We use the ELF typedefs for kernel_ulong_t but bite the bullet and
@@ -63,6 +64,12 @@ static void device_id_check(const char *modname, const char *device_id,
{
int i;

+ if (getenv("CROSS_COMPILE")) {
+ warn("%s: cross-compile can not verify userspace/kernel "
+ "structure size compatibility.\n", modname);
+ return;
+ }
+
if (size % id_size || size < id_size) {
fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
"of the size of section __mod_%s_device_table=%lu.\n"
--
1.5.3.3

--
John W. Linville
[email protected]

2008-02-29 19:54:45

by Johannes Berg

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27


> > ... it can just check whether CROSS_COMPILE is set in its environment.
> > No?
>
> Not a bad idea...something like this?

*shrug* I don't even know what the thread is about :) Just
interfering ;)

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2008-02-28 23:56:53

by Gordon Farquharson

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

Hi David

On Thu, Feb 28, 2008 at 2:30 PM, David Miller <[email protected]> wrote:
> Feel free to push that via Andrew or someone else, but that turd isn't
> going in by my tree because to me it's clearly the wrong thing to do.

Would you support the idea, put forward by Matthieu Castet on LKML, to
change the test in file2alias such that it issues a warning as opposed
to an error?

Gordon

--
Gordon Farquharson
GnuPG Key ID: 32D6D676

2008-02-29 12:17:26

by Michael Büsch

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Thursday 28 February 2008 22:30:08 David Miller wrote:
> From: "Gordon Farquharson" <[email protected]>
> Date: Thu, 28 Feb 2008 14:21:21 -0700
>
> > Hi David
> >
> > On Thu, Feb 28, 2008 at 12:51 AM, David Miller <[email protected]> wrote:
> > > From: "John W. Linville" <[email protected]>
> > > Date: Wed, 27 Feb 2008 20:41:25 -0500
> > >
> > >
> > > > Gordon Farquharson (1):
> > > > Fix b43 driver build for arm
> > >
> > > Please revert this change and resend your pull request.
> > >
> > > If file2alias doesn't work properly in a cross build environment, we
> > > don't fix it by crapping up mod_devalias.h with these silly align
> > > attribute annotations.
> >
> > This was extensively discussed on LKML [1, 2] and the patch has been
> > merged into Andrew Morton's -mm tree. It is understood that this is
> > not the Right Way to fix to problem, hence the big fat comment in the
> > code. It would be great if you could reconsider your decision.
>
> If you put that thing in there now, on ARM the structure size changes
> as does the alignment of that final member.
>
> Then we're stuck with it and you can't remove that hack from
> mod_devalias.h. It can't be removed even after the cross build issues
> of file2alias are resolved properly without re-breaking ARM.
>
> Feel free to push that via Andrew or someone else, but that turd isn't
> going in by my tree because to me it's clearly the wrong thing to do.

I didn't even think of this being an actual ABI issue when _removing_
it again. So you get another NACK from me for this patch. :)

I'm wondering if we can't simply pass a commandline parameter to file2alias
that tells it whether we are crosscompiling. It should simply omit the sanity check
in that case. Is there any easy and reliable way to find out whether we
are crosscompiling from a makefile (I don't know the makefile core that much)?

Andrew, can you please drop it? We need to fix this differently. No matter how.

--
Greetings Michael.

2008-02-29 22:06:06

by John W. Linville

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Fri, Feb 29, 2008 at 02:10:58PM -0500, John W. Linville wrote:
> On Fri, Feb 29, 2008 at 05:34:13PM +0100, Johannes Berg wrote:
> >
> > On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> > >
> > > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> > >
> > > Sounds reasonable to me.
> >
> > In fact, file2alias shouldn't need a command line argument ...
> >
> > > > in that case. Is there any easy and reliable way to find out whether we
> > > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> > >
> > > Non-empty CROSS_COMPILE definition?
> >
> > ... it can just check whether CROSS_COMPILE is set in its environment.
> > No?
>
> Not a bad idea...something like this?

That version didn't work -- it seems CROSS_COMPILE is always set,
even if it is empty.

This version seems to work, but it is a bit chatty when CROSS_COMPILE
is set and you build lots of modules...thoughts?

John

---

modpost: avoid user/kernel struct size compat check if cross-compiling

Signed-off-by: John W. Linville <[email protected]>
---
scripts/mod/file2alias.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9ddf944..37f311e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -10,6 +10,7 @@
* of the GNU General Public License, incorporated herein by reference.
*/

+#include <stdlib.h>
#include "modpost.h"

/* We use the ELF typedefs for kernel_ulong_t but bite the bullet and
@@ -62,6 +63,14 @@ static void device_id_check(const char *modname, const char *device_id,
void *symval)
{
int i;
+ char *cross_compile;
+
+ cross_compile = getenv("CROSS_COMPILE");
+ if (cross_compile && strlen(cross_compile)) {
+ warn("%s: cross-compile cannot verify userspace/kernel "
+ "structure size compatibility.\n", modname);
+ return;
+ }

if (size % id_size || size < id_size) {
fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
--
1.5.3.3

--
John W. Linville
[email protected]

2008-02-28 21:21:22

by Gordon Farquharson

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

Hi David

On Thu, Feb 28, 2008 at 12:51 AM, David Miller <[email protected]> wrote:
> From: "John W. Linville" <[email protected]>
> Date: Wed, 27 Feb 2008 20:41:25 -0500
>
>
> > Gordon Farquharson (1):
> > Fix b43 driver build for arm
>
> Please revert this change and resend your pull request.
>
> If file2alias doesn't work properly in a cross build environment, we
> don't fix it by crapping up mod_devalias.h with these silly align
> attribute annotations.

This was extensively discussed on LKML [1, 2] and the patch has been
merged into Andrew Morton's -mm tree. It is understood that this is
not the Right Way to fix to problem, hence the big fat comment in the
code. It would be great if you could reconsider your decision.

Thanks.

Gordon

[1] http://groups.google.com/group/linux.kernel/browse_thread/thread/0013ccdcfce3feaa/608657870eb62a12?#608657870eb62a12
[2] http://groups.google.com/group/linux.kernel/browse_thread/thread/13ccdcfce3feaa/a37a5fcbb6431eb0?lnk=gst&q=Fix+b43+driver+build+for+arm#a37a5fcbb6431eb0

--
Gordon Farquharson
GnuPG Key ID: 32D6D676

2008-02-28 15:02:28

by John W. Linville

[permalink] [raw]
Subject: pull request: wireless-2.6 2008-02-28

On Wed, Feb 27, 2008 at 11:51:10PM -0800, David Miller wrote:
> From: "John W. Linville" <[email protected]>
> Date: Wed, 27 Feb 2008 20:41:25 -0500
>
> > Gordon Farquharson (1):
> > Fix b43 driver build for arm
>
> Please revert this change and resend your pull request.
>
> If file2alias doesn't work properly in a cross build environment, we
> don't fix it by crapping up mod_devalias.h with these silly align
> attribute annotations.

As you wish... :-)

---

This version drops the "Fix b43 drivers build for arm" patch, and adds a
one-line build fix for SSB-attached PCI cores (found on bcm47xx mips).

Dave,

Here are some fixes intended for 2.6.25. Please let me know if there
are problems!

Thanks,

John

P.S. This will create a merge conflict with the code I already
requested that you pull for net-2.6.26. The merge is easily resolved,
since it is two "comment block + single statement" additions at the
same place in the file. Just take both sets of changes, and order
the "Evalue antenna setup" group _after_ the "Send a signal to the
led" group. I have the conflict corrected in my wireless-testing
tree for reference if you need it.

---

Individual patches are available here:

http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit d9595a7b9c777d45a74774f1428c263a0a47f4c0:
David S. Miller (1):
[AF_KEY]: Fix oops by converting to proc_net_*().

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Alexey Zaytsev (2):
Use a separate config option for the b43 pci to ssb bridge.
Don't build bcm43xx if SSB is static and b43 PCI-SSB bridge is enabled.

Aurelien Jarno (1):
SSB PCI core driver: use new SPROM data structure

Ivo van Doorn (4):
rt2x00: Fix antenna diversity
rt2x00: Add link tuner safe RX toggle states
rt2x00: Don't switch to antenna with low rssi
rt2x00: Fix rt2x00lib_reset_link_tuner()

Johannes Berg (2):
rndis_wlan: fix sparse warnings
mac80211: fix kmalloc vs. net_ratelimit

Masakazu Mokuno (1):
PS3: gelic: Link the wireless net_device structure to the corresponding device structure

Roland Dreier (1):
libertas: Remove unused exports

Sebastian Siewior (1):
gelic wireless driver needs WIRELESS_EXT support

drivers/net/Kconfig | 1 +
drivers/net/ps3_gelic_wireless.c | 1 +
drivers/net/wireless/b43/Kconfig | 1 +
drivers/net/wireless/b43legacy/Kconfig | 1 +
drivers/net/wireless/bcm43xx/Kconfig | 2 +-
drivers/net/wireless/libertas/cmd.c | 2 -
drivers/net/wireless/libertas/decl.h | 1 -
drivers/net/wireless/libertas/main.c | 17 -------
drivers/net/wireless/rndis_wlan.c | 14 +++---
drivers/net/wireless/rt2x00/rt2400pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt2500pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt2500usb.c | 6 ++-
drivers/net/wireless/rt2x00/rt2x00config.c | 8 ++-
drivers/net/wireless/rt2x00/rt2x00dev.c | 73 ++++++++++++++-------------
drivers/net/wireless/rt2x00/rt2x00reg.h | 2 +
drivers/net/wireless/rt2x00/rt61pci.c | 6 ++-
drivers/net/wireless/rt2x00/rt73usb.c | 6 ++-
drivers/ssb/Kconfig | 5 ++
drivers/ssb/Makefile | 2 +-
drivers/ssb/driver_pcicore.c | 2 +-
drivers/ssb/ssb_private.h | 4 +-
net/mac80211/ieee80211_sta.c | 7 ++-
22 files changed, 96 insertions(+), 77 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a20e72f..a0f0e60 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2368,6 +2368,7 @@ config GELIC_NET
config GELIC_WIRELESS
bool "PS3 Wireless support"
depends on GELIC_NET
+ select WIRELESS_EXT
help
This option adds the support for the wireless feature of PS3.
If you have the wireless-less model of PS3 or have no plan to
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 750d2a9..daf5aba 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2690,6 +2690,7 @@ int gelic_wl_driver_probe(struct gelic_card *card)
return -ENOMEM;

/* setup net_device structure */
+ SET_NETDEV_DEV(netdev, &card->dev->core);
gelic_wl_setup_netdev_ops(netdev);

/* setup some of net_device and register it */
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 1a2141d..8bc4bc4 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -32,6 +32,7 @@ config B43_PCI_AUTOSELECT
bool
depends on B43 && SSB_PCIHOST_POSSIBLE
select SSB_PCIHOST
+ select SSB_B43_PCI_BRIDGE
default y

# Auto-select SSB PCICORE driver, if possible
diff --git a/drivers/net/wireless/b43legacy/Kconfig b/drivers/net/wireless/b43legacy/Kconfig
index 6745579..13c65fa 100644
--- a/drivers/net/wireless/b43legacy/Kconfig
+++ b/drivers/net/wireless/b43legacy/Kconfig
@@ -25,6 +25,7 @@ config B43LEGACY_PCI_AUTOSELECT
bool
depends on B43LEGACY && SSB_PCIHOST_POSSIBLE
select SSB_PCIHOST
+ select SSB_B43_PCI_BRIDGE
default y

# Auto-select SSB PCICORE driver, if possible
diff --git a/drivers/net/wireless/bcm43xx/Kconfig b/drivers/net/wireless/bcm43xx/Kconfig
index 0159701..afb8f43 100644
--- a/drivers/net/wireless/bcm43xx/Kconfig
+++ b/drivers/net/wireless/bcm43xx/Kconfig
@@ -1,6 +1,6 @@
config BCM43XX
tristate "Broadcom BCM43xx wireless support (DEPRECATED)"
- depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && EXPERIMENTAL
+ depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && (!SSB_B43_PCI_BRIDGE || SSB != y) && EXPERIMENTAL
select WIRELESS_EXT
select FW_LOADER
select HW_RANDOM
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index eab0203..b3c1acb 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1040,7 +1040,6 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
lbs_deb_leave(LBS_DEB_CMD);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_mesh_access);

int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan)
{
@@ -1576,7 +1575,6 @@ done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_prepare_and_send_command);

/**
* @brief This function allocates the command buffer and link
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index aaacd9b..4e22341 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -69,7 +69,6 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev);
int lbs_remove_card(struct lbs_private *priv);
int lbs_start_card(struct lbs_private *priv);
int lbs_stop_card(struct lbs_private *priv);
-int lbs_reset_device(struct lbs_private *priv);
void lbs_host_to_card_done(struct lbs_private *priv);

int lbs_update_channel(struct lbs_private *priv);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 84fb49c..4d4e2f3 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1351,8 +1351,6 @@ done:
lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
return ret;
}
-EXPORT_SYMBOL_GPL(lbs_add_mesh);
-

static void lbs_remove_mesh(struct lbs_private *priv)
{
@@ -1372,7 +1370,6 @@ static void lbs_remove_mesh(struct lbs_private *priv)
free_netdev(mesh_dev);
lbs_deb_leave(LBS_DEB_MESH);
}
-EXPORT_SYMBOL_GPL(lbs_remove_mesh);

/**
* @brief This function finds the CFP in
@@ -1458,20 +1455,6 @@ void lbs_interrupt(struct lbs_private *priv)
}
EXPORT_SYMBOL_GPL(lbs_interrupt);

-int lbs_reset_device(struct lbs_private *priv)
-{
- int ret;
-
- lbs_deb_enter(LBS_DEB_MAIN);
- ret = lbs_prepare_and_send_command(priv, CMD_802_11_RESET,
- CMD_ACT_HALT, 0, 0, NULL);
- msleep_interruptible(10);
-
- lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
- return ret;
-}
-EXPORT_SYMBOL_GPL(lbs_reset_device);
-
static int __init lbs_init_module(void)
{
lbs_deb_enter(LBS_DEB_MAIN);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 8ce2ddf..d9460ae 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -228,9 +228,9 @@ struct NDIS_WLAN_BSSID_EX {
struct NDIS_802_11_SSID Ssid;
__le32 Privacy;
__le32 Rssi;
- enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
+ __le32 NetworkTypeInUse;
struct NDIS_802_11_CONFIGURATION Configuration;
- enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
+ __le32 InfrastructureMode;
u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
__le32 IELength;
u8 IEs[0];
@@ -279,11 +279,11 @@ struct RNDIS_CONFIG_PARAMETER_INFOBUFFER {
} __attribute__((packed));

/* these have to match what is in wpa_supplicant */
-enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
-enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP, CIPHER_WEP104 }
- wpa_cipher;
-enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE, KEY_MGMT_802_1X_NO_WPA,
- KEY_MGMT_WPA_NONE } wpa_key_mgmt;
+enum wpa_alg { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP };
+enum wpa_cipher { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
+ CIPHER_WEP104 };
+enum wpa_key_mgmt { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
+ KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE };

/*
* private data
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index d6cba13..c69f85e 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -960,8 +960,12 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2400pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2400pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index e874fdc..91e87b5 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1112,8 +1112,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2500pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2500pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 4ca9730..638c3d2 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1001,8 +1001,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
rt2500usb_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt2500usb_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 72cfe00..07adc57 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -97,12 +97,16 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
libconf.ant.rx = rx;
libconf.ant.tx = tx;

+ if (rx == rt2x00dev->link.ant.active.rx &&
+ tx == rt2x00dev->link.ant.active.tx)
+ return;
+
/*
* Antenna setup changes require the RX to be disabled,
* else the changes will be ignored by the device.
*/
if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK);

/*
* Write new antenna setup to device and reset the link tuner.
@@ -116,7 +120,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
rt2x00dev->link.ant.active.tx = libconf.ant.tx;

if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
}

void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index c4be2ac..0d51f47 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -61,11 +61,33 @@ EXPORT_SYMBOL_GPL(rt2x00lib_get_ring);
/*
* Link tuning handlers
*/
-static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
+void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
{
+ if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
+ return;
+
+ /*
+ * Reset link information.
+ * Both the currently active vgc level as well as
+ * the link tuner counter should be reset. Resetting
+ * the counter is important for devices where the
+ * device should only perform link tuning during the
+ * first minute after being enabled.
+ */
rt2x00dev->link.count = 0;
rt2x00dev->link.vgc_level = 0;

+ /*
+ * Reset the link tuner.
+ */
+ rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
+}
+
+static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
+{
+ /*
+ * Clear all (possibly) pre-existing quality statistics.
+ */
memset(&rt2x00dev->link.qual, 0, sizeof(rt2x00dev->link.qual));

/*
@@ -79,10 +101,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
rt2x00dev->link.qual.rx_percentage = 50;
rt2x00dev->link.qual.tx_percentage = 50;

- /*
- * Reset the link tuner.
- */
- rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
+ rt2x00lib_reset_link_tuner(rt2x00dev);

queue_delayed_work(rt2x00dev->hw->workqueue,
&rt2x00dev->link.work, LINK_TUNE_INTERVAL);
@@ -93,15 +112,6 @@ static void rt2x00lib_stop_link_tuner(struct rt2x00_dev *rt2x00dev)
cancel_delayed_work_sync(&rt2x00dev->link.work);
}

-void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
-{
- if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- return;
-
- rt2x00lib_stop_link_tuner(rt2x00dev);
- rt2x00lib_start_link_tuner(rt2x00dev);
-}
-
/*
* Ring initialization
*/
@@ -260,19 +270,11 @@ static void rt2x00lib_evaluate_antenna_sample(struct rt2x00_dev *rt2x00dev)
if (sample_a == sample_b)
return;

- if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) {
- if (sample_a > sample_b && rx == ANTENNA_B)
- rx = ANTENNA_A;
- else if (rx == ANTENNA_A)
- rx = ANTENNA_B;
- }
+ if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY)
+ rx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

- if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY) {
- if (sample_a > sample_b && tx == ANTENNA_B)
- tx = ANTENNA_A;
- else if (tx == ANTENNA_A)
- tx = ANTENNA_B;
- }
+ if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)
+ tx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

rt2x00lib_config_antenna(rt2x00dev, rx, tx);
}
@@ -293,7 +295,7 @@ static void rt2x00lib_evaluate_antenna_eval(struct rt2x00_dev *rt2x00dev)
* sample the rssi from the other antenna to make a valid
* comparison between the 2 antennas.
*/
- if ((rssi_curr - rssi_old) > -5 || (rssi_curr - rssi_old) < 5)
+ if (abs(rssi_curr - rssi_old) < 5)
return;

rt2x00dev->link.ant.flags |= ANTENNA_MODE_SAMPLE;
@@ -319,15 +321,15 @@ static void rt2x00lib_evaluate_antenna(struct rt2x00_dev *rt2x00dev)
rt2x00dev->link.ant.flags &= ~ANTENNA_TX_DIVERSITY;

if (rt2x00dev->hw->conf.antenna_sel_rx == 0 &&
- rt2x00dev->default_ant.rx != ANTENNA_SW_DIVERSITY)
+ rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY)
rt2x00dev->link.ant.flags |= ANTENNA_RX_DIVERSITY;
if (rt2x00dev->hw->conf.antenna_sel_tx == 0 &&
- rt2x00dev->default_ant.tx != ANTENNA_SW_DIVERSITY)
+ rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY)
rt2x00dev->link.ant.flags |= ANTENNA_TX_DIVERSITY;

if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&
!(rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)) {
- rt2x00dev->link.ant.flags &= ~ANTENNA_MODE_SAMPLE;
+ rt2x00dev->link.ant.flags = 0;
return;
}

@@ -441,17 +443,18 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
rt2x00dev->ops->lib->link_tuner(rt2x00dev);

/*
- * Evaluate antenna setup.
- */
- rt2x00lib_evaluate_antenna(rt2x00dev);
-
- /*
* Precalculate a portion of the link signal which is
* in based on the tx/rx success/failure counters.
*/
rt2x00lib_precalculate_link_signal(&rt2x00dev->link.qual);

/*
+ * Evaluate antenna setup, make this the last step since this could
+ * possibly reset some statistics.
+ */
+ rt2x00lib_evaluate_antenna(rt2x00dev);
+
+ /*
* Increase tuner counter, and reschedule the next link tuner run.
*/
rt2x00dev->link.count++;
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index 8384212..b1915dc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -85,6 +85,8 @@ enum dev_state {
STATE_RADIO_OFF,
STATE_RADIO_RX_ON,
STATE_RADIO_RX_OFF,
+ STATE_RADIO_RX_ON_LINK,
+ STATE_RADIO_RX_OFF_LINK,
STATE_RADIO_IRQ_ON,
STATE_RADIO_IRQ_OFF,
};
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index b31f0c2..e808db9 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1482,8 +1482,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
rt61pci_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt61pci_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4d576ab..4fac2d4 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1208,8 +1208,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
rt73usb_disable_radio(rt2x00dev);
break;
case STATE_RADIO_RX_ON:
+ case STATE_RADIO_RX_ON_LINK:
+ rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
+ break;
case STATE_RADIO_RX_OFF:
- rt73usb_toggle_rx(rt2x00dev, state);
+ case STATE_RADIO_RX_OFF_LINK:
+ rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
break;
case STATE_DEEP_SLEEP:
case STATE_SLEEP:
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index 78fd331..adea792 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -35,6 +35,11 @@ config SSB_PCIHOST

If unsure, say Y

+config SSB_B43_PCI_BRIDGE
+ bool
+ depends on SSB_PCIHOST
+ default n
+
config SSB_PCMCIAHOST_POSSIBLE
bool
depends on SSB && (PCMCIA = y || PCMCIA = SSB) && EXPERIMENTAL
diff --git a/drivers/ssb/Makefile b/drivers/ssb/Makefile
index e235144..de94c2e 100644
--- a/drivers/ssb/Makefile
+++ b/drivers/ssb/Makefile
@@ -14,6 +14,6 @@ ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o

# b43 pci-ssb-bridge driver
# Not strictly a part of SSB, but kept here for convenience
-ssb-$(CONFIG_SSB_PCIHOST) += b43_pci_bridge.o
+ssb-$(CONFIG_SSB_B43_PCI_BRIDGE) += b43_pci_bridge.o

obj-$(CONFIG_SSB) += ssb.o
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 6d99a98..07ab48d 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -393,7 +393,7 @@ static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
chipid_top != 0x5300)
return 0;

- if (bus->sprom.r1.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
+ if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
return 0;

/* The 200-pin BCM4712 package does not bond out PCI. Even when
diff --git a/drivers/ssb/ssb_private.h b/drivers/ssb/ssb_private.h
index a789364..21eca2b 100644
--- a/drivers/ssb/ssb_private.h
+++ b/drivers/ssb/ssb_private.h
@@ -120,10 +120,10 @@ extern int ssb_devices_thaw(struct ssb_bus *bus);
extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev);

/* b43_pci_bridge.c */
-#ifdef CONFIG_SSB_PCIHOST
+#ifdef CONFIG_SSB_B43_PCI_BRIDGE
extern int __init b43_pci_ssb_bridge_init(void);
extern void __exit b43_pci_ssb_bridge_exit(void);
-#else /* CONFIG_SSB_PCIHOST */
+#else /* CONFIG_SSB_B43_PCI_BRIDGR */
static inline int b43_pci_ssb_bridge_init(void)
{
return 0;
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 2019b4f..9aeed53 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1116,9 +1116,10 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
/* prepare reordering buffer */
tid_agg_rx->reorder_buf =
kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);
- if ((!tid_agg_rx->reorder_buf) && net_ratelimit()) {
- printk(KERN_ERR "can not allocate reordering buffer "
- "to tid %d\n", tid);
+ if (!tid_agg_rx->reorder_buf) {
+ if (net_ratelimit())
+ printk(KERN_ERR "can not allocate reordering buffer "
+ "to tid %d\n", tid);
goto end;
}
memset(tid_agg_rx->reorder_buf, 0,
--
John W. Linville
[email protected]

2008-02-29 23:54:55

by Randy Dunlap

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Sat, 1 Mar 2008 00:13:11 +0100 Michael Buesch wrote:

> On Friday 29 February 2008 17:34:13 Johannes Berg wrote:
> >
> > On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> > >
> > > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> > >
> > > Sounds reasonable to me.
> >
> > In fact, file2alias shouldn't need a command line argument ...
>
> Well, if...
>
> > > > in that case. Is there any easy and reliable way to find out whether we
> > > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> > >
> > > Non-empty CROSS_COMPILE definition?
> >
> > ... it can just check whether CROSS_COMPILE is set in its environment.
> > No?
>
> Is that exported to the environment?

Certainly, in top-level Makefile:

export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS


---
~Randy

2008-02-29 00:15:25

by David Miller

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

From: "Gordon Farquharson" <[email protected]>
Date: Thu, 28 Feb 2008 16:56:52 -0700

> On Thu, Feb 28, 2008 at 2:30 PM, David Miller <[email protected]> wrote:
> > Feel free to push that via Andrew or someone else, but that turd isn't
> > going in by my tree because to me it's clearly the wrong thing to do.
>
> Would you support the idea, put forward by Matthieu Castet on LKML, to
> change the test in file2alias such that it issues a warning as opposed
> to an error?

I'm ambivalent, the only constraint is that you cannot
change the layout and alignment of this struct since it
already appeared in 2.6.24 and therefore tools have
been compiled against the existing way it is defined.

2008-02-29 16:34:30

by Johannes Berg

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27


On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
>
> > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > that tells it whether we are crosscompiling. It should simply omit the sanity check
>
> Sounds reasonable to me.

In fact, file2alias shouldn't need a command line argument ...

> > in that case. Is there any easy and reliable way to find out whether we
> > are crosscompiling from a makefile (I don't know the makefile core that much)?
>
> Non-empty CROSS_COMPILE definition?

... it can just check whether CROSS_COMPILE is set in its environment.
No?

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2008-02-28 07:51:12

by David Miller

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

From: "John W. Linville" <[email protected]>
Date: Wed, 27 Feb 2008 20:41:25 -0500

> Gordon Farquharson (1):
> Fix b43 driver build for arm

Please revert this change and resend your pull request.

If file2alias doesn't work properly in a cross build environment, we
don't fix it by crapping up mod_devalias.h with these silly align
attribute annotations.

Thanks.

2008-02-29 16:32:42

by John W. Linville

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:

> I'm wondering if we can't simply pass a commandline parameter to file2alias
> that tells it whether we are crosscompiling. It should simply omit the sanity check

Sounds reasonable to me.

> in that case. Is there any easy and reliable way to find out whether we
> are crosscompiling from a makefile (I don't know the makefile core that much)?

Non-empty CROSS_COMPILE definition?

John
--
John W. Linville
[email protected]

2008-02-28 21:30:09

by David Miller

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

From: "Gordon Farquharson" <[email protected]>
Date: Thu, 28 Feb 2008 14:21:21 -0700

> Hi David
>
> On Thu, Feb 28, 2008 at 12:51 AM, David Miller <[email protected]> wrote:
> > From: "John W. Linville" <[email protected]>
> > Date: Wed, 27 Feb 2008 20:41:25 -0500
> >
> >
> > > Gordon Farquharson (1):
> > > Fix b43 driver build for arm
> >
> > Please revert this change and resend your pull request.
> >
> > If file2alias doesn't work properly in a cross build environment, we
> > don't fix it by crapping up mod_devalias.h with these silly align
> > attribute annotations.
>
> This was extensively discussed on LKML [1, 2] and the patch has been
> merged into Andrew Morton's -mm tree. It is understood that this is
> not the Right Way to fix to problem, hence the big fat comment in the
> code. It would be great if you could reconsider your decision.

If you put that thing in there now, on ARM the structure size changes
as does the alignment of that final member.

Then we're stuck with it and you can't remove that hack from
mod_devalias.h. It can't be removed even after the cross build issues
of file2alias are resolved properly without re-breaking ARM.

Feel free to push that via Andrew or someone else, but that turd isn't
going in by my tree because to me it's clearly the wrong thing to do.

2008-02-28 19:22:30

by David Miller

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-28

From: "John W. Linville" <[email protected]>
Date: Thu, 28 Feb 2008 09:51:36 -0500

> This version drops the "Fix b43 drivers build for arm" patch, and adds a
> one-line build fix for SSB-attached PCI cores (found on bcm47xx mips).

Thanks.

> P.S. This will create a merge conflict with the code I already
> requested that you pull for net-2.6.26. The merge is easily resolved,
> since it is two "comment block + single statement" additions at the
> same place in the file. Just take both sets of changes, and order
> the "Evalue antenna setup" group _after_ the "Send a signal to the
> led" group. I have the conflict corrected in my wireless-testing
> tree for reference if you need it.

Understood.

> The following changes since commit d9595a7b9c777d45a74774f1428c263a0a47f4c0:
> David S. Miller (1):
> [AF_KEY]: Fix oops by converting to proc_net_*().
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Pulled and pushed back out, thanks John!

2008-02-29 23:14:40

by Michael Büsch

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Friday 29 February 2008 17:34:13 Johannes Berg wrote:
>
> On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> >
> > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> >
> > Sounds reasonable to me.
>
> In fact, file2alias shouldn't need a command line argument ...

Well, if...

> > > in that case. Is there any easy and reliable way to find out whether we
> > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> >
> > Non-empty CROSS_COMPILE definition?
>
> ... it can just check whether CROSS_COMPILE is set in its environment.
> No?

Is that exported to the environment?

--
Greetings Michael.

2008-03-02 11:58:17

by Sam Ravnborg

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Sat, Mar 01, 2008 at 04:51:12PM +0100, Michael Buesch wrote:
> On Saturday 01 March 2008, Sam Ravnborg wrote:
> > > This version seems to work, but it is a bit chatty when CROSS_COMPILE
> > > is set and you build lots of modules...thoughts?
> >
> > We cannot use CROSS_COMPILE to detect a cross build as CROSS_COMPILE
> > is used used to select different gcc versions, cccache etc.
> > The only relaiably way to detect a cross build is to check
> > is ARCH != modified uname -m arch.
> > So this check would have to be done in the top-level Makefile.
> >
> > And that for shaving 6 bytes of a structure..
>
> Wrong. For maintaining userspace ABI compatibility.
NEws to me - that argument I did not see when I posted my previous mail
about possible worarounds.
Find below a patch that detect when we do a cross build and thus ignore
the check.

This is NOT tested as I do not have access to my dev box atm.
I have only tested I could build a i386 kernel.

So please let me know if this works and then I can push it upstrem
hopefully already by tomorrow.

Note: I decided to name the variable KBUILD_BUILDHOST as this is more
descriptive then SUBARCH. We can later clean up the naming and get rid
of SUBARCH but I refrained from this to make the pacht minimal.

Sam

diff --git a/Makefile b/Makefile
index a229784..de28306 100644
--- a/Makefile
+++ b/Makefile
@@ -189,7 +189,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
-
+export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index cfc004e..2d20640 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -58,6 +58,9 @@ modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
# Stop after building .o files if NOFINAL is set. Makes compile tests quicker
_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))

+ifneq ($(KBUILD_BUILDHOST),$(ARCH))
+ cross_build := 1
+endif

# Step 2), invoke modpost
# Includes step 3,4
@@ -70,7 +73,8 @@ modpost = scripts/mod/modpost \
$(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
$(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \
$(if $(CONFIG_MARKERS),-M $(markersfile)) \
- $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
+ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
+ $(if $(cross_build),-c)

quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
cmd_modpost = $(modpost) -s
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9ddf944..348d868 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -51,11 +51,13 @@ do { \
sprintf(str + strlen(str), "*"); \
} while(0)

+unsigned int cross_build = 0;
/**
* Check that sizeof(device_id type) are consistent with size of section
* in .o file. If in-consistent then userspace and kernel does not agree
* on actual size which is a bug.
* Also verify that the final entry in the table is all zeros.
+ * Ignore both checks if build host differ from target host and size differs.
**/
static void device_id_check(const char *modname, const char *device_id,
unsigned long size, unsigned long id_size,
@@ -64,6 +66,8 @@ static void device_id_check(const char *modname, const char *device_id,
int i;

if (size % id_size || size < id_size) {
+ if (cross_build != 0)
+ return;
fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
"of the size of section __mod_%s_device_table=%lu.\n"
"Fix definition of struct %s_device_id "
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 695b5d6..110cf24 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2026,7 +2026,7 @@ int main(int argc, char **argv)
int opt;
int err;

- while ((opt = getopt(argc, argv, "i:I:msSo:awM:K:")) != -1) {
+ while ((opt = getopt(argc, argv, "i:I:cmsSo:awM:K:")) != -1) {
switch (opt) {
case 'i':
kernel_read = optarg;
@@ -2035,6 +2035,9 @@ int main(int argc, char **argv)
module_read = optarg;
external_module = 1;
break;
+ case 'c':
+ cross_build = 1;
+ break;
case 'm':
modversions = 1;
break;
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 565c587..09f58e3 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -135,6 +135,7 @@ struct elf_info {
};

/* file2alias.c */
+extern unsigned int cross_build;
void handle_moddevtable(struct module *mod, struct elf_info *info,
Elf_Sym *sym, const char *symname);
void add_moddevtable(struct buffer *buf, struct module *mod);

2008-03-01 22:59:59

by David Miller

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

From: Sam Ravnborg <[email protected]>
Date: Sat, 1 Mar 2008 14:01:33 +0100

> And that for shaving 6 bytes of a structure..

No, it's for not breaking existing userland binaries out there. We
released 2.6.24 with the existing struct layout, we have to live with
it.

2008-03-02 20:26:28

by Michael Büsch

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Sunday 02 March 2008 21:00:23 Gordon Farquharson wrote:
> Hi Sam
>
> On Sun, Mar 2, 2008 at 4:58 AM, Sam Ravnborg <[email protected]> wrote:
>
> > Find below a patch that detect when we do a cross build and thus ignore
> > the check.
>
> Works for me.
>
> Tested-by: Gordon Farquharson <[email protected]>

The patch looks good. I suggest Andrew pull it for some time into
the -mm tree and then pushes it forward to Linus for 2.6.25.

You can add an Acked-by: Michael Buesch <[email protected]>
although I can not runtime test it here.

--
Greetings Michael.

2008-03-18 04:08:10

by Gordon Farquharson

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

Hi Sam

On Sun, Mar 2, 2008 at 5:58 AM, Sam Ravnborg <[email protected]> wrote:

> So please let me know if this works and then I can push it upstrem
> hopefully already by tomorrow.
>
> Note: I decided to name the variable KBUILD_BUILDHOST as this is more
> descriptive then SUBARCH. We can later clean up the naming and get rid
> of SUBARCH but I refrained from this to make the pacht minimal.

What is the status of this patch? Is there any chance that it will be
included in 2.6.25?

Thanks.

Gordon

--
Gordon Farquharson
GnuPG Key ID: 32D6D676

2008-03-01 13:01:22

by Sam Ravnborg

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Fri, Feb 29, 2008 at 04:42:40PM -0500, John W. Linville wrote:
> On Fri, Feb 29, 2008 at 02:10:58PM -0500, John W. Linville wrote:
> > On Fri, Feb 29, 2008 at 05:34:13PM +0100, Johannes Berg wrote:
> > >
> > > On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > > > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> > > >
> > > > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> > > >
> > > > Sounds reasonable to me.
> > >
> > > In fact, file2alias shouldn't need a command line argument ...
> > >
> > > > > in that case. Is there any easy and reliable way to find out whether we
> > > > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> > > >
> > > > Non-empty CROSS_COMPILE definition?
> > >
> > > ... it can just check whether CROSS_COMPILE is set in its environment.
> > > No?
> >
> > Not a bad idea...something like this?
>
> That version didn't work -- it seems CROSS_COMPILE is always set,
> even if it is empty.
>
> This version seems to work, but it is a bit chatty when CROSS_COMPILE
> is set and you build lots of modules...thoughts?

We cannot use CROSS_COMPILE to detect a cross build as CROSS_COMPILE
is used used to select different gcc versions, cccache etc.
The only relaiably way to detect a cross build is to check
is ARCH != modified uname -m arch.
So this check would have to be done in the top-level Makefile.

And that for shaving 6 bytes of a structure..

Sam

2008-03-02 20:00:24

by Gordon Farquharson

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

Hi Sam

On Sun, Mar 2, 2008 at 4:58 AM, Sam Ravnborg <[email protected]> wrote:

> Find below a patch that detect when we do a cross build and thus ignore
> the check.

Works for me.

Tested-by: Gordon Farquharson <[email protected]>

Thanks, Sam.

Gordon

--
Gordon Farquharson
GnuPG Key ID: 32D6D676

2008-03-23 20:51:04

by Sam Ravnborg

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Mon, Mar 17, 2008 at 10:07:56PM -0600, Gordon Farquharson wrote:
> Hi Sam
>
> On Sun, Mar 2, 2008 at 5:58 AM, Sam Ravnborg <[email protected]> wrote:
>
> > So please let me know if this works and then I can push it upstrem
> > hopefully already by tomorrow.
> >
> > Note: I decided to name the variable KBUILD_BUILDHOST as this is more
> > descriptive then SUBARCH. We can later clean up the naming and get rid
> > of SUBARCH but I refrained from this to make the pacht minimal.
>
> What is the status of this patch? Is there any chance that it will be
> included in 2.6.25?

Thanks for your paitience.
I have been outright busy so I never came around to this.
It is pushed for inclusion in 2.6.25 now.

Sam

2008-03-01 15:52:38

by Michael Büsch

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Saturday 01 March 2008, Sam Ravnborg wrote:
> > This version seems to work, but it is a bit chatty when CROSS_COMPILE
> > is set and you build lots of modules...thoughts?
>
> We cannot use CROSS_COMPILE to detect a cross build as CROSS_COMPILE
> is used used to select different gcc versions, cccache etc.
> The only relaiably way to detect a cross build is to check
> is ARCH != modified uname -m arch.
> So this check would have to be done in the top-level Makefile.
>
> And that for shaving 6 bytes of a structure..

Wrong. For maintaining userspace ABI compatibility.

2008-03-02 15:46:00

by Adrian Bunk

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

On Sat, Mar 01, 2008 at 02:01:33PM +0100, Sam Ravnborg wrote:
> On Fri, Feb 29, 2008 at 04:42:40PM -0500, John W. Linville wrote:
> > On Fri, Feb 29, 2008 at 02:10:58PM -0500, John W. Linville wrote:
> > > On Fri, Feb 29, 2008 at 05:34:13PM +0100, Johannes Berg wrote:
> > > >
> > > > On Fri, 2008-02-29 at 11:26 -0500, John W. Linville wrote:
> > > > > On Fri, Feb 29, 2008 at 01:16:59PM +0100, Michael Buesch wrote:
> > > > >
> > > > > > I'm wondering if we can't simply pass a commandline parameter to file2alias
> > > > > > that tells it whether we are crosscompiling. It should simply omit the sanity check
> > > > >
> > > > > Sounds reasonable to me.
> > > >
> > > > In fact, file2alias shouldn't need a command line argument ...
> > > >
> > > > > > in that case. Is there any easy and reliable way to find out whether we
> > > > > > are crosscompiling from a makefile (I don't know the makefile core that much)?
> > > > >
> > > > > Non-empty CROSS_COMPILE definition?
> > > >
> > > > ... it can just check whether CROSS_COMPILE is set in its environment.
> > > > No?
> > >
> > > Not a bad idea...something like this?
> >
> > That version didn't work -- it seems CROSS_COMPILE is always set,
> > even if it is empty.
> >
> > This version seems to work, but it is a bit chatty when CROSS_COMPILE
> > is set and you build lots of modules...thoughts?
>
> We cannot use CROSS_COMPILE to detect a cross build as CROSS_COMPILE
> is used used to select different gcc versions, cccache etc.
> The only relaiably way to detect a cross build is to check
> is ARCH != modified uname -m arch.
> So this check would have to be done in the top-level Makefile.
>
> And that for shaving 6 bytes of a structure..

I remember two other occassions where this file2alias mess has bitten us
recently.

I don't mind that much how it gets fixed, but the current status quo of
having this kind of problems again and again is simply not acceptable.

> Sam

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed


2008-03-23 21:23:37

by Gordon Farquharson

[permalink] [raw]
Subject: Re: pull request: wireless-2.6 2008-02-27

Hi Sam

On Sun, Mar 23, 2008 at 2:51 PM, Sam Ravnborg <[email protected]> wrote:
> Thanks for your paitience.
> I have been outright busy so I never came around to this.
> It is pushed for inclusion in 2.6.25 now.

Thanks, Sam. Sorry to have bugged you a little :-) Also, thanks very
much for creating the patch in the first place.

Gordon

--
Gordon Farquharson
GnuPG Key ID: 32D6D676