linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] compat-wireless: compile fixes
@ 2010-04-18 13:36 Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

This series contains mostly compile fixes.
It was compile tested on kernel 2.6.25 to 2.6.34 and ath9k is working in
Ubuntu 9.04.

Hauke Mehrtens (3):
  compat-wireless: backport convert multicast list to list_head.
  compat-wireless: Remove use of sdio quirks attribute
  compat-wireless: include net and trace includes form compat.

 patches/25-multicast-list_head.patch |  813 ++++++++++++++++++++++++++++++++++
 patches/26-sdio-quirks.patch         |   20 +
 scripts/admin-update.sh              |    3 +
 3 files changed, 836 insertions(+), 0 deletions(-)
 create mode 100644 patches/25-multicast-list_head.patch
 create mode 100644 patches/26-sdio-quirks.patch


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
  2010-04-18 13:36 [PATCH 0/3] compat-wireless: compile fixes Hauke Mehrtens
@ 2010-04-18 13:36 ` Hauke Mehrtens
  2010-04-18 14:15   ` Pavel Roskin
  2010-04-18 13:36 ` [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 3/3] compat-wireless: include net and trace includes form compat Hauke Mehrtens
  2 siblings, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/25-multicast-list_head.patch |  813 ++++++++++++++++++++++++++++++++++
 1 files changed, 813 insertions(+), 0 deletions(-)
 create mode 100644 patches/25-multicast-list_head.patch

diff --git a/patches/25-multicast-list_head.patch b/patches/25-multicast-list_head.patch
new file mode 100644
index 0000000..a420187
--- /dev/null
+++ b/patches/25-multicast-list_head.patch
@@ -0,0 +1,813 @@
+Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87:
+  net: convert multicast list to list_head
+
+  Converts the list and the core manipulating with it to be the same as uc_list.
+
+  +uses two functions for adding/removing mc address (normal and "global"
+   variant) instead of a function parameter.
+  +removes dev_mcast.c completely.
+  +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
+   manipulation with lists on a sandbox (used in bonding and 80211 drivers)
+
+This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
+
+--- a/drivers/net/atl1c/atl1c_main.c
++++ b/drivers/net/atl1c/atl1c_main.c
+@@ -354,7 +354,11 @@ static void atl1c_set_multi(struct net_d
+ {
+ 	struct atl1c_adapter *adapter = netdev_priv(netdev);
+ 	struct atl1c_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	u32 mac_ctrl_data;
+ 	u32 hash_value;
+ 
+@@ -378,7 +382,11 @@ static void atl1c_set_multi(struct net_d
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl1c_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl1c_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atl1e/atl1e_main.c
++++ b/drivers/net/atl1e/atl1e_main.c
+@@ -284,7 +284,11 @@ static void atl1e_set_multi(struct net_d
+ {
+ 	struct atl1e_adapter *adapter = netdev_priv(netdev);
+ 	struct atl1e_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	u32 mac_ctrl_data = 0;
+ 	u32 hash_value;
+ 
+@@ -308,7 +312,11 @@ static void atl1e_set_multi(struct net_d
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl1e_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl1e_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atlx/atl2.c
++++ b/drivers/net/atlx/atl2.c
+@@ -136,7 +136,11 @@ static void atl2_set_multi(struct net_de
+ {
+ 	struct atl2_adapter *adapter = netdev_priv(netdev);
+ 	struct atl2_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	u32 rctl;
+ 	u32 hash_value;
+ 
+@@ -159,7 +163,11 @@ static void atl2_set_multi(struct net_de
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl2_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl2_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atlx/atlx.c
++++ b/drivers/net/atlx/atlx.c
+@@ -123,7 +123,11 @@ static void atlx_set_multi(struct net_de
+ {
+ 	struct atlx_adapter *adapter = netdev_priv(netdev);
+ 	struct atlx_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	u32 rctl;
+ 	u32 hash_value;
+ 
+@@ -145,7 +149,11 @@ static void atlx_set_multi(struct net_de
+ 
+ 	/* compute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atlx_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atlx_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/b44.c
++++ b/drivers/net/b44.c
+@@ -1681,7 +1681,11 @@ static struct net_device_stats *b44_get_
+ 
+ static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	int i, num_ents;
+ 
+ 	num_ents = min_t(int, netdev_mc_count(dev), B44_MCAST_TABLE_SIZE);
+@@ -1689,7 +1693,11 @@ static int __b44_load_mcast(struct b44 *
+ 	netdev_for_each_mc_addr(ha, dev) {
+ 		if (i == num_ents)
+ 			break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		__b44_cam_write(bp, ha->addr, i++ + 1);
++#else
++		__b44_cam_write(bp, ha->dmi_addr, i++ + 1);
++#endif
+ 	}
+ 	return i+1;
+ }
+--- a/drivers/net/wireless/adm8211.c
++++ b/drivers/net/wireless/adm8211.c
+@@ -1318,19 +1318,37 @@ static void adm8211_bss_info_changed(str
+ }
+ 
+ static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *ha)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	unsigned int bit_nr;
+-	u32 mc_filter[2];
+ 	struct netdev_hw_addr *ha;
++#else
++	unsigned int bit_nr, i;
++#endif
++	u32 mc_filter[2];
+ 
+ 	mc_filter[1] = mc_filter[0] = 0;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
+ 		bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26;
++#endif
+ 
+ 		bit_nr &= 0x3F;
+ 		mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return mc_filter[0] | ((u64)(mc_filter[1]) << 32);
+--- a/drivers/net/wireless/ath/ar9170/main.c
++++ b/drivers/net/wireless/ath/ar9170/main.c
+@@ -2047,17 +2047,35 @@ out:
+ 	return err;
+ }
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
+ 				       struct netdev_hw_addr_list *mc_list)
++#else
++static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++				       struct dev_addr_list *ha)
++#endif
+ {
+ 	u64 mchash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	/* always get broadcast frames */
+ 	mchash = 1ULL << (0xff >> 2);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list)
+ 		mchash |= 1ULL << (ha->addr[5] >> 2);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (WARN_ON(!ha))
++			break;
++		mchash |= 1ULL << (ha->dmi_addr[5] >> 2);
++		ha = ha->next;
++	}
++#endif
+ 
+ 	return mchash;
+ }
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -263,7 +263,11 @@ static void ath5k_remove_interface(struc
+ 		struct ieee80211_vif *vif);
+ static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list);
++#else
++				   int mc_count, struct dev_addr_list *mc_list);
++#endif
+ static void ath5k_configure_filter(struct ieee80211_hw *hw,
+ 		unsigned int changed_flags,
+ 		unsigned int *new_flags,
+@@ -3105,20 +3109,42 @@ unlock:
+ }
+ 
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	u32 mfilt[2], val;
+ 	u8 pos;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	mfilt[0] = 0;
+ 	mfilt[1] = 1;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++#endif
+ 		/* calculate XOR of eight 6-bit values */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		val = get_unaligned_le32(ha->addr + 0);
++#else
++		val = get_unaligned_le32(ha->dmi_addr + 0);
++#endif
+ 		pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		val = get_unaligned_le32(ha->addr + 3);
++#else
++		val = get_unaligned_le32(ha->dmi_addr + 3);
++#endif
+ 		pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+ 		pos &= 0x3f;
+ 		mfilt[pos / 32] |= (1 << (pos % 32));
+@@ -3127,6 +3153,9 @@ static u64 ath5k_prepare_multicast(struc
+ 		* neet to inform below to not reset the mcast */
+ 		/* ath5k_hw_set_mcast_filterindex(ah,
+ 		 *      ha->addr[5]); */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return ((u64)(mfilt[1]) << 32) | mfilt[0];
+--- a/drivers/net/wireless/libertas/main.c
++++ b/drivers/net/wireless/libertas/main.c
+@@ -319,7 +319,11 @@ static int lbs_add_mcast_addrs(struct cm
+ 			       struct net_device *dev, int nr_addrs)
+ {
+ 	int i = nr_addrs;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	int cnt;
+ 
+ 	if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
+@@ -328,18 +332,34 @@ static int lbs_add_mcast_addrs(struct cm
+ 	netif_addr_lock_bh(dev);
+ 	cnt = netdev_mc_count(dev);
+ 	netdev_for_each_mc_addr(ha, dev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) {
++#else
++		if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) {
++#endif
+ 			lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				    ha->addr);
++#else
++				    ha->dmi_addr);
++#endif
+ 			cnt--;
+ 			continue;
+ 		}
+ 
+ 		if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ 			break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN);
++#else
++		memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN);
++#endif
+ 		lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			    ha->addr);
++#else
++			    ha->dmi_addr);
++#endif
+ 		i++;
+ 		cnt--;
+ 	}
+--- a/drivers/net/wireless/libertas_tf/main.c
++++ b/drivers/net/wireless/libertas_tf/main.c
+@@ -369,20 +369,36 @@ static int lbtf_op_config(struct ieee802
+ }
+ 
+ static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct lbtf_private *priv = hw->priv;
+ 	int i;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
+ 	int mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+ 
+ 	if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ 		return mc_count;
+ 
+ 	priv->nr_of_multicastmacaddr = mc_count;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	i = 0;
+ 	netdev_hw_addr_list_for_each(ha, mc_list)
+ 		memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		memcpy(&priv->multicastlist[i], ha->da_addr,
++				ETH_ALEN);
++		ha = ha->next;
++	}
++#endif
+ 
+ 	return mc_count;
+ }
+--- a/drivers/net/wireless/mwl8k.c
++++ b/drivers/net/wireless/mwl8k.c
+@@ -1939,15 +1939,21 @@ struct mwl8k_cmd_mac_multicast_adr {
+ 
+ static struct mwl8k_cmd_pkt *
+ __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			      struct netdev_hw_addr_list *mc_list)
++#else
++			      int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct mwl8k_priv *priv = hw->priv;
+ 	struct mwl8k_cmd_mac_multicast_adr *cmd;
+ 	int size;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	int mc_count = 0;
+ 
+ 	if (mc_list)
+ 		mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+ 
+ 	if (allmulti || mc_count > priv->num_mcaddrs) {
+ 		allmulti = 1;
+@@ -1968,13 +1974,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
+ 	if (allmulti) {
+ 		cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST);
+ 	} else if (mc_count) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		struct netdev_hw_addr *ha;
+ 		int i = 0;
++#else
++		int i;
++#endif
+ 
+ 		cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
+ 		cmd->numaddr = cpu_to_le16(mc_count);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		netdev_hw_addr_list_for_each(ha, mc_list) {
+ 			memcpy(cmd->addr[i], ha->addr, ETH_ALEN);
++#else
++		for (i = 0; i < mc_count && ha; i++) {
++			if (ha->da_addrlen != ETH_ALEN) {
++				kfree(cmd);
++				return NULL;
++			}
++			memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN);
++			ha = ha->next;
++#endif
+ 		}
+ 	}
+ 
+@@ -3553,7 +3573,11 @@ mwl8k_bss_info_changed(struct ieee80211_
+ }
+ 
+ static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct mwl8k_cmd_pkt *cmd;
+ 
+@@ -3564,7 +3588,11 @@ static u64 mwl8k_prepare_multicast(struc
+ 	 * we'll end up throwing this packet away and creating a new
+ 	 * one in mwl8k_configure_filter().
+ 	 */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list);
++#else
++	cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha);
++#endif
+ 
+ 	return (unsigned long)cmd;
+ }
+@@ -3687,7 +3715,11 @@ static void mwl8k_configure_filter(struc
+ 	 */
+ 	if (*total_flags & FIF_ALLMULTI) {
+ 		kfree(cmd);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL);
++#else
++		cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL);
++#endif
+ 	}
+ 
+ 	if (cmd != NULL) {
+--- a/drivers/net/wireless/orinoco/hw.c
++++ b/drivers/net/wireless/orinoco/hw.c
+@@ -1056,14 +1056,22 @@ int __orinoco_hw_set_multicast_list(stru
+ 	 * group address if either we want to multicast, or if we were
+ 	 * multicasting and want to stop */
+ 	if (!promisc && (mc_count || priv->mc_count)) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		struct netdev_hw_addr *ha;
++#else
++		struct dev_mc_list *ha;
++#endif
+ 		struct hermes_multicast mclist;
+ 		int i = 0;
+ 
+ 		netdev_for_each_mc_addr(ha, dev) {
+ 			if (i == mc_count)
+ 				break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			memcpy(mclist.addr[i++], ha->addr, ETH_ALEN);
++#else
++			memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN);
++#endif
+ 		}
+ 
+ 		err = hermes_write_ltv(hw, USER_BAP,
+--- a/drivers/net/wireless/orinoco/hw.h
++++ b/drivers/net/wireless/orinoco/hw.h
+@@ -22,6 +22,9 @@
+ 
+ /* Forward declarations */
+ struct orinoco_private;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++struct dev_addr_list;
++#endif
+ 
+ int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
+ 			      size_t fw_name_len, u32 *hw_ver);
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -1546,7 +1546,11 @@ static int remove_key(struct usbnet *usb
+ static void set_multicast_list(struct usbnet *usbdev)
+ {
+ 	struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	struct dev_mc_list *ha;
++#endif
+ 	__le32 filter, basefilter;
+ 	int ret;
+ 	char *mc_addrs = NULL;
+@@ -1587,7 +1591,11 @@ static void set_multicast_list(struct us
+ 
+ 		netdev_for_each_mc_addr(ha, usbdev->net)
+ 			memcpy(mc_addrs + i++ * ETH_ALEN,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			       ha->addr, ETH_ALEN);
++#else
++			       ha->dmi_addr, ETH_ALEN);
++#endif
+ 	}
+ 	netif_addr_unlock_bh(usbdev->net);
+ 
+--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
+@@ -724,10 +724,19 @@ static void rtl8180_bss_info_changed(str
+ 	        priv->rf->conf_erp(dev, info);
+ }
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev,
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
++				     struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	return netdev_hw_addr_list_count(mc_list);
++#else
++	return mc_count;
++#endif
+ }
+ 
+ static void rtl8180_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
+@@ -1194,9 +1194,17 @@ static void rtl8187_bss_info_changed(str
+ }
+ 
+ static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	return netdev_hw_addr_list_count(mc_list);
++#else
++	return mc_count;
++#endif
+ }
+ 
+ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/wl12xx/wl1271_main.c
++++ b/drivers/net/wireless/wl12xx/wl1271_main.c
+@@ -1305,11 +1305,20 @@ struct wl1271_filter_params {
+ 	u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
+ };
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
+ 				       struct netdev_hw_addr_list *mc_list)
++#else
++static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++				       struct dev_addr_list *mc_list)
++#endif
+ {
+ 	struct wl1271_filter_params *fp;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 	struct wl1271 *wl = hw->priv;
+ 
+ 	if (unlikely(wl->state == WL1271_STATE_OFF))
+@@ -1322,16 +1331,40 @@ static u64 wl1271_op_prepare_multicast(s
+ 	}
+ 
+ 	/* update multicast filtering parameters */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	fp->mc_list_length = 0;
+ 	if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
++#else
++	fp->enabled = true;
++	if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
++		mc_count = 0;
++#endif
+ 		fp->enabled = false;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	} else {
+ 		fp->enabled = true;
+ 		netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++	}
++
++	fp->mc_list_length = 0;
++	for (i = 0; i < mc_count; i++) {
++		if (mc_list->da_addrlen == ETH_ALEN) {
++#endif
+ 			memcpy(fp->mc_list[fp->mc_list_length],
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 					ha->addr, ETH_ALEN);
++#else
++			       mc_list->da_addr, ETH_ALEN);
++#endif
+ 			fp->mc_list_length++;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		}
++#else
++		} else
++			wl1271_warning("Unknown mc address length.");
++		mc_list = mc_list->next;
++#endif
+ 	}
+ 
+ 	return (u64)(unsigned long)fp;
+--- a/drivers/net/wireless/zd1211rw/zd_mac.c
++++ b/drivers/net/wireless/zd1211rw/zd_mac.c
+@@ -948,17 +948,34 @@ static void set_rx_filter_handler(struct
+ }
+ 
+ static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct zd_mac *mac = zd_hw_mac(hw);
+ 	struct zd_mc_hash hash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	zd_mc_clear(&hash);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
+ 		dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr);
+ 		zd_mc_add_addr(&hash, ha->addr);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr);
++		zd_mc_add_addr(&hash, ha->dmi_addr);
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return hash.low | ((u64)hash.high << 32);
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -1631,7 +1631,11 @@ struct ieee80211_ops {
+ 				 struct ieee80211_bss_conf *info,
+ 				 u32 changed);
+ 	u64 (*prepare_multicast)(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				 struct netdev_hw_addr_list *mc_list);
++#else
++				 int mc_count, struct dev_addr_list *mc_list);
++#endif
+ 	void (*configure_filter)(struct ieee80211_hw *hw,
+ 				 unsigned int changed_flags,
+ 				 unsigned int *total_flags,
+--- a/net/bluetooth/bnep/netdev.c
++++ b/net/bluetooth/bnep/netdev.c
+@@ -88,7 +88,11 @@ static void bnep_net_set_mc_list(struct 
+ 		memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
+ 		r->len = htons(ETH_ALEN * 2);
+ 	} else {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		struct netdev_hw_addr *ha;
++#else
++		struct dev_mc_list *ha;
++#endif
+ 		int i, len = skb->len;
+ 
+ 		if (dev->flags & IFF_BROADCAST) {
+@@ -102,8 +106,13 @@ static void bnep_net_set_mc_list(struct 
+ 		netdev_for_each_mc_addr(ha, dev) {
+ 			if (i == BNEP_MAX_MULTICAST_FILTERS)
+ 				break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
+ 			memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
++#else
++			memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++			memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++#endif
+ 		}
+ 		r->len = htons(skb->len - len);
+ 	}
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -84,14 +84,28 @@ static inline void drv_bss_info_changed(
+ }
+ 
+ static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 					struct netdev_hw_addr_list *mc_list)
++#else
++					int mc_count,
++					struct dev_addr_list *mc_list)
++#endif
+ {
+ 	u64 ret = 0;
+ 
+ 	if (local->ops->prepare_multicast)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		ret = local->ops->prepare_multicast(&local->hw, mc_list);
++#else
++		ret = local->ops->prepare_multicast(&local->hw, mc_count,
++						    mc_list);
++#endif
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	trace_drv_prepare_multicast(local, mc_list->count, ret);
++#else
++	trace_drv_prepare_multicast(local, mc_count, ret);
++#endif
+ 
+ 	return ret;
+ }
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -665,7 +665,12 @@ struct ieee80211_local {
+ 	struct work_struct recalc_smps;
+ 
+ 	/* aggregated multicast list */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr_list mc_list;
++#else
++	struct dev_addr_list *mc_list;
++	int mc_count;
++#endif
+ 
+ 	bool tim_in_locked_section; /* see ieee80211_beacon_get() */
+ 
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -413,7 +413,12 @@ static int ieee80211_stop(struct net_dev
+ 
+ 	netif_addr_lock_bh(dev);
+ 	spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	__hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++	__dev_addr_unsync(&local->mc_list, &local->mc_count,
++			  &dev->mc_list, &dev->mc_count);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 	netif_addr_unlock_bh(dev);
+ 
+@@ -596,7 +601,12 @@ static void ieee80211_set_multicast_list
+ 		sdata->flags ^= IEEE80211_SDATA_PROMISC;
+ 	}
+ 	spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	__hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++	__dev_addr_sync(&local->mc_list, &local->mc_count,
++			&dev->mc_list, &dev->mc_count);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 	ieee80211_queue_work(&local->hw, &local->reconfig_filter);
+ }
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -71,7 +71,11 @@ void ieee80211_configure_filter(struct i
+ 	spin_lock_bh(&local->filter_lock);
+ 	changed_flags = local->filter_flags ^ new_flags;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	mc = drv_prepare_multicast(local, &local->mc_list);
++#else
++	mc = drv_prepare_multicast(local, local->mc_count, local->mc_list);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 
+ 	/* be a bit nasty */
+@@ -390,9 +394,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
+ 	local->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
+ 
+ 	INIT_LIST_HEAD(&local->interfaces);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 
+ 	__hw_addr_init(&local->mc_list);
+ 
++#endif
+ 	mutex_init(&local->iflist_mtx);
+ 	mutex_init(&local->scan_mtx);
+ 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute
  2010-04-18 13:36 [PATCH 0/3] compat-wireless: compile fixes Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
@ 2010-04-18 13:36 ` Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 3/3] compat-wireless: include net and trace includes form compat Hauke Mehrtens
  2 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/26-sdio-quirks.patch |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 patches/26-sdio-quirks.patch

diff --git a/patches/26-sdio-quirks.patch b/patches/26-sdio-quirks.patch
new file mode 100644
index 0000000..0b43be5
--- /dev/null
+++ b/patches/26-sdio-quirks.patch
@@ -0,0 +1,20 @@
+The quirks attribute is not available on older kernels.
+
+--- a/drivers/net/wireless/libertas/if_sdio.c
++++ b/drivers/net/wireless/libertas/if_sdio.c
+@@ -1026,6 +1026,7 @@ static int if_sdio_probe(struct sdio_fun
+ 	if (ret)
+ 		goto disable;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+ 	/* For 1-bit transfers to the 8686 model, we need to enable the
+ 	 * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0
+ 	 * bit to allow access to non-vendor registers. */
+@@ -1044,6 +1045,7 @@ static int if_sdio_probe(struct sdio_fun
+ 		if (ret)
+ 			goto release_int;
+ 	}
++#endif
+ 
+ 	card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
+ 	if (ret)
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] compat-wireless: include net and trace includes form compat.
  2010-04-18 13:36 [PATCH 0/3] compat-wireless: compile fixes Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
  2010-04-18 13:36 ` [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute Hauke Mehrtens
@ 2010-04-18 13:36 ` Hauke Mehrtens
  2 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

The includes form the net and trace directory of compat were not copyed.
This broke compilation on older kernels that needed some files in these
directories from compat.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 scripts/admin-update.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 36cdfac..39fafb2 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -116,6 +116,7 @@ DRIVER_FILES="$DRIVER_FILES mwl8k.c"
 mkdir -p include/linux/ include/net/ include/linux/usb \
 	include/linux/unaligned \
 	include/linux/spi \
+	include/trace \
 	net/mac80211/ net/wireless/ \
 	net/rfkill/ \
 	drivers/ssb/ \
@@ -233,6 +234,8 @@ cp $GIT_COMPAT_TREE/compat/Makefile $COMPAT/
 cp -a $GIT_COMPAT_TREE/udev/ .
 cp -a $GIT_COMPAT_TREE/scripts/ $COMPAT/
 cp -a $GIT_COMPAT_TREE/include/linux/* include/linux/
+cp -a $GIT_COMPAT_TREE/include/net/* include/net/
+cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
 rm -f $COMPAT/*.mod.c
 
 # Refresh patches using quilt
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
  2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
@ 2010-04-18 14:15   ` Pavel Roskin
  2010-04-19 18:32     ` Hauke Mehrtens
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Roskin @ 2010-04-18 14:15 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: lrodriguez, linux-wireless, mcgrof

Hello, Hauke!

Thank you for doing this effort!  I would prefer that we avoid  
patching as much as possible.  Patches tend to break as the code  
changes.  I think there are several cases where patching can be  
eliminated.

> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + 	struct netdev_hw_addr *ha;
> ++#else
> ++	struct dev_mc_list *ha;
> ++#endif

We could simply use this in some header:

#define dev_mc_list netdev_hw_addr

> + 	/* comoute mc addresses' hash value ,and put it into hash table */

Someone had a bout of dyslexia, and it will be fixed, breaking the patch :-)

> + 	netdev_for_each_mc_addr(ha, netdev) {
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + 		hash_value = atl1c_hash_mc_addr(hw, ha->addr);
> ++#else
> ++		hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
> ++#endif

#define addr dmi_addr

OK, this is likely to break if done in a header, but maybe it could be  
done in the C code away from the rest of the code.

> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + 	__hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
> ++#else
> ++	__dev_addr_unsync(&local->mc_list, &local->mc_count,
> ++			  &dev->mc_list, &dev->mc_count);
> ++#endif

Cannot we reimplement __hw_addr_unsync()?

> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> +
> + 	__hw_addr_init(&local->mc_list);
> +
> ++#endif

That could be an empty function.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
  2010-04-18 14:15   ` Pavel Roskin
@ 2010-04-19 18:32     ` Hauke Mehrtens
  2010-04-19 20:06       ` [PATCH v2] compat: " Hauke Mehrtens
  2010-04-19 20:06       ` [PATCH v2 1/3] compat-wireless: " Hauke Mehrtens
  0 siblings, 2 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-19 18:32 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: lrodriguez, linux-wireless, mcgrof

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

Hi Pavel,

thank you for your comments on this.
Pavel Roskin wrote:
> Hello, Hauke!
> 
> Thank you for doing this effort!  I would prefer that we avoid patching
> as much as possible.  Patches tend to break as the code changes.  I
> think there are several cases where patching can be eliminated.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +     struct netdev_hw_addr *ha;
>> ++#else
>> ++    struct dev_mc_list *ha;
>> ++#endif
> 
> We could simply use this in some header:
> 
> #define dev_mc_list netdev_hw_addr
This will be possible, but as I see, only in some easy parts where the
patch looks like the quote above.
I will change that and resend this patch.
> 
>> +     /* comoute mc addresses' hash value ,and put it into hash table */
> 
> Someone had a bout of dyslexia, and it will be fixed, breaking the patch
> :-)
> 
>> +     netdev_for_each_mc_addr(ha, netdev) {
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +         hash_value = atl1c_hash_mc_addr(hw, ha->addr);
>> ++#else
>> ++        hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
>> ++#endif
> 
> #define addr dmi_addr
> 
> OK, this is likely to break if done in a header, but maybe it could be
> done in the C code away from the rest of the code.
I think the if defs are better than a conditional define in every file
that needs it. It will result in strange compile errors if someone uses
addr for an other addresses.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +     __hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
>> ++#else
>> ++    __dev_addr_unsync(&local->mc_list, &local->mc_count,
>> ++              &dev->mc_list, &dev->mc_count);
>> ++#endif
> 
> Cannot we reimplement __hw_addr_unsync()?
This change depends on some changes structs in
net/mac80211/ieee80211_i.h I do not see a way to reimplement this.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +
>> +     __hw_addr_init(&local->mc_list);
>> +
>> ++#endif
> 
> That could be an empty function.
Yes that could be done, but I think it is much more clear to use this
patch here, because we do not need __hw_addr_init, because
local->mc_list is of a completely different type.

Hauke


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 898 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] compat: backport convert multicast list to list_head.
  2010-04-19 18:32     ` Hauke Mehrtens
@ 2010-04-19 20:06       ` Hauke Mehrtens
  2010-04-20  0:25         ` Luis R. Rodriguez
  2010-04-19 20:06       ` [PATCH v2 1/3] compat-wireless: " Hauke Mehrtens
  1 sibling, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-19 20:06 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, proski, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.35.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index 964e8dc..4d3483a 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -4,6 +4,7 @@
 #include <linux/version.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+#include <linux/etherdevice.h>
 
 #define IW_HANDLER(id, func)			\
 	[IW_IOCTL_IDX(id)] = func
@@ -11,6 +12,8 @@
 #define  SDIO_BUS_ECSI		0x20	/* Enable continuous SPI interrupt */
 #define  SDIO_BUS_SCSI		0x40	/* Support continuous SPI interrupt */
 
+#define netdev_hw_addr dev_mc_list
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
 
 #endif /* LINUX_26_35_COMPAT_H */
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 1/3] compat-wireless: backport convert multicast list to list_head.
  2010-04-19 18:32     ` Hauke Mehrtens
  2010-04-19 20:06       ` [PATCH v2] compat: " Hauke Mehrtens
@ 2010-04-19 20:06       ` Hauke Mehrtens
  1 sibling, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-04-19 20:06 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, proski, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
  v2: add #define netdev_hw_addr dev_mc_list and remove ifdefs

 patches/25-multicast-list_head.patch |  706 ++++++++++++++++++++++++++++++++++
 1 files changed, 706 insertions(+), 0 deletions(-)
 create mode 100644 patches/25-multicast-list_head.patch

diff --git a/patches/25-multicast-list_head.patch b/patches/25-multicast-list_head.patch
new file mode 100644
index 0000000..bd8f2bd
--- /dev/null
+++ b/patches/25-multicast-list_head.patch
@@ -0,0 +1,706 @@
+Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87:
+  net: convert multicast list to list_head
+
+  Converts the list and the core manipulating with it to be the same as uc_list.
+
+  +uses two functions for adding/removing mc address (normal and "global"
+   variant) instead of a function parameter.
+  +removes dev_mcast.c completely.
+  +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
+   manipulation with lists on a sandbox (used in bonding and 80211 drivers)
+
+This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
+
+--- a/drivers/net/atl1c/atl1c_main.c
++++ b/drivers/net/atl1c/atl1c_main.c
+@@ -378,7 +378,11 @@ static void atl1c_set_multi(struct net_d
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl1c_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl1c_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atl1e/atl1e_main.c
++++ b/drivers/net/atl1e/atl1e_main.c
+@@ -308,7 +308,11 @@ static void atl1e_set_multi(struct net_d
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl1e_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl1e_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atlx/atl2.c
++++ b/drivers/net/atlx/atl2.c
+@@ -159,7 +159,11 @@ static void atl2_set_multi(struct net_de
+ 
+ 	/* comoute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atl2_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atl2_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/atlx/atlx.c
++++ b/drivers/net/atlx/atlx.c
+@@ -145,7 +145,11 @@ static void atlx_set_multi(struct net_de
+ 
+ 	/* compute mc addresses' hash value ,and put it into hash table */
+ 	netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		hash_value = atlx_hash_mc_addr(hw, ha->addr);
++#else
++		hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ 		atlx_hash_set(hw, hash_value);
+ 	}
+ }
+--- a/drivers/net/b44.c
++++ b/drivers/net/b44.c
+@@ -1689,7 +1689,11 @@ static int __b44_load_mcast(struct b44 *
+ 	netdev_for_each_mc_addr(ha, dev) {
+ 		if (i == num_ents)
+ 			break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		__b44_cam_write(bp, ha->addr, i++ + 1);
++#else
++		__b44_cam_write(bp, ha->dmi_addr, i++ + 1);
++#endif
+ 	}
+ 	return i+1;
+ }
+--- a/drivers/net/wireless/adm8211.c
++++ b/drivers/net/wireless/adm8211.c
+@@ -1318,19 +1318,37 @@ static void adm8211_bss_info_changed(str
+ }
+ 
+ static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *ha)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	unsigned int bit_nr;
+-	u32 mc_filter[2];
+ 	struct netdev_hw_addr *ha;
++#else
++	unsigned int bit_nr, i;
++#endif
++	u32 mc_filter[2];
+ 
+ 	mc_filter[1] = mc_filter[0] = 0;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
+ 		bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26;
++#endif
+ 
+ 		bit_nr &= 0x3F;
+ 		mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return mc_filter[0] | ((u64)(mc_filter[1]) << 32);
+--- a/drivers/net/wireless/ath/ar9170/main.c
++++ b/drivers/net/wireless/ath/ar9170/main.c
+@@ -2047,17 +2047,35 @@ out:
+ 	return err;
+ }
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
+ 				       struct netdev_hw_addr_list *mc_list)
++#else
++static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++				       struct dev_addr_list *ha)
++#endif
+ {
+ 	u64 mchash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	/* always get broadcast frames */
+ 	mchash = 1ULL << (0xff >> 2);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list)
+ 		mchash |= 1ULL << (ha->addr[5] >> 2);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (WARN_ON(!ha))
++			break;
++		mchash |= 1ULL << (ha->dmi_addr[5] >> 2);
++		ha = ha->next;
++	}
++#endif
+ 
+ 	return mchash;
+ }
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -263,7 +263,11 @@ static void ath5k_remove_interface(struc
+ 		struct ieee80211_vif *vif);
+ static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list);
++#else
++				   int mc_count, struct dev_addr_list *mc_list);
++#endif
+ static void ath5k_configure_filter(struct ieee80211_hw *hw,
+ 		unsigned int changed_flags,
+ 		unsigned int *new_flags,
+@@ -3105,20 +3109,42 @@ unlock:
+ }
+ 
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	u32 mfilt[2], val;
+ 	u8 pos;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	mfilt[0] = 0;
+ 	mfilt[1] = 1;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++#endif
+ 		/* calculate XOR of eight 6-bit values */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		val = get_unaligned_le32(ha->addr + 0);
++#else
++		val = get_unaligned_le32(ha->dmi_addr + 0);
++#endif
+ 		pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		val = get_unaligned_le32(ha->addr + 3);
++#else
++		val = get_unaligned_le32(ha->dmi_addr + 3);
++#endif
+ 		pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+ 		pos &= 0x3f;
+ 		mfilt[pos / 32] |= (1 << (pos % 32));
+@@ -3127,6 +3153,9 @@ static u64 ath5k_prepare_multicast(struc
+ 		* neet to inform below to not reset the mcast */
+ 		/* ath5k_hw_set_mcast_filterindex(ah,
+ 		 *      ha->addr[5]); */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return ((u64)(mfilt[1]) << 32) | mfilt[0];
+--- a/drivers/net/wireless/libertas/main.c
++++ b/drivers/net/wireless/libertas/main.c
+@@ -328,18 +328,34 @@ static int lbs_add_mcast_addrs(struct cm
+ 	netif_addr_lock_bh(dev);
+ 	cnt = netdev_mc_count(dev);
+ 	netdev_for_each_mc_addr(ha, dev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) {
++#else
++		if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) {
++#endif
+ 			lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				    ha->addr);
++#else
++				    ha->dmi_addr);
++#endif
+ 			cnt--;
+ 			continue;
+ 		}
+ 
+ 		if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ 			break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN);
++#else
++		memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN);
++#endif
+ 		lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			    ha->addr);
++#else
++			    ha->dmi_addr);
++#endif
+ 		i++;
+ 		cnt--;
+ 	}
+--- a/drivers/net/wireless/libertas_tf/main.c
++++ b/drivers/net/wireless/libertas_tf/main.c
+@@ -369,20 +369,36 @@ static int lbtf_op_config(struct ieee802
+ }
+ 
+ static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct lbtf_private *priv = hw->priv;
+ 	int i;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
+ 	int mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+ 
+ 	if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ 		return mc_count;
+ 
+ 	priv->nr_of_multicastmacaddr = mc_count;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	i = 0;
+ 	netdev_hw_addr_list_for_each(ha, mc_list)
+ 		memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		memcpy(&priv->multicastlist[i], ha->da_addr,
++				ETH_ALEN);
++		ha = ha->next;
++	}
++#endif
+ 
+ 	return mc_count;
+ }
+--- a/drivers/net/wireless/mwl8k.c
++++ b/drivers/net/wireless/mwl8k.c
+@@ -1939,15 +1939,21 @@ struct mwl8k_cmd_mac_multicast_adr {
+ 
+ static struct mwl8k_cmd_pkt *
+ __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			      struct netdev_hw_addr_list *mc_list)
++#else
++			      int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct mwl8k_priv *priv = hw->priv;
+ 	struct mwl8k_cmd_mac_multicast_adr *cmd;
+ 	int size;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	int mc_count = 0;
+ 
+ 	if (mc_list)
+ 		mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+ 
+ 	if (allmulti || mc_count > priv->num_mcaddrs) {
+ 		allmulti = 1;
+@@ -1968,13 +1974,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
+ 	if (allmulti) {
+ 		cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST);
+ 	} else if (mc_count) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		struct netdev_hw_addr *ha;
+ 		int i = 0;
++#else
++		int i;
++#endif
+ 
+ 		cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
+ 		cmd->numaddr = cpu_to_le16(mc_count);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		netdev_hw_addr_list_for_each(ha, mc_list) {
+ 			memcpy(cmd->addr[i], ha->addr, ETH_ALEN);
++#else
++		for (i = 0; i < mc_count && ha; i++) {
++			if (ha->da_addrlen != ETH_ALEN) {
++				kfree(cmd);
++				return NULL;
++			}
++			memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN);
++			ha = ha->next;
++#endif
+ 		}
+ 	}
+ 
+@@ -3553,7 +3573,11 @@ mwl8k_bss_info_changed(struct ieee80211_
+ }
+ 
+ static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct mwl8k_cmd_pkt *cmd;
+ 
+@@ -3564,7 +3588,11 @@ static u64 mwl8k_prepare_multicast(struc
+ 	 * we'll end up throwing this packet away and creating a new
+ 	 * one in mwl8k_configure_filter().
+ 	 */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list);
++#else
++	cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha);
++#endif
+ 
+ 	return (unsigned long)cmd;
+ }
+@@ -3687,7 +3715,11 @@ static void mwl8k_configure_filter(struc
+ 	 */
+ 	if (*total_flags & FIF_ALLMULTI) {
+ 		kfree(cmd);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL);
++#else
++		cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL);
++#endif
+ 	}
+ 
+ 	if (cmd != NULL) {
+--- a/drivers/net/wireless/orinoco/hw.c
++++ b/drivers/net/wireless/orinoco/hw.c
+@@ -1063,7 +1063,11 @@ int __orinoco_hw_set_multicast_list(stru
+ 		netdev_for_each_mc_addr(ha, dev) {
+ 			if (i == mc_count)
+ 				break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			memcpy(mclist.addr[i++], ha->addr, ETH_ALEN);
++#else
++			memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN);
++#endif
+ 		}
+ 
+ 		err = hermes_write_ltv(hw, USER_BAP,
+--- a/drivers/net/wireless/orinoco/hw.h
++++ b/drivers/net/wireless/orinoco/hw.h
+@@ -22,6 +22,9 @@
+ 
+ /* Forward declarations */
+ struct orinoco_private;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++struct dev_addr_list;
++#endif
+ 
+ int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
+ 			      size_t fw_name_len, u32 *hw_ver);
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -1587,7 +1587,11 @@ static void set_multicast_list(struct us
+ 
+ 		netdev_for_each_mc_addr(ha, usbdev->net)
+ 			memcpy(mc_addrs + i++ * ETH_ALEN,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			       ha->addr, ETH_ALEN);
++#else
++			       ha->dmi_addr, ETH_ALEN);
++#endif
+ 	}
+ 	netif_addr_unlock_bh(usbdev->net);
+ 
+--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
+@@ -724,10 +724,19 @@ static void rtl8180_bss_info_changed(str
+ 	        priv->rf->conf_erp(dev, info);
+ }
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev,
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
++				     struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	return netdev_hw_addr_list_count(mc_list);
++#else
++	return mc_count;
++#endif
+ }
+ 
+ static void rtl8180_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
+@@ -1194,9 +1194,17 @@ static void rtl8187_bss_info_changed(str
+ }
+ 
+ static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				     struct netdev_hw_addr_list *mc_list)
++#else
++				     int mc_count, struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	return netdev_hw_addr_list_count(mc_list);
++#else
++	return mc_count;
++#endif
+ }
+ 
+ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/wl12xx/wl1271_main.c
++++ b/drivers/net/wireless/wl12xx/wl1271_main.c
+@@ -1305,11 +1305,20 @@ struct wl1271_filter_params {
+ 	u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
+ };
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
+ 				       struct netdev_hw_addr_list *mc_list)
++#else
++static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++				       struct dev_addr_list *mc_list)
++#endif
+ {
+ 	struct wl1271_filter_params *fp;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 	struct wl1271 *wl = hw->priv;
+ 
+ 	if (unlikely(wl->state == WL1271_STATE_OFF))
+@@ -1322,16 +1331,40 @@ static u64 wl1271_op_prepare_multicast(s
+ 	}
+ 
+ 	/* update multicast filtering parameters */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	fp->mc_list_length = 0;
+ 	if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
++#else
++	fp->enabled = true;
++	if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
++		mc_count = 0;
++#endif
+ 		fp->enabled = false;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	} else {
+ 		fp->enabled = true;
+ 		netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++	}
++
++	fp->mc_list_length = 0;
++	for (i = 0; i < mc_count; i++) {
++		if (mc_list->da_addrlen == ETH_ALEN) {
++#endif
+ 			memcpy(fp->mc_list[fp->mc_list_length],
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 					ha->addr, ETH_ALEN);
++#else
++			       mc_list->da_addr, ETH_ALEN);
++#endif
+ 			fp->mc_list_length++;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		}
++#else
++		} else
++			wl1271_warning("Unknown mc address length.");
++		mc_list = mc_list->next;
++#endif
+ 	}
+ 
+ 	return (u64)(unsigned long)fp;
+--- a/drivers/net/wireless/zd1211rw/zd_mac.c
++++ b/drivers/net/wireless/zd1211rw/zd_mac.c
+@@ -948,17 +948,34 @@ static void set_rx_filter_handler(struct
+ }
+ 
+ static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				   struct netdev_hw_addr_list *mc_list)
++#else
++				   int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ 	struct zd_mac *mac = zd_hw_mac(hw);
+ 	struct zd_mc_hash hash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr *ha;
++#else
++	int i;
++#endif
+ 
+ 	zd_mc_clear(&hash);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	netdev_hw_addr_list_for_each(ha, mc_list) {
+ 		dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr);
+ 		zd_mc_add_addr(&hash, ha->addr);
++#else
++	for (i = 0; i < mc_count; i++) {
++		if (!ha)
++			break;
++		dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr);
++		zd_mc_add_addr(&hash, ha->dmi_addr);
++		ha = ha->next;
++#endif
+ 	}
+ 
+ 	return hash.low | ((u64)hash.high << 32);
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -1631,7 +1631,11 @@ struct ieee80211_ops {
+ 				 struct ieee80211_bss_conf *info,
+ 				 u32 changed);
+ 	u64 (*prepare_multicast)(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 				 struct netdev_hw_addr_list *mc_list);
++#else
++				 int mc_count, struct dev_addr_list *mc_list);
++#endif
+ 	void (*configure_filter)(struct ieee80211_hw *hw,
+ 				 unsigned int changed_flags,
+ 				 unsigned int *total_flags,
+--- a/net/bluetooth/bnep/netdev.c
++++ b/net/bluetooth/bnep/netdev.c
+@@ -102,8 +102,13 @@ static void bnep_net_set_mc_list(struct 
+ 		netdev_for_each_mc_addr(ha, dev) {
+ 			if (i == BNEP_MAX_MULTICAST_FILTERS)
+ 				break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 			memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
+ 			memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
++#else
++			memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++			memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++#endif
+ 		}
+ 		r->len = htons(skb->len - len);
+ 	}
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -84,14 +84,28 @@ static inline void drv_bss_info_changed(
+ }
+ 
+ static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 					struct netdev_hw_addr_list *mc_list)
++#else
++					int mc_count,
++					struct dev_addr_list *mc_list)
++#endif
+ {
+ 	u64 ret = 0;
+ 
+ 	if (local->ops->prepare_multicast)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 		ret = local->ops->prepare_multicast(&local->hw, mc_list);
++#else
++		ret = local->ops->prepare_multicast(&local->hw, mc_count,
++						    mc_list);
++#endif
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	trace_drv_prepare_multicast(local, mc_list->count, ret);
++#else
++	trace_drv_prepare_multicast(local, mc_count, ret);
++#endif
+ 
+ 	return ret;
+ }
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -665,7 +665,12 @@ struct ieee80211_local {
+ 	struct work_struct recalc_smps;
+ 
+ 	/* aggregated multicast list */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	struct netdev_hw_addr_list mc_list;
++#else
++	struct dev_addr_list *mc_list;
++	int mc_count;
++#endif
+ 
+ 	bool tim_in_locked_section; /* see ieee80211_beacon_get() */
+ 
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -413,7 +413,12 @@ static int ieee80211_stop(struct net_dev
+ 
+ 	netif_addr_lock_bh(dev);
+ 	spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	__hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++	__dev_addr_unsync(&local->mc_list, &local->mc_count,
++			  &dev->mc_list, &dev->mc_count);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 	netif_addr_unlock_bh(dev);
+ 
+@@ -596,7 +601,12 @@ static void ieee80211_set_multicast_list
+ 		sdata->flags ^= IEEE80211_SDATA_PROMISC;
+ 	}
+ 	spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	__hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++	__dev_addr_sync(&local->mc_list, &local->mc_count,
++			&dev->mc_list, &dev->mc_count);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 	ieee80211_queue_work(&local->hw, &local->reconfig_filter);
+ }
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -71,7 +71,11 @@ void ieee80211_configure_filter(struct i
+ 	spin_lock_bh(&local->filter_lock);
+ 	changed_flags = local->filter_flags ^ new_flags;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 	mc = drv_prepare_multicast(local, &local->mc_list);
++#else
++	mc = drv_prepare_multicast(local, local->mc_count, local->mc_list);
++#endif
+ 	spin_unlock_bh(&local->filter_lock);
+ 
+ 	/* be a bit nasty */
+@@ -390,9 +394,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
+ 	local->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
+ 
+ 	INIT_LIST_HEAD(&local->interfaces);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ 
+ 	__hw_addr_init(&local->mc_list);
+ 
++#endif
+ 	mutex_init(&local->iflist_mtx);
+ 	mutex_init(&local->scan_mtx);
+ 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] compat: backport convert multicast list to list_head.
  2010-04-19 20:06       ` [PATCH v2] compat: " Hauke Mehrtens
@ 2010-04-20  0:25         ` Luis R. Rodriguez
  0 siblings, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2010-04-20  0:25 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof, proski

On Mon, Apr 19, 2010 at 1:06 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  include/linux/compat-2.6.35.h |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
> index 964e8dc..4d3483a 100644
> --- a/include/linux/compat-2.6.35.h
> +++ b/include/linux/compat-2.6.35.h
> @@ -4,6 +4,7 @@
>  #include <linux/version.h>
>
>  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
> +#include <linux/etherdevice.h>
>
>  #define IW_HANDLER(id, func)                   \
>        [IW_IOCTL_IDX(id)] = func
> @@ -11,6 +12,8 @@
>  #define  SDIO_BUS_ECSI         0x20    /* Enable continuous SPI interrupt */
>  #define  SDIO_BUS_SCSI         0x40    /* Support continuous SPI interrupt */
>
> +#define netdev_hw_addr dev_mc_list
> +
>  #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
>
>  #endif /* LINUX_26_35_COMPAT_H */

Lets go with this approach for now, and if it bites us in the ass we
now not to do that again :)

BTW Thanks so much for all these patches, I'm merging them now, I
counted 6, 3 for compat, 3 for compat-wireless, if I missed anything
please let me know. Going to force out a new tarball now.

compat:

    compat: backport convert multicast list to list_head.
    compat: Add linux/version.h include before using it.
    compat: Add definitions needed for libertas sdio driver.

compat-wireless:

    compat-wireless: include net and trace includes form compat
    compat-wireless: Remove use of sdio quirks attribute
    compat-wireless: backport convert multicast list to list_head.

  Luis

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-20  0:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-18 13:36 [PATCH 0/3] compat-wireless: compile fixes Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
2010-04-18 14:15   ` Pavel Roskin
2010-04-19 18:32     ` Hauke Mehrtens
2010-04-19 20:06       ` [PATCH v2] compat: " Hauke Mehrtens
2010-04-20  0:25         ` Luis R. Rodriguez
2010-04-19 20:06       ` [PATCH v2 1/3] compat-wireless: " Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 3/3] compat-wireless: include net and trace includes form compat Hauke Mehrtens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).