Hi,
This the patch I submit to acx100-devel list to fix compilation issue with
version acx-mac80211-20080210. But as the mailing list does not seems very
active, I post the patch here.
With this it detect my card on my DSL-624T router. It may not work with the
PCI bus and USB is simply not compiling.
I was quit pleased to have it work, but I could not manage to configure my
card. Anyone have a working configuration script?
It could also be the state of the driver. There is a bunch of TODO related
to the card configuration that I wonder if it works.
Regards,
B.I.
diff -pru acx-mac80211-20080210.old/Makefile acx-mac80211-20080210/Makefile
--- acx-mac80211-20080210.old/Makefile 2008-02-10 21:06:50.000000000 +0100
+++ acx-mac80211-20080210/Makefile 2008-03-22 14:29:19.000000000 +0100
@@ -4,10 +4,10 @@ KERNELDIR = /lib/modules/$(KVER)/build
obj-m += acx-mac80211.o
acx-mac80211-obj-m += pci.o
-acx-mac80211-obj-m += usb.o
+#acx-mac80211-obj-m += usb.o
#acx-mac80211-objs := wlan.o conv.o ioctl.o common.o $(acx-mac80211-obj-y)
-acx-mac80211-objs := common.o $(acx-mac80211-obj-y)
+acx-mac80211-objs := common.o $(acx-mac80211-obj-m)
# Use this if you have proper Kconfig integration:
diff -pru acx-mac80211-20080210.old/acx_func.h acx-mac80211-20080210/acx_func.h
--- acx-mac80211-20080210.old/acx_func.h 2008-02-10 21:06:50.000000000 +0100
+++ acx-mac80211-20080210/acx_func.h 2008-03-22 17:51:49.000000000 +0100
@@ -556,7 +556,7 @@ int acxpci_proc_eeprom_output(char *p, a
void acxpci_set_interrupt_mask(acx_device_t *adev);
int acx100pci_s_set_tx_level(acx_device_t *adev, u8 level_dbm);
-void acx_s_mwait(int ms);
+void acx_s_msleep(int ms);
int acx_s_init_mac(acx_device_t *adev);
void acx_set_reg_domain(acx_device_t *adev, unsigned char reg_dom_id);
void acx_update_capabilities(acx_device_t *adev);
@@ -621,14 +621,8 @@ int acx_net_set_key(struct ieee80211_hw
const u8 *local_addr, const u8 *addr,
struct ieee80211_key_conf *key);
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
int acx_config_interface(struct ieee80211_hw* ieee, int if_id,
struct ieee80211_if_conf *conf);
-#else
-extern int acx_config_interface(struct ieee80211_hw* ieee,
- struct ieee80211_vif *vif,
- struct ieee80211_if_conf *conf);
-#endif
int acx_net_config(struct ieee80211_hw* ieee, struct ieee80211_conf *conf);
int acx_net_get_tx_stats(struct ieee80211_hw* ieee, struct ieee80211_tx_queue_stats *stats);
int acx_net_conf_tx(struct ieee80211_hw* ieee, int queue,
diff -pru acx-mac80211-20080210.old/common.c acx-mac80211-20080210/common.c
--- acx-mac80211-20080210.old/common.c 2008-02-10 21:06:50.000000000 +0100
+++ acx-mac80211-20080210/common.c 2008-03-22 17:50:23.000000000 +0100
@@ -2062,7 +2062,7 @@ static int acx100_s_create_dma_regions(a
goto end;
fail:
- acx_s_mwait(1000); /* ? */
+ acx_s_msleep(1000); /* ? */
if (IS_PCI(adev))
acxpci_free_desc_queues(adev);
end:
@@ -3340,7 +3340,7 @@ static void acx_s_update_80211_powersave
acx_s_configure(adev, &pm, ACX1xx_IE_POWER_MGMT);
acx_s_interrogate(adev, &pm, ACX1xx_IE_POWER_MGMT);
log(L_INIT, "wakeup_cfg: 0x%02X\n", pm.acx111.wakeup_cfg);
- acx_s_mwait(40);
+ acx_s_msleep(40);
acx_s_interrogate(adev, &pm, ACX1xx_IE_POWER_MGMT);
log(L_INIT, "wakeup_cfg: 0x%02X\n", pm.acx111.wakeup_cfg);
log(L_INIT, "power save mode change %s\n",
@@ -4219,11 +4219,7 @@ int acx_add_interface(struct ieee80211_h
if (adev->interface.operating)
goto out_unlock;
adev->interface.operating = 1;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
adev->interface.if_id = conf->if_id;
-#else
- adev->vif = conf->vif;
-#endif
adev->interface.mac_addr = conf->mac_addr;
adev->interface.type = conf->type;
}
@@ -4399,7 +4395,6 @@ int acx_net_config(struct ieee80211_hw *
**
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
int acx_config_interface(struct ieee80211_hw* ieee, int if_id,
struct ieee80211_if_conf *conf)
{
@@ -4424,33 +4419,6 @@ int acx_config_interface(struct ieee8021
}
if ((conf->type == IEEE80211_IF_TYPE_AP)
&& (adev->interface.if_id == if_id)) {
-#else
-extern int acx_config_interface(struct ieee80211_hw* ieee,
- struct ieee80211_vif *vif,
- struct ieee80211_if_conf *conf)
-{
- acx_device_t *adev = ieee2adev(ieee);
- unsigned long flags;
- int err = -ENODEV;
- FN_ENTER;
- if (!adev->interface.operating)
- goto err_out;
- acx_lock(adev, flags);
-
- if (adev->initialized)
- acx_select_opmode(adev);
-
- if ((conf->type != IEEE80211_IF_TYPE_MNTR)
- && (adev->vif == vif)) {
- if (conf->bssid)
- {
- adev->interface.bssid = conf->bssid;
- MAC_COPY(adev->bssid,conf->bssid);
- }
- }
- if ((conf->type == IEEE80211_IF_TYPE_AP)
- && (adev->vif == vif)) {
-#endif
if ((conf->ssid_len > 0) && conf->ssid)
{
adev->essid_len = conf->ssid_len;
diff -pru acx-mac80211-20080210.old/pci.c acx-mac80211-20080210/pci.c
--- acx-mac80211-20080210.old/pci.c 2008-02-10 21:06:50.000000000 +0100
+++ acx-mac80211-20080210/pci.c 2008-03-22 17:52:37.000000000 +0100
@@ -95,11 +95,6 @@ static void acxpci_e_close(struct ieee80
static void acxpci_s_up(struct ieee80211_hw *hw);
static void acxpci_s_down(struct ieee80211_hw *hw);
-void acxpci_put_devname(acx_device_t *adev, struct ethtool_drvinfo *info)
-{
-
- strncpy(info->bus_info,pci_name(adev->pdev), ETHTOOL_BUSINFO_LEN);
-}
/***********************************************************************
** Register access
@@ -619,12 +614,12 @@ static int acxpci_s_upload_fw(acx_device
snprintf(filename, sizeof(filename), "tiacx1%02dc%02X",
IS_ACX111(adev) * 11, adev->radio_type);
- fw_image = acx_s_read_fw(&adev->pdev->dev, filename, &file_size);
+ fw_image = acx_s_read_fw(adev->bus_dev, filename, &file_size);
if (!fw_image) {
adev->need_radio_fw = 1;
filename[sizeof("tiacx1NN") - 1] = '\0';
fw_image =
- acx_s_read_fw(&adev->pdev->dev, filename, &file_size);
+ acx_s_read_fw(adev->bus_dev, filename, &file_size);
if (!fw_image) {
FN_EXIT1(NOT_OK);
return NOT_OK;
@@ -646,7 +641,7 @@ static int acxpci_s_upload_fw(acx_device
}
printk("acx: firmware upload attempt #%d FAILED, "
"retrying...\n", try);
- acx_s_mwait(1000); /* better wait for a while... */
+ acx_s_msleep(1000); /* better wait for a while... */
}
vfree(fw_image);
@@ -684,7 +679,7 @@ int acxpci_s_upload_radio(acx_device_t *
snprintf(filename, sizeof(filename), "tiacx1%02dr%02X",
IS_ACX111(adev) * 11, adev->radio_type);
- radio_image = acx_s_read_fw(&adev->pdev->dev, filename, &size);
+ radio_image = acx_s_read_fw(adev->bus_dev, filename, &size);
if (!radio_image) {
printk("acx: can't load radio module '%s'\n", filename);
goto fail;
@@ -705,7 +700,7 @@ int acxpci_s_upload_radio(acx_device_t *
break;
printk("acx: radio firmware upload attempt #%d FAILED, "
"retrying...\n", try);
- acx_s_mwait(1000); /* better wait for a while... */
+ acx_s_msleep(1000); /* better wait for a while... */
}
acx_s_issue_cmd(adev, ACX1xx_CMD_WAKE, NULL, 0);
@@ -789,7 +784,7 @@ static int acxpci_s_verify_init(acx_devi
if (time_after(jiffies, timeout))
break;
/* Init may take up to ~0.5 sec total */
- acx_s_mwait(50);
+ acx_s_msleep(50);
}
FN_EXIT1(result);
@@ -962,7 +957,7 @@ int acxpci_s_reset_dev(acx_device_t * ad
if (OK != acxpci_s_upload_fw(adev))
goto end_fail;
- /* acx_s_mwait(10); this one really shouldn't be required */
+ /* acx_s_msleep(10); this one really shouldn't be required */
/* now start eCPU by clearing bit */
write_reg16(adev, IO_ACX_ECPU_CTRL, ecpu_ctrl & ~0x1);
@@ -1067,7 +1062,7 @@ int acxpci_s_issue_cmd_timeo_debug(acx_d
break;
}
/* we waited 8 iterations, no luck. Sleep 8 ms */
- acx_s_mwait(8);
+ acx_s_msleep(8);
}
} while (likely(--counter));
@@ -1133,7 +1128,7 @@ int acxpci_s_issue_cmd_timeo_debug(acx_d
break;
}
/* we waited 8 iterations, no luck. Sleep 8 ms */
- acx_s_mwait(8);
+ acx_s_msleep(8);
}
} while (likely(--counter));
@@ -1334,7 +1329,7 @@ static void acxpci_s_delete_dma_regions(
* longer possible here? */
write_reg16(adev, IO_ACX_ENABLE, 0);
- acx_s_mwait(100);
+ acx_s_msleep(100);
acx_lock(adev, flags);
acxpci_free_desc_queues(adev);
@@ -1512,6 +1507,7 @@ static int __devinit acxpci_e_probe(stru
/* acx_sem_lock(adev); */
adev->ieee = ieee;
adev->pdev = pdev;
+ adev->bus_dev = &pdev->dev;
adev->dev_type = DEVTYPE_PCI;
/** Finished with private interface **/
@@ -2027,12 +2023,12 @@ static void acxpci_s_down(struct ieee802
/* Disable IRQs first, so that IRQs cannot race with us */
/* then wait until interrupts have finished executing on other CPUs */
printk("acxpci_s_down: acx_lock()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
acx_lock(adev, flags);
disable_acx_irq(adev);
synchronize_irq(adev->pdev->irq);
printk("acxpci_s_down: acx_unlock()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
acx_unlock(adev, flags);
/* we really don't want to have an asynchronous tasklet disturb us
@@ -2051,7 +2047,7 @@ static void acxpci_s_down(struct ieee802
** This will fail miserably if we'll be hit by concurrent
** iwconfig or something in between. TODO! */
printk("acxpci_s_down: flush_scheduled_work()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
flush_scheduled_work();
/* This is possible:
@@ -2065,7 +2061,7 @@ static void acxpci_s_down(struct ieee802
** ever happen because acx_i_timer() never does this if
** status is ACX_STATUS_0_STOPPED */
printk("acxpci_s_down: del_timer_sync()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
del_timer_sync(&adev->mgmt_timer);
FN_EXIT0;
@@ -2164,13 +2160,13 @@ static void acxpci_e_close(struct ieee80
FN_ENTER;
printk("putting interface DOWN - this is filled with printk's and will take 8-10 seconds!\n");
printk("acxpci_e_close: acx_lock()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
acx_lock(adev,flags);
/* ifdown device */
CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
if (adev->initialized) {
printk("acxpci_e_close: acxpci_s_down()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
acxpci_s_down(hw);
}
@@ -2188,7 +2184,7 @@ static void acxpci_e_close(struct ieee80
* frames because of dev->flags&IFF_UP is false.
*/
printk("acxpci_e_close: acx_unlock()\n");
- acx_s_mwait(1000);
+ acx_s_msleep(1000);
acx_unlock(adev,flags);
log(L_INIT, "closed device\n");
@@ -3499,8 +3495,7 @@ static void *allocate(acx_device_t * ade
{
void *ptr;
- ptr = dma_alloc_coherent(adev->pdev ? &adev->pdev->dev : NULL,
- size, phy, GFP_KERNEL);
+ ptr = dma_alloc_coherent(adev->bus_dev, size, phy, GFP_KERNEL);
if (ptr) {
log(L_DEBUG, "%s sz=%d adr=0x%p phy=0x%08llx\n",
diff -pru acx-mac80211-20080210.old/usb.c acx-mac80211-20080210/usb.c
--- acx-mac80211-20080210.old/usb.c 2008-02-10 21:06:50.000000000 +0100
+++ acx-mac80211-20080210/usb.c 2008-03-22 17:52:35.000000000 +0100
@@ -488,7 +488,7 @@ acxusb_boot(struct usb_device *usbdev, i
&& ((*(u16 *) usbbuf & 0x3fff) == 0)
&& ((*(u16 *) usbbuf & 0xc000) == 0xc000))
break;
- acx_s_mwait(10);
+ acx_s_msleep(10);
}
if (i == 2)
goto fw_end;
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel