+++ /dev/null
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=acx
-PKG_VERSION:=20080210
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@SF/acx100
-PKG_MD5SUM:=7d5ce3215708e4e9f95cf567a9ee3a12
-
-PKG_UNPACK:= \
- bzcat $(DL_DIR)/$(PKG_SOURCE) | \
- $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS); \
- chmod -R u+w $(PKG_BUILD_DIR)
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/acx
- TITLE:=Driver for TI ACX1xx chipset
- DEPENDS:=@PCI_SUPPORT||TARGET_ar7 +wireless-tools @(!(LINUX_3_1||LINUX_3_2)||BROKEN)
- URL:=http://acx100.sourceforge.net/
- SUBMENU:=Wireless Drivers
- FILES:= $(PKG_BUILD_DIR)/acx.ko
- AUTOLOAD:=$(call AutoLoad,50,acx)
-endef
-
-define KernelPackage/acx/description
- This package contains a driver for TI ACX1xx 802.11a/b/g chipsets.
-endef
-
-C16_FW:=tiacx111c16
-C19_FW:=tiacx111c19
-
-define Download/tiacx111c16
- FILE:=$(C16_FW)
- URL:=http://teknoraver.net/software/acx-mac80211/
- MD5SUM:=7026826460376f6b174f9225bd7781b9
-endef
-$(eval $(call Download,tiacx111c16))
-
-define Download/tiacx111c19
- FILE:=$(C19_FW)
- URL:=http://ipkg.k1k2.de/files/
- MD5SUM:=a1fa9681e297b4e36e257090fc12265a
-endef
-$(eval $(call Download,tiacx111c19))
-
-
-define Build/Compile
- $(MAKE) -C $(LINUX_DIR) \
- SUBDIRS="$(PKG_BUILD_DIR)" \
- ARCH="$(LINUX_KARCH)" \
- CROSS_COMPILE="$(TARGET_CROSS)" \
- CC="$(TARGET_CC)" \
- CPP="$(TARGET_CC)" \
- LD="$(TARGET_CROSS)ld" \
- KERNELVERSION="$(KERNEL)" \
- KERNEL_SOURCE="$(LINUX_DIR)" \
- KDIR="$(LINUX_DIR)" \
- CONFIG_ACX=m \
- CONFIG_ACX_PCI=m \
- modules
-endef
-
-define KernelPackage/acx/install
- $(INSTALL_DIR) $(1)/lib/firmware
- $(INSTALL_DATA) $(DL_DIR)/$(C16_FW) $(1)/lib/firmware/
- $(INSTALL_DATA) $(DL_DIR)/$(C19_FW) $(1)/lib/firmware/
- $(INSTALL_DIR) $(1)/lib/wifi
- $(INSTALL_DATA) ./files/lib/wifi/acx.sh $(1)/lib/wifi/
-endef
-
-$(eval $(call KernelPackage,acx))
+++ /dev/null
-#!/bin/sh
-append DRIVERS "acx"
-
-find_acx_phy() {
- local device="$1"
-
- local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
- config_get phy "$device" phy
- [ -z "$phy" -a -n "$macaddr" ] && {
- cd /proc/driver
- for phy in $(ls acx_wlan[0-9] 2>&-); do
- phy=${phy#acx_}
- [ "$macaddr" = "$(cat /sys/class/net/${phy}/address)" ] || continue
- config_set "$device" phy "$phy"
- break
- done
- config_get phy "$device" phy
- }
- [ -n "$phy" -a -f "/proc/driver/acx_$phy" ] || {
- echo "phy for wifi device $1 not found"
- return 1
- }
- [ -z "$macaddr" ] && {
- config_set "$device" macaddr "$(cat /sys/class/net/${phy}/address)"
- }
- return 0
-}
-
-scan_acx() {
- local device="$1"
-
- [ ${device%[0-9]} = "wlan" ] && config_set "$device" phy "$device" || find_acx_phy "$device" || {
- config_unset "$device" vifs
- return 0
- }
- config_get phy "$device" phy
-
- config_get vifs "$device" vifs
- for vif in $vifs; do
- config_get mode "$vif" mode
- case "$mode" in
- adhoc|sta|ap|monitor)
- # Only one vif is allowed
- config_set "$vif" ifname "$phy"
- break
- ;;
- *) echo "$device($vif): Invalid mode, ignored."; continue;;
- esac
- done
- config_set "$device" vifs "$vif"
-}
-
-disable_acx() (
- local device="$1"
-
- find_acx_phy "$device" || return 0
- config_get phy "$device" phy
-
- set_wifi_down "$device"
-
- include /lib/network
- unbridge "$phy"
- return 0
-)
-
-enable_acx() {
- local device="$1"
-
- find_acx_phy "$device" || return 0
- config_get phy "$device" phy
-
- config_get regdomain "$device" regdomain
- [ -n "$regdomain" ] && iwpriv "$device" SetRegDomain "$regdomain"
-
- config_get rxantenna "$device" rxantenna
- config_get txantenna "$device" txantenna
- config_get_bool diversity "$device" diversity
- [ -n "$diversity" ] && {
- rxantenna="2"
- }
- [ -n "$rxantenna" ] && iwpriv "$phy" SetRxAnt "$rxantenna"
- [ -n "$txantenna" ] && iwpriv "$phy" SetTxAnt "$txantenna"
-
- config_get channel "$device" channel
- [ -n "$channel" ] && iwconfig "$phy" channel "$channel" >/dev/null 2>/dev/null
-
- config_get txpower "$device" txpower
- [ -n "$txpower" ] && iwconfig "$phy" txpower "${txpower%%.*}"
-
- config_get vif "$device" vifs
-
- config_get ifname "$vif" ifname
- config_get ssid "$vif" ssid
- config_get mode "$vif" mode
-
- iwconfig "$phy" essid ${ssid:+-- }"${ssid:-any}"
-
- case "$mode" in
- sta)
- iwconfig "$phy" mode managed
- config_get addr "$device" bssid
- [ -z "$addr" ] || {
- iwconfig "$phy" ap "$addr"
- }
- ;;
- ap) iwconfig "$phy" mode master;;
- adhoc) iwconfig "$phy" mode ad-hoc;;
- *) iwconfig "$phy" mode "$mode";;
- esac
-
- config_get frag "$vif" frag
- [ -n "$frag" ] && iwconfig "$phy" frag "${frag%%.*}"
-
- config_get rts "$vif" rts
- [ -n "$rts" ] && iwconfig "$phy" rts "${rts%%.*}"
-
- config_get enc "$vif" encryption
- case "$enc" in
- wep)
- for idx in 1 2 3 4; do
- config_get key "$vif" "key${idx}"
- iwconfig "$ifname" enc restricted "[$idx]" "${key:-off}"
- done
- config_get key "$vif" key
- key="${key:-1}"
- case "$key" in
- [1234]) iwconfig "$ifname" enc restricted "[$key]";;
- *) iwconfig "$ifname" enc restricted "$key";;
- esac
- ;;
- psk*|wpa*)
- echo "$device($vif): WPA/WPA2 not supported by acx driver"
- return 1
- ;;
- esac
-
- local net_cfg bridge
- net_cfg="$(find_net_config "$vif")"
- [ -z "$net_cfg" ] || {
- bridge="$(bridge_interface "$net_cfg")"
- config_set "$vif" bridge "$bridge"
- start_net "$ifname" "$net_cfg"
- }
- set_wifi_up "$vif" "$ifname"
-
-}
-
-check_acx_device() {
- [ ${1%[0-9]} = "wlan" ] && config_set "$1" phy "$1"
- config_get phy "$1" phy
- [ -z "$phy" ] && {
- find_acx_phy "$1" >/dev/null || return 0
- config_get phy "$1" phy
- }
- [ "$phy" = "$dev" ] && found=1
-}
-
-detect_acx() {
- devidx=0
- config_load wireless
- while :; do
- config_get type "radio$devidx" type
- [ -n "$type" ] || break
- devidx=$(($devidx + 1))
- done
- cd /proc/driver
- for dev in $(ls acx_wlan[0-9] 2>&-); do
- dev=${dev#acx_}
- found=0
- config_foreach check_acx_device wifi-device
- [ "$found" -gt 0 ] && continue
- cat <<EOF
-config wifi-device radio$devidx
- option type acx
- option channel 11
- option macaddr $(cat /sys/class/net/${dev}/address)
-
- # REMOVE THIS LINE TO ENABLE WIFI:
- option disabled 1
-
-config wifi-iface
- option device radio$devidx
- option network lan
- option mode ap
- option ssid OpenWrt
- option encryption none
-
-EOF
- devidx=$(($devidx + 1))
- done
-}
+++ /dev/null
---- a/Makefile
-+++ b/Makefile
-@@ -4,7 +4,7 @@ KERNELDIR = /lib/modules/$(KVER)/build
- obj-m += acx.o
-
- acx-obj-y += pci.o
--acx-obj-y += usb.o
-+#acx-obj-y += usb.o
-
- acx-objs := wlan.o conv.o ioctl.o common.o $(acx-obj-y)
-
---- a/acx_config.h
-+++ b/acx_config.h
-@@ -1,6 +1,6 @@
- /* temporary hack until proper Kconfig integration */
- #define CONFIG_ACX_PCI 1
--#define CONFIG_ACX_USB 1
-+/*#define CONFIG_ACX_USB 1*/
-
- #define ACX_RELEASE "v0.3.37"
-
+++ /dev/null
---- a/common.c
-+++ b/common.c
-@@ -4155,6 +4155,11 @@ acx_l_process_data_frame_master(acx_devi
- /* To_DS = 0, From_DS = 1 */
- hdr->fc = WF_FC_FROMDSi + WF_FTYPE_DATAi;
-
-+ /* Do we need to encrypt this? */
-+ if (adev->wep_enabled) {
-+ SET_BIT(hdr->fc, WF_FC_ISWEPi);
-+ }
-+
- txbuf = acx_l_get_txbuf(adev, tx);
- if (txbuf) {
- len = RXBUF_BYTES_RCVD(adev, rxbuf);
+++ /dev/null
---- a/ioctl.c
-+++ b/ioctl.c
-@@ -488,6 +488,7 @@ end_unlock:
- /* helper. not sure whether it's really a _s_leeping fn */
- static char*
- acx_s_scan_add_station(
-+ struct iw_request_info *info,
- acx_device_t *adev,
- char *ptr,
- char *end_buf,
-@@ -503,14 +504,14 @@ acx_s_scan_add_station(
- iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- MAC_COPY(iwe.u.ap_addr.sa_data, bss->bssid);
- acxlog_mac(L_IOCTL, "scan, station address: ", bss->bssid, "\n");
-- ptr = iwe_stream_add_event(ptr, end_buf, &iwe, IW_EV_ADDR_LEN);
-+ ptr = iwe_stream_add_event(info, ptr, end_buf, &iwe, IW_EV_ADDR_LEN);
-
- /* Add ESSID */
- iwe.cmd = SIOCGIWESSID;
- iwe.u.data.length = bss->essid_len;
- iwe.u.data.flags = 1;
- log(L_IOCTL, "scan, essid: %s\n", bss->essid);
-- ptr = iwe_stream_add_point(ptr, end_buf, &iwe, bss->essid);
-+ ptr = iwe_stream_add_point(info, ptr, end_buf, &iwe, bss->essid);
-
- /* Add mode */
- iwe.cmd = SIOCGIWMODE;
-@@ -520,7 +521,7 @@ acx_s_scan_add_station(
- else
- iwe.u.mode = IW_MODE_ADHOC;
- log(L_IOCTL, "scan, mode: %d\n", iwe.u.mode);
-- ptr = iwe_stream_add_event(ptr, end_buf, &iwe, IW_EV_UINT_LEN);
-+ ptr = iwe_stream_add_event(info, ptr, end_buf, &iwe, IW_EV_UINT_LEN);
- }
-
- /* Add frequency */
-@@ -528,7 +529,7 @@ acx_s_scan_add_station(
- iwe.u.freq.m = acx_channel_freq[bss->channel - 1] * 100000;
- iwe.u.freq.e = 1;
- log(L_IOCTL, "scan, frequency: %d\n", iwe.u.freq.m);
-- ptr = iwe_stream_add_event(ptr, end_buf, &iwe, IW_EV_FREQ_LEN);
-+ ptr = iwe_stream_add_event(info, ptr, end_buf, &iwe, IW_EV_FREQ_LEN);
-
- /* Add link quality */
- iwe.cmd = IWEVQUAL;
-@@ -546,7 +547,7 @@ acx_s_scan_add_station(
- iwe.u.qual.updated = 7;
- log(L_IOCTL, "scan, link quality: %d/%d/%d\n",
- iwe.u.qual.level, iwe.u.qual.noise, iwe.u.qual.qual);
-- ptr = iwe_stream_add_event(ptr, end_buf, &iwe, IW_EV_QUAL_LEN);
-+ ptr = iwe_stream_add_event(info, ptr, end_buf, &iwe, IW_EV_QUAL_LEN);
-
- /* Add encryption */
- iwe.cmd = SIOCGIWENCODE;
-@@ -556,7 +557,7 @@ acx_s_scan_add_station(
- iwe.u.data.flags = IW_ENCODE_DISABLED;
- iwe.u.data.length = 0;
- log(L_IOCTL, "scan, encryption flags: %X\n", iwe.u.data.flags);
-- ptr = iwe_stream_add_point(ptr, end_buf, &iwe, bss->essid);
-+ ptr = iwe_stream_add_point(info, ptr, end_buf, &iwe, bss->essid);
-
- /* add rates */
- iwe.cmd = SIOCGIWRATE;
-@@ -570,7 +571,7 @@ acx_s_scan_add_station(
- if (rate & 1) {
- iwe.u.bitrate.value = *p * 500000; /* units of 500kb/s */
- log(L_IOCTL, "scan, rate: %d\n", iwe.u.bitrate.value);
-- ptr_rate = iwe_stream_add_value(ptr, ptr_rate, end_buf,
-+ ptr_rate = iwe_stream_add_value(info, ptr, ptr_rate, end_buf,
- &iwe, IW_EV_PARAM_LEN);
- }
- rate >>= 1;
-@@ -625,7 +626,7 @@ acx_ioctl_get_scan(
- for (i = 0; i < ARRAY_SIZE(adev->sta_list); i++) {
- struct client *bss = &adev->sta_list[i];
- if (!bss->used) continue;
-- ptr = acx_s_scan_add_station(adev, ptr,
-+ ptr = acx_s_scan_add_station(info, adev, ptr,
- extra + IW_SCAN_MAX_DATA, bss);
- }
- dwrq->length = ptr - extra;
+++ /dev/null
---- a/pci.c
-+++ b/pci.c
-@@ -2005,7 +2005,12 @@ static void acxpci_s_down(struct net_dev
- /* then wait until interrupts have finished executing on other CPUs */
- acx_lock(adev, flags);
- disable_acx_irq(adev);
-+#ifdef CONFIG_PCI
- synchronize_irq(adev->pdev->irq);
-+#endif
-+#ifdef CONFIG_VLYNQ
-+ synchronize_irq(adev->vdev->irq);
-+#endif
- acx_unlock(adev, flags);
-
- /* we really don't want to have an asynchronous tasklet disturb us
-@@ -4164,7 +4169,11 @@ static __devinit int vlynq_probe(struct
- addr = (u32)ioremap(vdev->mem_start, 0x1000);
- if (!addr) {
- printk(KERN_ERR "%s: failed to remap io memory\n",
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- vdev->dev.bus_id);
-+#else
-+ dev_name(vdev));
-+#endif
- result = -ENXIO;
- goto fail;
- }
-@@ -4231,7 +4240,11 @@ static __devinit int vlynq_probe(struct
-
- printk("acx: found %s-based wireless network card at %s, irq:%d, "
- "phymem:0x%x, mem:0x%p\n",
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- match->name, vdev->dev.bus_id, ndev->irq,
-+#else
-+ match->name, dev_name(vdev), ndev->irq,
-+#endif
- vdev->mem_start, adev->iobase);
- log(L_ANY, "initial debug setting is 0x%04X\n", acx_debug);
-
---- a/wlan_compat.h
-+++ b/wlan_compat.h
-@@ -221,8 +221,10 @@
- #ifndef IRQ_NONE
- #define IRQ_NONE
- #define IRQ_HANDLED
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
- typedef void irqreturn_t;
- #endif
-+#endif
-
- #ifndef ARPHRD_IEEE80211_PRISM
- #define ARPHRD_IEEE80211_PRISM 802
+++ /dev/null
-Index: acx-20080210/pci.c
-===================================================================
---- acx-20080210.orig/pci.c 2010-05-02 21:37:00.000000000 +0200
-+++ acx-20080210/pci.c 2010-05-02 21:48:22.000000000 +0200
-@@ -1437,6 +1437,18 @@
-
- static void dummy_netdev_init(struct net_device *ndev) {}
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
-+static const struct net_device_ops acx_netdev_ops = {
-+ .ndo_open = &acxpci_e_open,
-+ .ndo_stop = &acxpci_e_close,
-+ .ndo_start_xmit = &acx_i_start_xmit,
-+ .ndo_get_stats = &acx_e_get_stats,
-+ .ndo_set_multicast_list = &acxpci_i_set_multicast_list,
-+ .ndo_tx_timeout = &acxpci_i_tx_timeout,
-+ .ndo_change_mtu = &acx_e_change_mtu,
-+};
-+#endif
-+
- #ifdef CONFIG_PCI
- static int __devinit acxpci_e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
- {
-@@ -1547,17 +1559,21 @@
- }
-
- ether_setup(ndev);
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
- ndev->open = &acxpci_e_open;
- ndev->stop = &acxpci_e_close;
- ndev->hard_start_xmit = &acx_i_start_xmit;
- ndev->get_stats = &acx_e_get_stats;
-+ ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-+ ndev->tx_timeout = &acxpci_i_tx_timeout;
-+ ndev->change_mtu = &acx_e_change_mtu;
-+#else
-+ ndev->netdev_ops = &acx_netdev_ops;
-+#endif
- #if IW_HANDLER_VERSION <= 5
- ndev->get_wireless_stats = &acx_e_get_wireless_stats;
- #endif
- ndev->wireless_handlers = (struct iw_handler_def *)&acx_ioctl_handler_def;
-- ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-- ndev->tx_timeout = &acxpci_i_tx_timeout;
-- ndev->change_mtu = &acx_e_change_mtu;
- ndev->watchdog_timeo = 4 * HZ;
- ndev->irq = pdev->irq;
- ndev->base_addr = pci_resource_start(pdev, 0);
-@@ -4191,17 +4207,24 @@
- goto fail_alloc_netdev;
- }
- ether_setup(ndev);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- ndev->open = &acxpci_e_open;
- ndev->stop = &acxpci_e_close;
- ndev->hard_start_xmit = &acx_i_start_xmit;
- ndev->get_stats = &acx_e_get_stats;
-+ ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-+ ndev->tx_timeout = &acxpci_i_tx_timeout;
-+ ndev->change_mtu = &acx_e_change_mtu;
-+ ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-+ ndev->tx_timeout = &acxpci_i_tx_timeout;
-+ ndev->change_mtu = &acx_e_change_mtu;
-+#else
-+ ndev->netdev_ops = &acx_netdev_ops;
-+#endif
- #if IW_HANDLER_VERSION <= 5
- ndev->get_wireless_stats = &acx_e_get_wireless_stats;
- #endif
- ndev->wireless_handlers = (struct iw_handler_def *)&acx_ioctl_handler_def;
-- ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-- ndev->tx_timeout = &acxpci_i_tx_timeout;
-- ndev->change_mtu = &acx_e_change_mtu;
- ndev->watchdog_timeo = 4 * HZ;
-
- adev = ndev2adev(ndev);
+++ /dev/null
---- a/pci.c
-+++ b/pci.c
-@@ -35,8 +35,12 @@
-
- /* Linux 2.6.18+ uses <linux/utsrelease.h> */
- #ifndef UTS_RELEASE
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
-+#include <generated/utsrelease.h>
-+#else
- #include <linux/utsrelease.h>
- #endif
-+#endif
-
- #include <linux/compiler.h> /* required for Lx 2.6.8 ?? */
- #include <linux/kernel.h>