2010.07.13. 19:31 keltezéssel, daniel.go...@gmail.com írta:
> This patch makes madwifi respect (at least) the platform_data supplied MAC 
> address.
> 
> Signed-off-by: Daniel Golle <daniel.go...@gmail.com>
> 
> Index: package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch
> ===================================================================
> --- package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch     
> (revision 0)
> +++ package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch     
> (revision 0)
> @@ -0,0 +1,43 @@
> +diff -ru a/ath/if_ath.c b/ath/if_ath.c
> +--- a/ath/if_ath.c   2010-06-24 23:02:47.000000000 +0200
> ++++ b/ath/if_ath.c   2010-06-24 23:48:07.000000000 +0200
> +@@ -63,6 +63,8 @@
> + #include <linux/rtnetlink.h>
> + #include <linux/time.h>
> + #include <linux/pci.h>
> ++#include <linux/device.h>
> ++#include <linux/ath_platform.h>
> + #include <asm/uaccess.h>
> + 
> + #include "if_ethersubr.h"           /* for ETHER_IS_MULTICAST */
> +@@ -587,8 +589,13 @@
> +     unsigned int i;
> +     int autocreatemode = -1;
> +     u_int8_t csz;
> ++#ifdef ATH_PCI
> ++    struct ath_platform_data *pdata;
> ++    struct pci_dev *pdev;
> ++#endif
> + 
> +     sc->devid = devid;
> ++
> + #ifdef AR_DEBUG
> +     ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);
> +     sc->sc_debug     = (ath_debug & ~ATH_DEBUG_GLOBAL);
> +@@ -648,8 +655,15 @@
> +     }
> +     sc->sc_ah = ah;
> + 
> +-    /* WAR for AR7100 PCI bug */
> + #ifdef CONFIG_ATHEROS_AR71XX
> ++#ifdef ATH_PCI

Please move this out from the CONFIG_ATHEROS_AR71XXX section, because in the
current form it will cause a compiler warning  about unused variables on other
platforms.

> ++    /* set MAC from ath_platform_data */
> ++    pdev = (struct pci_dev *)sc->sc_bdev;
> ++    pdata = (struct ath_platform_data *)pdev->dev.platform_data;

The cast is not necessary.

> ++    if (pdata && pdata->macaddr)
> ++            ath_hal_setmac(ah, pdata->macaddr);
> ++#endif
> ++    /* WAR for AR7100 PCI bug */
> +     if ((ar_device(sc->devid) >= 5210) && (ar_device(sc->devid) < 5416)) {
> +             ath_hal_setcapability(ah, HAL_CAP_DMABURST_RX, 0, 
> HAL_DMABURST_4B, NULL);
> +             ath_hal_setcapability(ah, HAL_CAP_DMABURST_TX, 0, 
> HAL_DMABURST_4B, NULL);
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to