From 92e225b7725c11e9644681fdefe40e2079b69226 Mon Sep 17 00:00:00 2001 From: David Planella Date: Sat, 31 May 2008 21:12:06 +0200 Subject: [PATCH] Reverted refactoring of 'interrogate' cmds to 'query' There is no need to rename this command. The name comes from the original reverse-engineered driver and is used in the Windows, FreeBSD, DragonFlyBSD and OpenBSD drivers. We do not want to break compatibility and have owr own command definitions. --- acx_func.h | 8 ++++---- acx_mmio.h | 2 +- common.c | 42 +++++++++++++++++++++--------------------- pci.c | 30 +++++++++++++++--------------- usb.c | 10 +++++----- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/acx_func.h b/acx_func.h index e8a0c13..0315c35 100644 --- a/acx_func.h +++ b/acx_func.h @@ -300,9 +300,9 @@ acx_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsig int acx_s_configure_debug(acx_device_t *adev, void *pdr, int type, const char* str); #define acx_s_configure(adev,pdr,type) \ acx_s_configure_debug(adev,pdr,type,#type) -int acx_s_query_debug(acx_device_t *adev, void *pdr, int type, const char* str); -#define acx_s_query(adev,pdr,type) \ - acx_s_query_debug(adev,pdr,type,#type) +int acx_s_interrogate_debug(acx_device_t *adev, void *pdr, int type, const char* str); +#define acx_s_interrogate(adev,pdr,type) \ + acx_s_interrogate_debug(adev,pdr,type,#type) #else @@ -323,7 +323,7 @@ acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len) return acxusb_s_issue_cmd_timeo(adev, cmd, param, len, ACX_CMD_TIMEOUT_DEFAULT); } int acx_s_configure(acx_device_t *adev, void *pdr, int type); -int acx_s_query(acx_device_t *adev, void *pdr, int type); +int acx_s_interrogate(acx_device_t *adev, void *pdr, int type); #endif diff --git a/acx_mmio.h b/acx_mmio.h index dcb0778..a02900e 100644 --- a/acx_mmio.h +++ b/acx_mmio.h @@ -42,7 +42,7 @@ * */ #define ACX1xx_CMD_RESET 0x00 -#define ACX1xx_CMD_QUERY 0x01 +#define ACX1xx_CMD_INTERROGATE 0x01 #define ACX1xx_CMD_CONFIGURE 0x02 #define ACX1xx_CMD_ENABLE_RX 0x03 #define ACX1xx_CMD_ENABLE_TX 0x04 diff --git a/common.c b/common.c index 7f78b73..3ce83e1 100644 --- a/common.c +++ b/common.c @@ -206,7 +206,7 @@ void acx_s_get_firmware_version(acx_device_t * adev) FN_ENTER; memset(fw.fw_id, 'E', FW_ID_SIZE); - acx_s_query(adev, &fw, ACX1xx_REG_FWREV); + acx_s_interrogate(adev, &fw, ACX1xx_REG_FWREV); memcpy(adev->firmware_version, fw.fw_id, FW_ID_SIZE); adev->firmware_version[FW_ID_SIZE] = '\0'; @@ -621,11 +621,11 @@ acx_s_configure_debug(acx_device_t * adev, void *pdr, int type, } #if !ACX_DEBUG -int acx_s_query(acx_device_t * adev, void *pdr, int type) +int acx_s_interrogate(acx_device_t * adev, void *pdr, int type) { #else int -acx_s_query_debug(acx_device_t * adev, void *pdr, int type, +acx_s_interrogate_debug(acx_device_t * adev, void *pdr, int type, const char *typestr) { #endif @@ -646,7 +646,7 @@ acx_s_query_debug(acx_device_t * adev, void *pdr, int type, ((acx_ie_generic_t *) pdr)->type = cpu_to_le16(type); ((acx_ie_generic_t *) pdr)->len = cpu_to_le16(len); - res = acx_s_issue_cmd(adev, ACX1xx_CMD_QUERY, pdr, len + 4); + res = acx_s_issue_cmd(adev, ACX1xx_CMD_INTERROGATE, pdr, len + 4); if (unlikely(OK != res)) { #if ACX_DEBUG acx_log(LOG_WARNING, L_ANY, @@ -683,7 +683,7 @@ void great_inquisitor(acx_device_t * adev) type = 0x1000; ie.type = cpu_to_le16(type); ie.len = cpu_to_le16(sizeof(ie) - 4); - acx_s_issue_cmd(adev, ACX1xx_CMD_QUERY, &ie, sizeof(ie)); + acx_s_issue_cmd(adev, ACX1xx_CMD_INTERROGATE, &ie, sizeof(ie)); } FN_EXIT0; } @@ -818,7 +818,7 @@ static int acx_s_proc_diag_output(char *buf, acx_device_t * adev) part_str = "statistics query command"; - if (OK != acx_s_query(adev, st, ACX1xx_REG_FIRMWARE_STATISTICS)) + if (OK != acx_s_interrogate(adev, st, ACX1xx_REG_FIRMWARE_STATISTICS)) goto fw_stats_end; st += sizeof(u16); @@ -1663,7 +1663,7 @@ acx111_s_get_feature_config(acx_device_t * adev, memset(&feat, 0, sizeof(feat)); - if (OK != acx_s_query(adev, &feat, ACX1xx_REG_FEATURE_CONFIG)) { + if (OK != acx_s_interrogate(adev, &feat, ACX1xx_REG_FEATURE_CONFIG)) { FN_EXIT1(NOT_OK); return NOT_OK; } @@ -1871,7 +1871,7 @@ static int acx100_s_create_dma_regions(acx_device_t * adev) FN_ENTER; /* read out the acx100 physical start address for the queues */ - if (OK != acx_s_query(adev, &memmap, ACX1xx_REG_MEMORY_MAP)) { + if (OK != acx_s_interrogate(adev, &memmap, ACX1xx_REG_MEMORY_MAP)) { goto fail; } @@ -1915,7 +1915,7 @@ static int acx100_s_create_dma_regions(acx_device_t * adev) acxpci_create_desc_queues(adev, tx_queue_start, rx_queue_start); } - if (OK != acx_s_query(adev, &memmap, ACX1xx_REG_MEMORY_MAP)) { + if (OK != acx_s_interrogate(adev, &memmap, ACX1xx_REG_MEMORY_MAP)) { goto fail; } @@ -2009,7 +2009,7 @@ static int acx111_s_create_dma_regions(acx_device_t * adev) goto fail; } - acx_s_query(adev, &queueconf, ACX1xx_REG_MEMORY_CONFIG_OPTIONS); + acx_s_interrogate(adev, &queueconf, ACX1xx_REG_MEMORY_CONFIG_OPTIONS); tx_queue_start = le32_to_cpu(queueconf.tx1_queue_address); rx_queue_start = le32_to_cpu(queueconf.rx1_queue_address); @@ -2831,7 +2831,7 @@ static int acx100_s_init_wep(acx_device_t * adev) FN_ENTER; - if (OK != acx_s_query(adev, &pt, ACX1xx_REG_MEMORY_MAP)) { + if (OK != acx_s_interrogate(adev, &pt, ACX1xx_REG_MEMORY_MAP)) { goto fail; } @@ -2877,7 +2877,7 @@ static int acx100_s_init_wep(acx_device_t * adev) */ /* now retrieve the updated WEPCacheEnd pointer... */ - if (OK != acx_s_query(adev, &pt, ACX1xx_REG_MEMORY_MAP)) { + if (OK != acx_s_interrogate(adev, &pt, ACX1xx_REG_MEMORY_MAP)) { acx_log(LOG_WARNING, L_ANY, "%s: ACX1xx_REG_MEMORY_MAP read #2 FAILED\n", wiphy_name(adev->ieee->wiphy)); @@ -3095,7 +3095,7 @@ static int acx_s_init_packet_templates(acx_device_t * adev) acx_log(LOG_DEBUG, L_REALLYVERBOSE, "sizeof(memmap)=%d bytes\n", (int)sizeof(mm)); - if (OK != acx_s_query(adev, &mm, ACX1xx_REG_MEMORY_MAP)) + if (OK != acx_s_interrogate(adev, &mm, ACX1xx_REG_MEMORY_MAP)) goto failed_acx100; mm.QueueStart = cpu_to_le32(le32_to_cpu(mm.PacketTemplateEnd) + 4); @@ -3216,7 +3216,7 @@ static void acx_s_update_80211_powersave_mode(acx_device_t * adev) adev->ps_wakeup_cfg, adev->ps_listen_interval, adev->ps_options, adev->ps_hangover_period, adev->ps_enhanced_transition_time); - acx_s_query(adev, &pm, ACX1xx_REG_POWER_MGMT); + acx_s_interrogate(adev, &pm, ACX1xx_REG_POWER_MGMT); acx_log(LOG_DEBUG, L_INIT, "Previous PS mode settings: " "wakeup_cfg 0x%02X, " "listen interval %u, options 0x%02X, " @@ -3243,11 +3243,11 @@ static void acx_s_update_80211_powersave_mode(acx_device_t * adev) cpu_to_le16(adev->ps_enhanced_transition_time); } acx_s_configure(adev, &pm, ACX1xx_REG_POWER_MGMT); - acx_s_query(adev, &pm, ACX1xx_REG_POWER_MGMT); + acx_s_interrogate(adev, &pm, ACX1xx_REG_POWER_MGMT); acx_log(LOG_DEBUG, L_INIT, "wakeup_cfg: 0x%02X\n", pm.acx111.wakeup_cfg); acx_s_mwait(40); - acx_s_query(adev, &pm, ACX1xx_REG_POWER_MGMT); + acx_s_interrogate(adev, &pm, ACX1xx_REG_POWER_MGMT); acx_log(LOG_DEBUG, L_INIT, "wakeup_cfg: 0x%02X\n", pm.acx111.wakeup_cfg); acx_log(LOG_DEBUG, L_INIT, "power save mode change %s\n", @@ -3389,7 +3389,7 @@ void acx_s_update_card_settings(acx_device_t *adev) u8 stationID[4 + ACX1xx_REG_DOT11_STATION_ID_LEN]; const u8 *paddr; - acx_s_query(adev, &stationID, ACX1xx_REG_DOT11_STATION_ID); + acx_s_interrogate(adev, &stationID, ACX1xx_REG_DOT11_STATION_ID); paddr = &stationID[4]; // memcpy(adev->dev_addr, adev->ndev->dev_addr, ETH_ALEN); for (i = 0; i < ETH_ALEN; i++) { @@ -3424,7 +3424,7 @@ void acx_s_update_card_settings(acx_device_t *adev) u8 antenna[4 + ACX1xx_REG_DOT11_CURRENT_ANTENNA_LEN]; memset(antenna, 0, sizeof(antenna)); - acx_s_query(adev, antenna, + acx_s_interrogate(adev, antenna, ACX1xx_REG_DOT11_CURRENT_ANTENNA); adev->antenna = antenna[4]; acx_log(LOG_INFO, L_INIT, "got antenna value 0x%02X\n", @@ -3437,7 +3437,7 @@ void acx_s_update_card_settings(acx_device_t *adev) u8 ed_threshold[4 + ACX100_REG_DOT11_ED_THRESHOLD_LEN]; memset(ed_threshold, 0, sizeof(ed_threshold)); - acx_s_query(adev, ed_threshold, + acx_s_interrogate(adev, ed_threshold, ACX100_REG_DOT11_ED_THRESHOLD); adev->ed_threshold = ed_threshold[4]; } else { @@ -3456,7 +3456,7 @@ void acx_s_update_card_settings(acx_device_t *adev) u8 cca[4 + ACX1xx_REG_DOT11_CURRENT_CCA_MODE_LEN]; memset(cca, 0, sizeof(adev->cca)); - acx_s_query(adev, cca, + acx_s_interrogate(adev, cca, ACX1xx_REG_DOT11_CURRENT_CCA_MODE); adev->cca = cca[4]; } else { @@ -3473,7 +3473,7 @@ void acx_s_update_card_settings(acx_device_t *adev) if (adev->get_mask & GETSET_REG_DOMAIN) { acx_ie_generic_t dom; - acx_s_query(adev, &dom, + acx_s_interrogate(adev, &dom, ACX1xx_REG_DOT11_CURRENT_REG_DOMAIN); adev->reg_dom_id = dom.m.bytes[0]; acx_s_set_sane_reg_domain(adev, 0); diff --git a/pci.c b/pci.c index b7d0eea..dd6b005 100644 --- a/pci.c +++ b/pci.c @@ -642,7 +642,7 @@ int acxpci_s_upload_radio(acx_device_t * adev) FN_ENTER; - acx_s_query(adev, &mm, ACX1xx_REG_MEMORY_MAP); + acx_s_interrogate(adev, &mm, ACX1xx_REG_MEMORY_MAP); offset = le32_to_cpu(mm.CodeEnd); snprintf(filename, sizeof(filename), "tiacx1%02dr%02X", @@ -689,7 +689,7 @@ int acxpci_s_upload_radio(acx_device_t * adev) &radioinit, sizeof(radioinit), CMD_TIMEOUT_MS(1000)); - res = acx_s_query(adev, &mm, ACX1xx_REG_MEMORY_MAP); + res = acx_s_interrogate(adev, &mm, ACX1xx_REG_MEMORY_MAP); fail: FN_EXIT1(res); return res; @@ -1021,7 +1021,7 @@ acxpci_s_issue_cmd_timeo_debug(acx_device_t * adev, goto bad; } - if (cmd != ACX1xx_CMD_QUERY) + if (cmd != ACX1xx_CMD_INTERROGATE) acx_log_dump(LOG_DEBUG, L_REALLYVERBOSE, buffer, buflen, "input buffer:\n"); @@ -1058,15 +1058,15 @@ acxpci_s_issue_cmd_timeo_debug(acx_device_t * adev, /* now write the parameters of the command if needed */ if (buffer && buflen) { - /* if it's an QUERY command, just pass the length + /* if it's an INTERROGATE command, just pass the length * of parameters to read, as data */ #if CMD_DISCOVERY - if (cmd == ACX1xx_CMD_QUERY) + if (cmd == ACX1xx_CMD_INTERROGATE) memset_io(adev->cmd_area + 4, 0xAA, buflen); #endif /* adev->cmd_area points to PCI device's memory, not to RAM! */ memcpy_toio(adev->cmd_area + 4, buffer, - (cmd == ACX1xx_CMD_QUERY) ? 4 : buflen); + (cmd == ACX1xx_CMD_INTERROGATE) ? 4 : buflen); } /* now write the actual command type */ acxpci_write_cmd_type_status(adev, cmd, 0); @@ -1158,7 +1158,7 @@ acxpci_s_issue_cmd_timeo_debug(acx_device_t * adev, } /* read in result parameters if needed */ - if (buffer && buflen && (cmd == ACX1xx_CMD_QUERY)) { + if (buffer && buflen && (cmd == ACX1xx_CMD_INTERROGATE)) { /* adev->cmd_area points to PCI device's memory, not to RAM! */ memcpy_fromio(buffer, adev->cmd_area + 4, buflen); acx_log_dump(LOG_DEBUG, L_REALLYVERBOSE, buffer, buflen, @@ -1661,7 +1661,7 @@ acxpci_e_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (IS_ACX111(adev)) { /* ACX111: configopt struct needs to be queried after full init */ - acx_s_query(adev, &co, ACX111_REG_CONFIG_OPTIONS); + acx_s_interrogate(adev, &co, ACX111_REG_CONFIG_OPTIONS); } /* TODO: merge them into one function, they are called just once and are the same for pci & usb */ if (OK != acxpci_read_eeprom_byte(adev, 0x05, &adev->eeprom_version)) @@ -2715,27 +2715,27 @@ acx111pci_ioctl_info(struct net_device *ndev, memset(&memconf, 0, sizeof(memconf)); /* BTW, fails with 12 (Write only) error code. ** Retained for easy testing of issue_cmd error handling :) */ - acx_s_query(adev, &memconf, ACX1xx_REG_QUEUE_CONFIG); + acx_s_interrogate(adev, &memconf, ACX1xx_REG_QUEUE_CONFIG); /* get Acx111 Queue Configuration */ memset(&queueconf, 0, sizeof(queueconf)); - acx_s_query(adev, &queueconf, ACX1xx_REG_MEMORY_CONFIG_OPTIONS); + acx_s_interrogate(adev, &queueconf, ACX1xx_REG_MEMORY_CONFIG_OPTIONS); /* get Acx111 Memory Map */ memset(memmap, 0, sizeof(memmap)); - acx_s_query(adev, &memmap, ACX1xx_REG_MEMORY_MAP); + acx_s_interrogate(adev, &memmap, ACX1xx_REG_MEMORY_MAP); /* get Acx111 Rx Config */ memset(rxconfig, 0, sizeof(rxconfig)); - acx_s_query(adev, &rxconfig, ACX1xx_REG_RXCONFIG); + acx_s_interrogate(adev, &rxconfig, ACX1xx_REG_RXCONFIG); /* get Acx111 fcs error count */ memset(fcserror, 0, sizeof(fcserror)); - acx_s_query(adev, &fcserror, ACX1xx_REG_FCS_ERROR_COUNT); + acx_s_interrogate(adev, &fcserror, ACX1xx_REG_FCS_ERROR_COUNT); /* get Acx111 rate fallback */ memset(ratefallback, 0, sizeof(ratefallback)); - acx_s_query(adev, &ratefallback, ACX1xx_REG_RATE_FALLBACK); + acx_s_interrogate(adev, &ratefallback, ACX1xx_REG_RATE_FALLBACK); /* force occurrence of a beacon interrupt */ /* TODO: comment why is this necessary */ @@ -4254,7 +4254,7 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev, if (OK != acx_s_init_mac(adev)) goto fail_init_mac; - acx_s_query(adev, &co, ACX111_REG_CONFIG_OPTIONS); + acx_s_interrogate(adev, &co, ACX111_REG_CONFIG_OPTIONS); /* TODO: merge them into one function, they are called just once and are the same for pci & usb */ if (OK != acxpci_read_eeprom_byte(adev, 0x05, &adev->eeprom_version)) goto fail_read_eeprom_version; diff --git a/usb.c b/usb.c index 5f00c67..fb1817b 100644 --- a/usb.c +++ b/usb.c @@ -311,9 +311,9 @@ acxusb_s_issue_cmd_timeo_debug(acx_device_t * adev, acklen = buflen + 4 + BOGUS_SAFETY_PADDING; blocklen = buflen; if (buffer && buflen) { - /* if it's an QUERY command, just pass the length + /* if it's an INTERROGATE command, just pass the length * of parameters to read, as data */ - if (cmd == ACX1xx_CMD_QUERY) { + if (cmd == ACX1xx_CMD_INTERROGATE) { blocklen = 4; acklen = buflen + 4; } @@ -373,7 +373,7 @@ acxusb_s_issue_cmd_timeo_debug(acx_device_t * adev, check for result==buflen+4? Was seen: query(type:ACX100_REG_DOT11_ED_THRESHOLD,len:4) -issue_cmd(cmd:ACX1xx_CMD_QUERY,buflen:8,type:4111) +issue_cmd(cmd:ACX1xx_CMD_INTERROGATE,buflen:8,type:4111) ctrl inpipe=0x80000280 outpipe=0x80000200 sending USB control msg (out) (blocklen=8) 01 00 00 00 0F 10 04 00 @@ -389,7 +389,7 @@ read 4 bytes <==== MUST BE 12!! devname, cmd_status, acx_cmd_status_str(cmd_status)); /* TODO: goto bad; ? */ } - if ((cmd == ACX1xx_CMD_QUERY) && buffer && buflen) { + if ((cmd == ACX1xx_CMD_INTERROGATE) && buffer && buflen) { memcpy(buffer, loc->data, buflen); acx_log(LOG_DEBUG, L_CTL, "response frame: cmd=0x%04X status=%d\n", @@ -707,7 +707,7 @@ static void acxusb_s_read_eeprom_version(acx_device_t * adev) u8 eeprom_ver[0x8]; memset(eeprom_ver, 0, sizeof(eeprom_ver)); - acx_s_query(adev, &eeprom_ver, ACX1FF_REG_EEPROM_VER); + acx_s_interrogate(adev, &eeprom_ver, ACX1FF_REG_EEPROM_VER); /* FIXME: which one of those values to take? */ adev->eeprom_version = eeprom_ver[5]; -- 2.11.4.GIT