This adds support for mwifiex into compat-wireless.
This is only compile tested as I do not have such a device.
CC: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
endif #CONFIG_CRC7
+CONFIG_MWIFIEX_SDIO=m
+
ifdef CONFIG_COMPAT_KERNEL_27
CONFIG_LIBERTAS_SDIO=n
NEED_LIBERTAS=n
CONFIG_WL12XX_HT=y
endif #CONFIG_CRC7
+CONFIG_MWIFIEX=m
+
ifdef CONFIG_COMPAT_KERNEL_27
CONFIG_LIBERTAS=n
else #CONFIG_COMPAT_KERNEL_27
dev->destructor = free_netdev;
ether_setup(dev);
dev->tx_queue_len = 0;
+--- a/drivers/net/wireless/mwifiex/main.c
++++ b/drivers/net/wireless/mwifiex/main.c
+@@ -675,7 +675,7 @@ static const struct net_device_ops mwifi
+ static void
+ mwifiex_init_priv_params(struct mwifiex_private *priv, struct net_device *dev)
+ {
+- dev->netdev_ops = &mwifiex_netdev_ops;
++ netdev_attach_ops(dev, &mwifiex_netdev_ops);
+ /* Initialize private structure */
+ init_waitqueue_head(&priv->ioctl_wait_q);
+ init_waitqueue_head(&priv->cmd_wait_q);
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -2272,14 +2272,18 @@ int orinoco_if_add(struct orinoco_privat
return mc_count;
}
+--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
++++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
+@@ -41,7 +41,11 @@ mwifiex_copy_mcast_addr(struct mwifiex_m
+ struct netdev_hw_addr *ha;
+
+ netdev_for_each_mc_addr(ha, dev)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ memcpy(&mlist->mac_list[i++], ha->addr, ETH_ALEN);
++#else
++ memcpy(&mlist->mac_list[i++], ha->dmi_addr, ETH_ALEN);
++#endif
+
+ return i;
+ }
+--- a/drivers/net/wireless/mwifiex/debugfs.c
++++ b/drivers/net/wireless/mwifiex/debugfs.c
+@@ -235,9 +235,15 @@ mwifiex_info_read(struct file *file, cha
+ netdev_for_each_mc_addr(ha, netdev)
+ p += sprintf(p, "multicast_address[%d]="
+ "\"%02x:%02x:%02x:%02x:%02x:%02x\"\n", i++,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ha->addr[0], ha->addr[1],
+ ha->addr[2], ha->addr[3],
+ ha->addr[4], ha->addr[5]);
++#else
++ ha->dmi_addr[0], ha->dmi_addr[1],
++ ha->dmi_addr[2], ha->dmi_addr[3],
++ ha->dmi_addr[4], ha->dmi_addr[5]);
++#endif
+ }
+
+ p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes);
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
-@@ -2165,15 +2165,21 @@ struct mwl8k_cmd_mac_multicast_adr {
+@@ -2466,15 +2466,21 @@ struct mwl8k_cmd_mac_multicast_adr {
static struct mwl8k_cmd_pkt *
__mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
if (allmulti || mc_count > priv->num_mcaddrs) {
allmulti = 1;
-@@ -2194,13 +2200,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
+@@ -2495,13 +2501,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
if (allmulti) {
cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST);
} else if (mc_count) {
}
}
-@@ -4130,7 +4150,11 @@ mwl8k_bss_info_changed(struct ieee80211_
+@@ -4642,7 +4662,11 @@ mwl8k_bss_info_changed(struct ieee80211_
}
static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
{
struct mwl8k_cmd_pkt *cmd;
-@@ -4141,7 +4165,11 @@ static u64 mwl8k_prepare_multicast(struc
+@@ -4653,7 +4677,11 @@ static u64 mwl8k_prepare_multicast(struc
* we'll end up throwing this packet away and creating a new
* one in mwl8k_configure_filter().
*/
return (unsigned long)cmd;
}
-@@ -4263,7 +4291,11 @@ static void mwl8k_configure_filter(struc
+@@ -4775,7 +4803,11 @@ static void mwl8k_configure_filter(struc
*/
if (*total_flags & FIF_ALLMULTI) {
kfree(cmd);
card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
if (ret)
+--- a/drivers/net/wireless/mwifiex/sdio.c
++++ b/drivers/net/wireless/mwifiex/sdio.c
+@@ -60,7 +60,9 @@ mwifiex_sdio_probe(struct sdio_func *fun
+
+ card->func = func;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
++#endif
+
+ sdio_claim_host(func);
+ ret = sdio_enable_func(func);
+++ /dev/null
-Starting with commit 66fceb69b72ff7e9cd8da2ca70033982d5376e0e
-"libertas: Added callback functions to support SDIO suspend/resume."
-libertas uses new functions from the in kernel sdio framework for
-suspend and resume that are not backported.
-
---- a/drivers/net/wireless/libertas/if_sdio.c
-+++ b/drivers/net/wireless/libertas/if_sdio.c
-@@ -1196,6 +1196,7 @@ static void if_sdio_remove(struct sdio_f
- lbs_deb_leave(LBS_DEB_SDIO);
- }
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
- static int if_sdio_suspend(struct device *dev)
- {
- struct sdio_func *func = dev_to_sdio_func(dev);
-@@ -1250,15 +1251,18 @@ static const struct dev_pm_ops if_sdio_p
- .suspend = if_sdio_suspend,
- .resume = if_sdio_resume,
- };
-+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
-
- static struct sdio_driver if_sdio_driver = {
- .name = "libertas_sdio",
- .id_table = if_sdio_ids,
- .probe = if_sdio_probe,
- .remove = if_sdio_remove,
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
- .drv = {
- .pm = &if_sdio_pm_ops,
- },
-+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
- };
-
- /*******************************************************************/
--- /dev/null
+Starting with commit 66fceb69b72ff7e9cd8da2ca70033982d5376e0e
+"libertas: Added callback functions to support SDIO suspend/resume."
+libertas uses new functions from the in kernel sdio framework for
+suspend and resume that are not backported.
+
+--- a/drivers/net/wireless/libertas/if_sdio.c
++++ b/drivers/net/wireless/libertas/if_sdio.c
+@@ -1196,6 +1196,7 @@ static void if_sdio_remove(struct sdio_f
+ lbs_deb_leave(LBS_DEB_SDIO);
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ static int if_sdio_suspend(struct device *dev)
+ {
+ struct sdio_func *func = dev_to_sdio_func(dev);
+@@ -1250,15 +1251,18 @@ static const struct dev_pm_ops if_sdio_p
+ .suspend = if_sdio_suspend,
+ .resume = if_sdio_resume,
+ };
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+ static struct sdio_driver if_sdio_driver = {
+ .name = "libertas_sdio",
+ .id_table = if_sdio_ids,
+ .probe = if_sdio_probe,
+ .remove = if_sdio_remove,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ .drv = {
+ .pm = &if_sdio_pm_ops,
+ },
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+ };
+
+ /*******************************************************************/
+--- a/drivers/net/wireless/mwifiex/sdio.c
++++ b/drivers/net/wireless/mwifiex/sdio.c
+@@ -107,6 +107,7 @@ mwifiex_sdio_remove(struct sdio_func *fu
+ }
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ /*
+ * SDIO suspend.
+ *
+@@ -214,6 +215,7 @@ static int mwifiex_sdio_resume(struct de
+
+ return 0;
+ }
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+ /* Device ID for SD8787 */
+ #define SDIO_DEVICE_ID_MARVELL_8787 (0x9119)
+@@ -226,10 +228,12 @@ static const struct sdio_device_id mwifi
+
+ MODULE_DEVICE_TABLE(sdio, mwifiex_ids);
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ static const struct dev_pm_ops mwifiex_sdio_pm_ops = {
+ .suspend = mwifiex_sdio_suspend,
+ .resume = mwifiex_sdio_resume,
+ };
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+ static struct sdio_driver mwifiex_sdio = {
+ .name = "mwifiex_sdio",
+@@ -238,7 +242,9 @@ static struct sdio_driver mwifiex_sdio =
+ .remove = mwifiex_sdio_remove,
+ .drv = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ .pm = &mwifiex_sdio_pm_ops,
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+ }
+ };
+
+@@ -1741,8 +1747,10 @@ mwifiex_sdio_cleanup_module(void)
+ if (!adapter || !adapter->priv_num)
+ goto exit;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ if (adapter->is_suspended)
+ mwifiex_sdio_resume(adapter->dev);
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+ for (i = 0; i < adapter->priv_num; i++)
+ if ((GET_BSS_ROLE(adapter->priv[i]) == MWIFIEX_BSS_ROLE_STA) &&
DRIVERS="$DRIVERS drivers/net/wireless/wl1251"
DRIVERS="$DRIVERS drivers/net/wireless/iwmc3200wifi"
DRIVERS="$DRIVERS drivers/net/wireless/orinoco"
+DRIVERS="$DRIVERS drivers/net/wireless/mwifiex"
# Staging drivers
STAGING_DRIVERS="drivers/staging/ath6kl"