Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.2-rc1. Another round of cleanups for staging drivers with no big additions. Overall more lines were removed than added, always a nice sign, with nothing happening in here other than general coding style cleanups and minor fixes in the drivers. Full, boring, details are in the shortlog. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (253 commits) vme: Use root_device_register() not underlined version staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE" vme: Fix error not catched in fake_init() staging: vme_user: remove multiple blank lines staging: r8188eu: use subtype helper in rtw_check_bcn_info staging: r8188eu: use subtype helpers in collect_bss_info staging: r8188eu: remove unused da parameter staging: r8188eu: merge two probereq_p2p functions staging: r8188eu: simplify err handling for unknown station staging: r8188eu: handle the non-ap case first staging: r8188eu: move bBusyTraffic update staging: r8188eu: read reason code from ieee80211_mgmt staging: r8188eu: use ieee80211_mgmt to parse addresses staging: r8188eu: remove a variable staging: r8188eu: simplify error handling for missing station staging: r8188eu: stop beacon processing if kmalloc fails staging: r8188eu: exit if beacon is not from our bss staging: r8188eu: simplify update_sta_support_rate params staging: r8188eu: use ie buffer in update_beacon_info staging: r8188eu: pass only ies to process_p2p_ps_ie ...
Unified · Split
| @@ -154,13 +154,13 @@ static inline uint64_t cvmx_build_bits(uint64_t high_bit, · 153 unmodified lines | |||
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * Convert a memory pointer (void*) into a hardware compatible | 156 | * Convert a memory pointer (void*) into a hardware compatible |
| 157 | * memory address (uint64_t). Octeon hardware widgets don't | 157 | * memory address (phys_addr_t). Octeon hardware widgets don't |
| 158 | * understand logical addresses. | 158 | * understand logical addresses. |
| 159 | * | 159 | * |
| 160 | * @ptr: C style memory pointer | 160 | * @ptr: C style memory pointer |
| 161 | * Returns Hardware physical address | 161 | * Returns Hardware physical address |
| 162 | */ | 162 | */ |
| 163 | static inline uint64_t cvmx_ptr_to_phys(void *ptr) | 163 | static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) |
| 164 | { | 164 | { |
| 165 | if (sizeof(void *) == 8) { | 165 | if (sizeof(void *) == 8) { |
| 166 | /* | 166 | /* |
| @@ -1004,10 +1004,7 @@ static int _nbu2ss_in_dma(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, · 1003 unmodified lines | |||
| 1004 | /* MAX Packet Size */ | 1004 | /* MAX Packet Size */ |
| 1005 | mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPN_MPKT; | 1005 | mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPN_MPKT; |
| 1006 | 1006 | ||
| 1007 | if ((DMA_MAX_COUNT * mpkt) < length) | 1007 | i_write_length = min(DMA_MAX_COUNT * mpkt, length); |
| 1008 | i_write_length = DMA_MAX_COUNT * mpkt; | ||
| 1009 | else | ||
| 1010 | i_write_length = length; | ||
| 1011 | 1008 | ||
| 1012 | /*------------------------------------------------------------*/ | 1009 | /*------------------------------------------------------------*/ |
| 1013 | /* Number of transmission packets */ | 1010 | /* Number of transmission packets */ |
| @@ -28,7 +28,7 @@ static ssize_t online_show(struct device *dev, struct device_attribute *attr, · 27 unmodified lines | |||
| 28 | { | 28 | { |
| 29 | struct fieldbus_dev *fb = dev_get_drvdata(dev); | 29 | struct fieldbus_dev *fb = dev_get_drvdata(dev); |
| 30 | 30 | ||
| 31 | return sprintf(buf, "%d\n", !!fb->online); | 31 | return sysfs_emit(buf, "%d\n", !!fb->online); |
| 32 | } | 32 | } |
| 33 | static DEVICE_ATTR_RO(online); | 33 | static DEVICE_ATTR_RO(online); |
| 34 | 34 | ||
| @@ -39,7 +39,7 @@ static ssize_t enabled_show(struct device *dev, struct device_attribute *attr, · 4 unmodified lines | |||
| 39 | 39 | ||
| 40 | if (!fb->enable_get) | 40 | if (!fb->enable_get) |
| 41 | return -EINVAL; | 41 | return -EINVAL; |
| 42 | return sprintf(buf, "%d\n", !!fb->enable_get(fb)); | 42 | return sysfs_emit(buf, "%d\n", !!fb->enable_get(fb)); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static ssize_t enabled_store(struct device *dev, struct device_attribute *attr, | 45 | static ssize_t enabled_store(struct device *dev, struct device_attribute *attr, |
| @@ -66,11 +66,8 @@ static ssize_t card_name_show(struct device *dev, struct device_attribute *attr, · 20 unmodified lines | |||
| 66 | { | 66 | { |
| 67 | struct fieldbus_dev *fb = dev_get_drvdata(dev); | 67 | struct fieldbus_dev *fb = dev_get_drvdata(dev); |
| 68 | 68 | ||
| 69 | /* | 69 | /* card_name was provided by child driver. */ |
| 70 | * card_name was provided by child driver, could potentially be long. | 70 | return sysfs_emit(buf, "%s\n", fb->card_name); |
| 71 | * protect against buffer overrun. | ||
| 72 | */ | ||
| 73 | return snprintf(buf, PAGE_SIZE, "%s\n", fb->card_name); | ||
| 74 | } | 71 | } |
| 75 | static DEVICE_ATTR_RO(card_name); | 72 | static DEVICE_ATTR_RO(card_name); |
| 76 | 73 | ||
| @@ -79,7 +76,7 @@ static ssize_t read_area_size_show(struct device *dev, · 2 unmodified lines | |||
| 79 | { | 76 | { |
| 80 | struct fieldbus_dev *fb = dev_get_drvdata(dev); | 77 | struct fieldbus_dev *fb = dev_get_drvdata(dev); |
| 81 | 78 | ||
| 82 | return sprintf(buf, "%zu\n", fb->read_area_sz); | 79 | return sysfs_emit(buf, "%zu\n", fb->read_area_sz); |
| 83 | } | 80 | } |
| 84 | static DEVICE_ATTR_RO(read_area_size); | 81 | static DEVICE_ATTR_RO(read_area_size); |
| 85 | 82 | ||
| @@ -88,7 +85,7 @@ static ssize_t write_area_size_show(struct device *dev, · 2 unmodified lines | |||
| 88 | { | 85 | { |
| 89 | struct fieldbus_dev *fb = dev_get_drvdata(dev); | 86 | struct fieldbus_dev *fb = dev_get_drvdata(dev); |
| 90 | 87 | ||
| 91 | return sprintf(buf, "%zu\n", fb->write_area_sz); | 88 | return sysfs_emit(buf, "%zu\n", fb->write_area_sz); |
| 92 | } | 89 | } |
| 93 | static DEVICE_ATTR_RO(write_area_size); | 90 | static DEVICE_ATTR_RO(write_area_size); |
| 94 | 91 | ||
| @@ -116,7 +113,7 @@ static ssize_t fieldbus_type_show(struct device *dev, · 21 unmodified lines | |||
| 116 | break; | 113 | break; |
| 117 | } | 114 | } |
| 118 | 115 | ||
| 119 | return sprintf(buf, "%s\n", t); | 116 | return sysfs_emit(buf, "%s\n", t); |
| 120 | } | 117 | } |
| 121 | static DEVICE_ATTR_RO(fieldbus_type); | 118 | static DEVICE_ATTR_RO(fieldbus_type); |
| 122 | 119 | ||
| @@ -21,7 +21,10 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | #define MUX_TX_MAX_SIZE 2048 | 22 | #define MUX_TX_MAX_SIZE 2048 |
| 23 | 23 | ||
| 24 | #define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) | 24 | static inline bool gdm_tty_ready(struct gdm *gdm) |
| 25 | { | ||
| 26 | return gdm && gdm->tty_dev && gdm->port.count; | ||
| 27 | } | ||
| 25 | 28 | ||
| 26 | static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; | 29 | static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; |
| 27 | static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; | 30 | static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; |
| @@ -113,7 +116,7 @@ static int gdm_tty_recv_complete(void *data, · 85 unmodified lines | |||
| 113 | { | 116 | { |
| 114 | struct gdm *gdm = tty_dev->gdm[index]; | 117 | struct gdm *gdm = tty_dev->gdm[index]; |
| 115 | 118 | ||
| 116 | if (!GDM_TTY_READY(gdm)) { | 119 | if (!gdm_tty_ready(gdm)) { |
| 117 | if (complete == RECV_PACKET_PROCESS_COMPLETE) | 120 | if (complete == RECV_PACKET_PROCESS_COMPLETE) |
| 118 | gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev, | 121 | gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev, |
| 119 | gdm_tty_recv_complete); | 122 | gdm_tty_recv_complete); |
| @@ -140,7 +143,7 @@ static void gdm_tty_send_complete(void *arg) · 20 unmodified lines | |||
| 140 | { | 143 | { |
| 141 | struct gdm *gdm = arg; | 144 | struct gdm *gdm = arg; |
| 142 | 145 | ||
| 143 | if (!GDM_TTY_READY(gdm)) | 146 | if (!gdm_tty_ready(gdm)) |
| 144 | return; | 147 | return; |
| 145 | 148 | ||
| 146 | tty_port_tty_wakeup(&gdm->port); | 149 | tty_port_tty_wakeup(&gdm->port); |
| @@ -154,7 +157,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, · 7 unmodified lines | |||
| 154 | int sent_len = 0; | 157 | int sent_len = 0; |
| 155 | int sending_len = 0; | 158 | int sending_len = 0; |
| 156 | 159 | ||
| 157 | if (!GDM_TTY_READY(gdm)) | 160 | if (!gdm_tty_ready(gdm)) |
| 158 | return -ENODEV; | 161 | return -ENODEV; |
| 159 | 162 | ||
| 160 | if (!len) | 163 | if (!len) |
| @@ -181,7 +184,7 @@ static unsigned int gdm_tty_write_room(struct tty_struct *tty) · 20 unmodified lines | |||
| 181 | { | 184 | { |
| 182 | struct gdm *gdm = tty->driver_data; | 185 | struct gdm *gdm = tty->driver_data; |
| 183 | 186 | ||
| 184 | if (!GDM_TTY_READY(gdm)) | 187 | if (!gdm_tty_ready(gdm)) |
| 185 | return 0; | 188 | return 0; |
| 186 | 189 | ||
| 187 | return WRITE_SIZE; | 190 | return WRITE_SIZE; |
| @@ -239,7 +239,6 @@ static void show_loopback_devices(struct loopback_test *t) · 238 unmodified lines | |||
| 239 | 239 | ||
| 240 | for (i = 0; i < t->device_count; i++) | 240 | for (i = 0; i < t->device_count; i++) |
| 241 | printf("device[%d] = %s\n", i, t->devices[i].name); | 241 | printf("device[%d] = %s\n", i, t->devices[i].name); |
| 242 | |||
| 243 | } | 242 | } |
| 244 | 243 | ||
| 245 | int open_sysfs(const char *sys_pfx, const char *node, int flags) | 244 | int open_sysfs(const char *sys_pfx, const char *node, int flags) |
| @@ -274,7 +273,6 @@ float read_sysfs_float_fd(int fd, const char *sys_pfx, const char *node) · 28 unmodified lines | |||
| 274 | char buf[SYSFS_MAX_INT]; | 273 | char buf[SYSFS_MAX_INT]; |
| 275 | 274 | ||
| 276 | if (read(fd, buf, sizeof(buf)) < 0) { | 275 | if (read(fd, buf, sizeof(buf)) < 0) { |
| 277 | |||
| 278 | fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node, | 276 | fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node, |
| 279 | strerror(errno)); | 277 | strerror(errno)); |
| 280 | close(fd); | 278 | close(fd); |
| @@ -367,7 +365,6 @@ static int get_results(struct loopback_test *t) · 86 unmodified lines | |||
| 367 | r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; | 365 | r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; |
| 368 | r->gbphy_firmware_latency_jitter = | 366 | r->gbphy_firmware_latency_jitter = |
| 369 | r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; | 367 | r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; |
| 370 | |||
| 371 | } | 368 | } |
| 372 | 369 | ||
| 373 | /*calculate the aggregate results of all enabled devices */ | 370 | /*calculate the aggregate results of all enabled devices */ |
| @@ -407,7 +404,6 @@ static int get_results(struct loopback_test *t) · 33 unmodified lines | |||
| 407 | r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; | 404 | r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; |
| 408 | r->gbphy_firmware_latency_jitter = | 405 | r->gbphy_firmware_latency_jitter = |
| 409 | r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; | 406 | r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; |
| 410 | |||
| 411 | } | 407 | } |
| 412 | 408 | ||
| 413 | return 0; | 409 | return 0; |
| @@ -536,7 +532,6 @@ static int log_results(struct loopback_test *t) · 122 unmodified lines | |||
| 536 | fprintf(stderr, "unable to open %s for appending\n", file_name); | 532 | fprintf(stderr, "unable to open %s for appending\n", file_name); |
| 537 | abort(); | 533 | abort(); |
| 538 | } | 534 | } |
| 539 | |||
| 540 | } | 535 | } |
| 541 | for (i = 0; i < t->device_count; i++) { | 536 | for (i = 0; i < t->device_count; i++) { |
| 542 | if (!device_enabled(t, i)) | 537 | if (!device_enabled(t, i)) |
| @@ -550,10 +545,8 @@ static int log_results(struct loopback_test *t) · 7 unmodified lines | |||
| 550 | if (ret == -1) | 545 | if (ret == -1) |
| 551 | fprintf(stderr, "unable to write %d bytes to csv.\n", len); | 546 | fprintf(stderr, "unable to write %d bytes to csv.\n", len); |
| 552 | } | 547 | } |
| 553 | |||
| 554 | } | 548 | } |
| 555 | 549 | ||
| 556 | |||
| 557 | if (t->aggregate_output) { | 550 | if (t->aggregate_output) { |
| 558 | len = format_output(t, &t->aggregate_results, "aggregate", | 551 | len = format_output(t, &t->aggregate_results, "aggregate", |
| 559 | data, sizeof(data), &tm); | 552 | data, sizeof(data), &tm); |
| @@ -675,6 +668,7 @@ err: · 115 unmodified lines | |||
| 675 | static int close_poll_files(struct loopback_test *t) | 668 | static int close_poll_files(struct loopback_test *t) |
| 676 | { | 669 | { |
| 677 | int i; | 670 | int i; |
| 671 | |||
| 678 | for (i = 0; i < t->poll_count; i++) | 672 | for (i = 0; i < t->poll_count; i++) |
| 679 | close(t->fds[i].fd); | 673 | close(t->fds[i].fd); |
| 680 | 674 | ||
| @@ -740,7 +734,6 @@ static int wait_for_complete(struct loopback_test *t) · 59 unmodified lines | |||
| 740 | ts = &t->poll_timeout; | 734 | ts = &t->poll_timeout; |
| 741 | 735 | ||
| 742 | while (1) { | 736 | while (1) { |
| 743 | |||
| 744 | ret = ppoll(t->fds, t->poll_count, ts, &mask_old); | 737 | ret = ppoll(t->fds, t->poll_count, ts, &mask_old); |
| 745 | if (ret <= 0) { | 738 | if (ret <= 0) { |
| 746 | stop_tests(t); | 739 | stop_tests(t); |
| @@ -780,7 +773,6 @@ static void prepare_devices(struct loopback_test *t) · 33 unmodified lines | |||
| 780 | if (t->stop_all || device_enabled(t, i)) | 773 | if (t->stop_all || device_enabled(t, i)) |
| 781 | write_sysfs_val(t->devices[i].sysfs_entry, "type", 0); | 774 | write_sysfs_val(t->devices[i].sysfs_entry, "type", 0); |
| 782 | 775 | ||
| 783 | |||
| 784 | for (i = 0; i < t->device_count; i++) { | 776 | for (i = 0; i < t->device_count; i++) { |
| 785 | if (!device_enabled(t, i)) | 777 | if (!device_enabled(t, i)) |
| 786 | continue; | 778 | continue; |
| @@ -823,7 +815,6 @@ static int start(struct loopback_test *t) · 36 unmodified lines | |||
| 823 | return 0; | 815 | return 0; |
| 824 | } | 816 | } |
| 825 | 817 | ||
| 826 | |||
| 827 | void loopback_run(struct loopback_test *t) | 818 | void loopback_run(struct loopback_test *t) |
| 828 | { | 819 | { |
| 829 | int i; | 820 | int i; |
| @@ -852,7 +843,6 @@ void loopback_run(struct loopback_test *t) · 22 unmodified lines | |||
| 852 | if (ret) | 843 | if (ret) |
| 853 | goto err; | 844 | goto err; |
| 854 | 845 | ||
| 855 | |||
| 856 | get_results(t); | 846 | get_results(t); |
| 857 | 847 | ||
| 858 | log_results(t); | 848 | log_results(t); |
| @@ -861,7 +851,6 @@ void loopback_run(struct loopback_test *t) · 2 unmodified lines | |||
| 861 | 851 | ||
| 862 | err: | 852 | err: |
| 863 | printf("Error running test\n"); | 853 | printf("Error running test\n"); |
| 864 | return; | ||
| 865 | } | 854 | } |
| 866 | 855 | ||
| 867 | static int sanity_check(struct loopback_test *t) | 856 | static int sanity_check(struct loopback_test *t) |
| @@ -881,10 +870,8 @@ static int sanity_check(struct loopback_test *t) · 13 unmodified lines | |||
| 881 | fprintf(stderr, "Bad device mask %x\n", (1 << i)); | 870 | fprintf(stderr, "Bad device mask %x\n", (1 << i)); |
| 882 | return -1; | 871 | return -1; |
| 883 | } | 872 | } |
| 884 | |||
| 885 | } | 873 | } |
| 886 | 874 | ||
| 887 | |||
| 888 | return 0; | 875 | return 0; |
| 889 | } | 876 | } |
| 890 | 877 | ||
| @@ -331,11 +331,9 @@ static IIO_DEV_ATTR_PHASE(0, 1, 0200, NULL, ad9834_write, AD9834_REG_PHASE1); · 330 unmodified lines | |||
| 331 | static IIO_DEV_ATTR_PHASESYMBOL(0, 0200, NULL, ad9834_write, AD9834_PSEL); | 331 | static IIO_DEV_ATTR_PHASESYMBOL(0, 0200, NULL, ad9834_write, AD9834_PSEL); |
| 332 | static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/ | 332 | static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/ |
| 333 | 333 | ||
| 334 | static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, | 334 | static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, ad9834_write, AD9834_PIN_SW); |
| 335 | ad9834_write, AD9834_PIN_SW); | ||
| 336 | static IIO_DEV_ATTR_OUT_ENABLE(0, 0200, NULL, ad9834_write, AD9834_RESET); | 335 | static IIO_DEV_ATTR_OUT_ENABLE(0, 0200, NULL, ad9834_write, AD9834_RESET); |
| 337 | static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, | 336 | static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, ad9834_write, AD9834_OPBITEN); |
| 338 | ad9834_write, AD9834_OPBITEN); | ||
| 339 | static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0); | 337 | static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0); |
| 340 | static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1); | 338 | static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1); |
| 341 | 339 | ||
| @@ -109,8 +109,7 @@ unlock: · 108 unmodified lines | |||
| 109 | return ret; | 109 | return ret; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static int ade7854_i2c_probe(struct i2c_client *client, | 112 | static int ade7854_i2c_probe(struct i2c_client *client) |
| 113 | const struct i2c_device_id *id) | ||
| 114 | { | 113 | { |
| 115 | struct ade7854_state *st; | 114 | struct ade7854_state *st; |
| 116 | struct iio_dev *indio_dev; | 115 | struct iio_dev *indio_dev; |
| @@ -141,7 +140,7 @@ static struct i2c_driver ade7854_i2c_driver = { · 24 unmodified lines | |||
| 141 | .driver = { | 140 | .driver = { |
| 142 | .name = "ade7854", | 141 | .name = "ade7854", |
| 143 | }, | 142 | }, |
| 144 | .probe = ade7854_i2c_probe, | 143 | .probe_new = ade7854_i2c_probe, |
| 145 | .id_table = ade7854_id, | 144 | .id_table = ade7854_id, |
| 146 | }; | 145 | }; |
| 147 | module_i2c_driver(ade7854_i2c_driver); | 146 | module_i2c_driver(ade7854_i2c_driver); |
| @@ -27,6 +27,9 @@ Now the TODOs: · 26 unmodified lines | |||
| 27 | - fix the 'card removal' event when card is inserted when booting | 27 | - fix the 'card removal' event when card is inserted when booting |
| 28 | - check what other upstream wireless mechanisms can be used instead of the | 28 | - check what other upstream wireless mechanisms can be used instead of the |
| 29 | custom ones here | 29 | custom ones here |
| 30 | - Switch to use LIB80211. | ||
| 31 | - Switch to use MAC80211. | ||
| 32 | - Switch to use CFG80211. | ||
| 30 | 33 | ||
| 31 | Please send any patches to: | 34 | Please send any patches to: |
| 32 | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 35 | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| @@ -1763,8 +1763,8 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev) · 1762 unmodified lines | |||
| 1763 | } | 1763 | } |
| 1764 | 1764 | ||
| 1765 | static int ks_wlan_set_stop_request(struct net_device *dev, | 1765 | static int ks_wlan_set_stop_request(struct net_device *dev, |
| 1766 | struct iw_request_info *info, __u32 *uwrq, | 1766 | struct iw_request_info *info, |
| 1767 | char *extra) | 1767 | union iwreq_data *uwrq, char *extra) |
| 1768 | { | 1768 | { |
| 1769 | struct ks_wlan_private *priv = netdev_priv(dev); | 1769 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1770 | 1770 | ||
| @@ -1772,7 +1772,7 @@ static int ks_wlan_set_stop_request(struct net_device *dev, · 1 unmodified line | |||
| 1772 | return -EPERM; | 1772 | return -EPERM; |
| 1773 | 1773 | ||
| 1774 | /* for SLEEP MODE */ | 1774 | /* for SLEEP MODE */ |
| 1775 | if (!(*uwrq)) | 1775 | if (!(uwrq->mode)) |
| 1776 | return -EINVAL; | 1776 | return -EINVAL; |
| 1777 | 1777 | ||
| 1778 | hostif_sme_enqueue(priv, SME_STOP_REQUEST); | 1778 | hostif_sme_enqueue(priv, SME_STOP_REQUEST); |
| @@ -1786,7 +1786,9 @@ static int ks_wlan_set_mlme(struct net_device *dev, · 7 unmodified lines | |||
| 1786 | { | 1786 | { |
| 1787 | struct ks_wlan_private *priv = netdev_priv(dev); | 1787 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1788 | struct iw_mlme *mlme = (struct iw_mlme *)extra; | 1788 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
| 1789 | __u32 mode = 1; | 1789 | union iwreq_data uwrq; |
| 1790 | |||
| 1791 | uwrq.mode = 1; | ||
| 1790 | 1792 | ||
| 1791 | if (priv->sleep_mode == SLP_SLEEP) | 1793 | if (priv->sleep_mode == SLP_SLEEP) |
| 1792 | return -EPERM; | 1794 | return -EPERM; |
| @@ -1799,13 +1801,14 @@ static int ks_wlan_set_mlme(struct net_device *dev, · 6 unmodified lines | |||
| 1799 | mlme->reason_code == WLAN_REASON_MIC_FAILURE) | 1801 | mlme->reason_code == WLAN_REASON_MIC_FAILURE) |
| 1800 | return 0; | 1802 | return 0; |
| 1801 | 1803 | ||
| 1802 | return ks_wlan_set_stop_request(dev, NULL, &mode, NULL); | 1804 | return ks_wlan_set_stop_request(dev, NULL, &uwrq, NULL); |
| 1803 | } | 1805 | } |
| 1804 | 1806 | ||
| 1805 | static int ks_wlan_get_firmware_version(struct net_device *dev, | 1807 | static int ks_wlan_get_firmware_version(struct net_device *dev, |
| 1806 | struct iw_request_info *info, | 1808 | struct iw_request_info *info, |
| 1807 | struct iw_point *dwrq, char *extra) | 1809 | union iwreq_data *uwrq, char *extra) |
| 1808 | { | 1810 | { |
| 1811 | struct iw_point *dwrq = &uwrq->data; | ||
| 1809 | struct ks_wlan_private *priv = netdev_priv(dev); | 1812 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1810 | 1813 | ||
| 1811 | dwrq->length = priv->version_size + 1; | 1814 | dwrq->length = priv->version_size + 1; |
| @@ -1814,8 +1817,8 @@ static int ks_wlan_get_firmware_version(struct net_device *dev, · 2 unmodified lines | |||
| 1814 | } | 1817 | } |
| 1815 | 1818 | ||
| 1816 | static int ks_wlan_set_preamble(struct net_device *dev, | 1819 | static int ks_wlan_set_preamble(struct net_device *dev, |
| 1817 | struct iw_request_info *info, __u32 *uwrq, | 1820 | struct iw_request_info *info, |
| 1818 | char *extra) | 1821 | union iwreq_data *uwrq, char *extra) |
| 1819 | { | 1822 | { |
| 1820 | struct ks_wlan_private *priv = netdev_priv(dev); | 1823 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1821 | 1824 | ||
| @@ -1823,17 +1826,17 @@ static int ks_wlan_set_preamble(struct net_device *dev, · 1 unmodified line | |||
| 1823 | return -EPERM; | 1826 | return -EPERM; |
| 1824 | 1827 | ||
| 1825 | /* for SLEEP MODE */ | 1828 | /* for SLEEP MODE */ |
| 1826 | if (*uwrq != LONG_PREAMBLE && *uwrq != SHORT_PREAMBLE) | 1829 | if (uwrq->mode != LONG_PREAMBLE && uwrq->mode != SHORT_PREAMBLE) |
| 1827 | return -EINVAL; | 1830 | return -EINVAL; |
| 1828 | 1831 | ||
| 1829 | priv->reg.preamble = *uwrq; | 1832 | priv->reg.preamble = uwrq->mode; |
| 1830 | priv->need_commit |= SME_MODE_SET; | 1833 | priv->need_commit |= SME_MODE_SET; |
| 1831 | return -EINPROGRESS; /* Call commit handler */ | 1834 | return -EINPROGRESS; /* Call commit handler */ |
| 1832 | } | 1835 | } |
| 1833 | 1836 | ||
| 1834 | static int ks_wlan_get_preamble(struct net_device *dev, | 1837 | static int ks_wlan_get_preamble(struct net_device *dev, |
| 1835 | struct iw_request_info *info, __u32 *uwrq, | 1838 | struct iw_request_info *info, |
| 1836 | char *extra) | 1839 | union iwreq_data *uwrq, char *extra) |
| 1837 | { | 1840 | { |
| 1838 | struct ks_wlan_private *priv = netdev_priv(dev); | 1841 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1839 | 1842 | ||
| @@ -1841,37 +1844,37 @@ static int ks_wlan_get_preamble(struct net_device *dev, · 1 unmodified line | |||
| 1841 | return -EPERM; | 1844 | return -EPERM; |
| 1842 | 1845 | ||
| 1843 | /* for SLEEP MODE */ | 1846 | /* for SLEEP MODE */ |
| 1844 | *uwrq = priv->reg.preamble; | 1847 | uwrq->mode = priv->reg.preamble; |
| 1845 | return 0; | 1848 | return 0; |
| 1846 | } | 1849 | } |
| 1847 | 1850 | ||
| 1848 | static int ks_wlan_set_power_mgmt(struct net_device *dev, | 1851 | static int ks_wlan_set_power_mgmt(struct net_device *dev, |
| 1849 | struct iw_request_info *info, __u32 *uwrq, | 1852 | struct iw_request_info *info, |
| 1850 | char *extra) | 1853 | union iwreq_data *uwrq, char *extra) |
| 1851 | { | 1854 | { |
| 1852 | struct ks_wlan_private *priv = netdev_priv(dev); | 1855 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1853 | 1856 | ||
| 1854 | if (priv->sleep_mode == SLP_SLEEP) | 1857 | if (priv->sleep_mode == SLP_SLEEP) |
| 1855 | return -EPERM; | 1858 | return -EPERM; |
| 1856 | 1859 | ||
| 1857 | if (*uwrq != POWER_MGMT_ACTIVE && | 1860 | if (uwrq->mode != POWER_MGMT_ACTIVE && |
| 1858 | *uwrq != POWER_MGMT_SAVE1 && | 1861 | uwrq->mode != POWER_MGMT_SAVE1 && |
| 1859 | *uwrq != POWER_MGMT_SAVE2) | 1862 | uwrq->mode != POWER_MGMT_SAVE2) |
| 1860 | return -EINVAL; | 1863 | return -EINVAL; |
| 1861 | 1864 | ||
| 1862 | if ((*uwrq == POWER_MGMT_SAVE1 || *uwrq == POWER_MGMT_SAVE2) && | 1865 | if ((uwrq->mode == POWER_MGMT_SAVE1 || uwrq->mode == POWER_MGMT_SAVE2) && |
| 1863 | (priv->reg.operation_mode != MODE_INFRASTRUCTURE)) | 1866 | (priv->reg.operation_mode != MODE_INFRASTRUCTURE)) |
| 1864 | return -EINVAL; | 1867 | return -EINVAL; |
| 1865 | 1868 | ||
| 1866 | priv->reg.power_mgmt = *uwrq; | 1869 | priv->reg.power_mgmt = uwrq->mode; |
| 1867 | hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); | 1870 | hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); |
| 1868 | 1871 | ||
| 1869 | return 0; | 1872 | return 0; |
| 1870 | } | 1873 | } |
| 1871 | 1874 | ||
| 1872 | static int ks_wlan_get_power_mgmt(struct net_device *dev, | 1875 | static int ks_wlan_get_power_mgmt(struct net_device *dev, |
| 1873 | struct iw_request_info *info, __u32 *uwrq, | 1876 | struct iw_request_info *info, |
| 1874 | char *extra) | 1877 | union iwreq_data *uwrq, char *extra) |
| 1875 | { | 1878 | { |
| 1876 | struct ks_wlan_private *priv = netdev_priv(dev); | 1879 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1877 | 1880 | ||
| @@ -1879,13 +1882,13 @@ static int ks_wlan_get_power_mgmt(struct net_device *dev, · 1 unmodified line | |||
| 1879 | return -EPERM; | 1882 | return -EPERM; |
| 1880 | 1883 | ||
| 1881 | /* for SLEEP MODE */ | 1884 | /* for SLEEP MODE */ |
| 1882 | *uwrq = priv->reg.power_mgmt; | 1885 | uwrq->mode = priv->reg.power_mgmt; |
| 1883 | return 0; | 1886 | return 0; |
| 1884 | } | 1887 | } |
| 1885 | 1888 | ||
| 1886 | static int ks_wlan_set_scan_type(struct net_device *dev, | 1889 | static int ks_wlan_set_scan_type(struct net_device *dev, |
| 1887 | struct iw_request_info *info, __u32 *uwrq, | 1890 | struct iw_request_info *info, |
| 1888 | char *extra) | 1891 | union iwreq_data *uwrq, char *extra) |
| 1889 | { | 1892 | { |
| 1890 | struct ks_wlan_private *priv = netdev_priv(dev); | 1893 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1891 | 1894 | ||
| @@ -1893,39 +1896,39 @@ static int ks_wlan_set_scan_type(struct net_device *dev, · 1 unmodified line | |||
| 1893 | return -EPERM; | 1896 | return -EPERM; |
| 1894 | /* for SLEEP MODE */ | 1897 | /* for SLEEP MODE */ |
| 1895 | 1898 | ||
| 1896 | if (*uwrq != ACTIVE_SCAN && *uwrq != PASSIVE_SCAN) | 1899 | if (uwrq->mode != ACTIVE_SCAN && uwrq->mode != PASSIVE_SCAN) |
| 1897 | return -EINVAL; | 1900 | return -EINVAL; |
| 1898 | 1901 | ||
| 1899 | priv->reg.scan_type = *uwrq; | 1902 | priv->reg.scan_type = uwrq->mode; |
| 1900 | return 0; | 1903 | return 0; |
| 1901 | } | 1904 | } |
| 1902 | 1905 | ||
| 1903 | static int ks_wlan_get_scan_type(struct net_device *dev, | 1906 | static int ks_wlan_get_scan_type(struct net_device *dev, |
| 1904 | struct iw_request_info *info, __u32 *uwrq, | 1907 | struct iw_request_info *info, |
| 1905 | char *extra) | 1908 | union iwreq_data *uwrq, char *extra) |
| 1906 | { | 1909 | { |
| 1907 | struct ks_wlan_private *priv = netdev_priv(dev); | 1910 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1908 | 1911 | ||
| 1909 | if (priv->sleep_mode == SLP_SLEEP) | 1912 | if (priv->sleep_mode == SLP_SLEEP) |
| 1910 | return -EPERM; | 1913 | return -EPERM; |
| 1911 | /* for SLEEP MODE */ | 1914 | /* for SLEEP MODE */ |
| 1912 | *uwrq = priv->reg.scan_type; | 1915 | uwrq->mode = priv->reg.scan_type; |
| 1913 | return 0; | 1916 | return 0; |
| 1914 | } | 1917 | } |
| 1915 | 1918 | ||
| 1916 | static int ks_wlan_set_beacon_lost(struct net_device *dev, | 1919 | static int ks_wlan_set_beacon_lost(struct net_device *dev, |
| 1917 | struct iw_request_info *info, __u32 *uwrq, | 1920 | struct iw_request_info *info, |
| 1918 | char *extra) | 1921 | union iwreq_data *uwrq, char *extra) |
| 1919 | { | 1922 | { |
| 1920 | struct ks_wlan_private *priv = netdev_priv(dev); | 1923 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1921 | 1924 | ||
| 1922 | if (priv->sleep_mode == SLP_SLEEP) | 1925 | if (priv->sleep_mode == SLP_SLEEP) |
| 1923 | return -EPERM; | 1926 | return -EPERM; |
| 1924 | /* for SLEEP MODE */ | 1927 | /* for SLEEP MODE */ |
| 1925 | if (*uwrq > BEACON_LOST_COUNT_MAX) | 1928 | if (uwrq->mode > BEACON_LOST_COUNT_MAX) |
| 1926 | return -EINVAL; | 1929 | return -EINVAL; |
| 1927 | 1930 | ||
| 1928 | priv->reg.beacon_lost_count = *uwrq; | 1931 | priv->reg.beacon_lost_count = uwrq->mode; |
| 1929 | 1932 | ||
| 1930 | if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) { | 1933 | if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) { |
| 1931 | priv->need_commit |= SME_MODE_SET; | 1934 | priv->need_commit |= SME_MODE_SET; |
| @@ -1936,101 +1939,101 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, · 4 unmodified lines | |||
| 1936 | } | 1939 | } |
| 1937 | 1940 | ||
| 1938 | static int ks_wlan_get_beacon_lost(struct net_device *dev, | 1941 | static int ks_wlan_get_beacon_lost(struct net_device *dev, |
| 1939 | struct iw_request_info *info, __u32 *uwrq, | 1942 | struct iw_request_info *info, |
| 1940 | char *extra) | 1943 | union iwreq_data *uwrq, char *extra) |
| 1941 | { | 1944 | { |
| 1942 | struct ks_wlan_private *priv = netdev_priv(dev); | 1945 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1943 | 1946 | ||
| 1944 | if (priv->sleep_mode == SLP_SLEEP) | 1947 | if (priv->sleep_mode == SLP_SLEEP) |
| 1945 | return -EPERM; | 1948 | return -EPERM; |
| 1946 | /* for SLEEP MODE */ | 1949 | /* for SLEEP MODE */ |
| 1947 | *uwrq = priv->reg.beacon_lost_count; | 1950 | uwrq->mode = priv->reg.beacon_lost_count; |
| 1948 | return 0; | 1951 | return 0; |
| 1949 | } | 1952 | } |
| 1950 | 1953 | ||
| 1951 | static int ks_wlan_set_phy_type(struct net_device *dev, | 1954 | static int ks_wlan_set_phy_type(struct net_device *dev, |
| 1952 | struct iw_request_info *info, __u32 *uwrq, | 1955 | struct iw_request_info *info, |
| 1953 | char *extra) | 1956 | union iwreq_data *uwrq, char *extra) |
| 1954 | { | 1957 | { |
| 1955 | struct ks_wlan_private *priv = netdev_priv(dev); | 1958 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1956 | 1959 | ||
| 1957 | if (priv->sleep_mode == SLP_SLEEP) | 1960 | if (priv->sleep_mode == SLP_SLEEP) |
| 1958 | return -EPERM; | 1961 | return -EPERM; |
| 1959 | 1962 | ||
| 1960 | if (*uwrq != D_11B_ONLY_MODE && | 1963 | if (uwrq->mode != D_11B_ONLY_MODE && |
| 1961 | *uwrq != D_11G_ONLY_MODE && | 1964 | uwrq->mode != D_11G_ONLY_MODE && |
| 1962 | *uwrq != D_11BG_COMPATIBLE_MODE) | 1965 | uwrq->mode != D_11BG_COMPATIBLE_MODE) |
| 1963 | return -EINVAL; | 1966 | return -EINVAL; |
| 1964 | 1967 | ||
| 1965 | /* for SLEEP MODE */ | 1968 | /* for SLEEP MODE */ |
| 1966 | priv->reg.phy_type = *uwrq; | 1969 | priv->reg.phy_type = uwrq->mode; |
| 1967 | priv->need_commit |= SME_MODE_SET; | 1970 | priv->need_commit |= SME_MODE_SET; |
| 1968 | return -EINPROGRESS; /* Call commit handler */ | 1971 | return -EINPROGRESS; /* Call commit handler */ |
| 1969 | } | 1972 | } |
| 1970 | 1973 | ||
| 1971 | static int ks_wlan_get_phy_type(struct net_device *dev, | 1974 | static int ks_wlan_get_phy_type(struct net_device *dev, |
| 1972 | struct iw_request_info *info, __u32 *uwrq, | 1975 | struct iw_request_info *info, |
| 1973 | char *extra) | 1976 | union iwreq_data *uwrq, char *extra) |
| 1974 | { | 1977 | { |
| 1975 | struct ks_wlan_private *priv = netdev_priv(dev); | 1978 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1976 | 1979 | ||
| 1977 | if (priv->sleep_mode == SLP_SLEEP) | 1980 | if (priv->sleep_mode == SLP_SLEEP) |
| 1978 | return -EPERM; | 1981 | return -EPERM; |
| 1979 | /* for SLEEP MODE */ | 1982 | /* for SLEEP MODE */ |
| 1980 | *uwrq = priv->reg.phy_type; | 1983 | uwrq->mode = priv->reg.phy_type; |
| 1981 | return 0; | 1984 | return 0; |
| 1982 | } | 1985 | } |
| 1983 | 1986 | ||
| 1984 | static int ks_wlan_set_cts_mode(struct net_device *dev, | 1987 | static int ks_wlan_set_cts_mode(struct net_device *dev, |
| 1985 | struct iw_request_info *info, __u32 *uwrq, | 1988 | struct iw_request_info *info, |
| 1986 | char *extra) | 1989 | union iwreq_data *uwrq, char *extra) |
| 1987 | { | 1990 | { |
| 1988 | struct ks_wlan_private *priv = netdev_priv(dev); | 1991 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 1989 | 1992 | ||
| 1990 | if (priv->sleep_mode == SLP_SLEEP) | 1993 | if (priv->sleep_mode == SLP_SLEEP) |
| 1991 | return -EPERM; | 1994 | return -EPERM; |
| 1992 | /* for SLEEP MODE */ | 1995 | /* for SLEEP MODE */ |
| 1993 | if (*uwrq != CTS_MODE_FALSE && *uwrq != CTS_MODE_TRUE) | 1996 | if (uwrq->mode != CTS_MODE_FALSE && uwrq->mode != CTS_MODE_TRUE) |
| 1994 | return -EINVAL; | 1997 | return -EINVAL; |
| 1995 | 1998 | ||
| 1996 | priv->reg.cts_mode = (*uwrq == CTS_MODE_FALSE) ? *uwrq : | 1999 | priv->reg.cts_mode = (uwrq->mode == CTS_MODE_FALSE) ? uwrq->mode : |
| 1997 | (priv->reg.phy_type == D_11G_ONLY_MODE || | 2000 | (priv->reg.phy_type == D_11G_ONLY_MODE || |
| 1998 | priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) ? | 2001 | priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) ? |
| 1999 | *uwrq : !*uwrq; | 2002 | uwrq->mode : !uwrq->mode; |
| 2000 | 2003 | ||
| 2001 | priv->need_commit |= SME_MODE_SET; | 2004 | priv->need_commit |= SME_MODE_SET; |
| 2002 | return -EINPROGRESS; /* Call commit handler */ | 2005 | return -EINPROGRESS; /* Call commit handler */ |
| 2003 | } | 2006 | } |
| 2004 | 2007 | ||
| 2005 | static int ks_wlan_get_cts_mode(struct net_device *dev, | 2008 | static int ks_wlan_get_cts_mode(struct net_device *dev, |
| 2006 | struct iw_request_info *info, __u32 *uwrq, | 2009 | struct iw_request_info *info, |
| 2007 | char *extra) | 2010 | union iwreq_data *uwrq, char *extra) |
| 2008 | { | 2011 | { |
| 2009 | struct ks_wlan_private *priv = netdev_priv(dev); | 2012 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2010 | 2013 | ||
| 2011 | if (priv->sleep_mode == SLP_SLEEP) | 2014 | if (priv->sleep_mode == SLP_SLEEP) |
| 2012 | return -EPERM; | 2015 | return -EPERM; |
| 2013 | /* for SLEEP MODE */ | 2016 | /* for SLEEP MODE */ |
| 2014 | *uwrq = priv->reg.cts_mode; | 2017 | uwrq->mode = priv->reg.cts_mode; |
| 2015 | return 0; | 2018 | return 0; |
| 2016 | } | 2019 | } |
| 2017 | 2020 | ||
| 2018 | static int ks_wlan_set_sleep_mode(struct net_device *dev, | 2021 | static int ks_wlan_set_sleep_mode(struct net_device *dev, |
| 2019 | struct iw_request_info *info, | 2022 | struct iw_request_info *info, |
| 2020 | __u32 *uwrq, char *extra) | 2023 | union iwreq_data *uwrq, char *extra) |
| 2021 | { | 2024 | { |
| 2022 | struct ks_wlan_private *priv = netdev_priv(dev); | 2025 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2023 | 2026 | ||
| 2024 | if (*uwrq != SLP_SLEEP && | 2027 | if (uwrq->mode != SLP_SLEEP && |
| 2025 | *uwrq != SLP_ACTIVE) { | 2028 | uwrq->mode != SLP_ACTIVE) { |
| 2026 | netdev_err(dev, "SET_SLEEP_MODE %d error\n", *uwrq); | 2029 | netdev_err(dev, "SET_SLEEP_MODE %d error\n", uwrq->mode); |
| 2027 | return -EINVAL; | 2030 | return -EINVAL; |
| 2028 | } | 2031 | } |
| 2029 | 2032 | ||
| 2030 | priv->sleep_mode = *uwrq; | 2033 | priv->sleep_mode = uwrq->mode; |
| 2031 | netdev_info(dev, "SET_SLEEP_MODE %d\n", priv->sleep_mode); | 2034 | netdev_info(dev, "SET_SLEEP_MODE %d\n", priv->sleep_mode); |
| 2032 | 2035 | ||
| 2033 | if (*uwrq == SLP_SLEEP) | 2036 | if (uwrq->mode == SLP_SLEEP) |
| 2034 | hostif_sme_enqueue(priv, SME_STOP_REQUEST); | 2037 | hostif_sme_enqueue(priv, SME_STOP_REQUEST); |
| 2035 | 2038 | ||
| 2036 | hostif_sme_enqueue(priv, SME_SLEEP_REQUEST); | 2039 | hostif_sme_enqueue(priv, SME_SLEEP_REQUEST); |
| @@ -2040,52 +2043,53 @@ static int ks_wlan_set_sleep_mode(struct net_device *dev, · 3 unmodified lines | |||
| 2040 | 2043 | ||
| 2041 | static int ks_wlan_get_sleep_mode(struct net_device *dev, | 2044 | static int ks_wlan_get_sleep_mode(struct net_device *dev, |
| 2042 | struct iw_request_info *info, | 2045 | struct iw_request_info *info, |
| 2043 | __u32 *uwrq, char *extra) | 2046 | union iwreq_data *uwrq, char *extra) |
| 2044 | { | 2047 | { |
| 2045 | struct ks_wlan_private *priv = netdev_priv(dev); | 2048 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2046 | 2049 | ||
| 2047 | *uwrq = priv->sleep_mode; | 2050 | uwrq->mode = priv->sleep_mode; |
| 2048 | 2051 | ||
| 2049 | return 0; | 2052 | return 0; |
| 2050 | } | 2053 | } |
| 2051 | 2054 | ||
| 2052 | static int ks_wlan_set_wps_enable(struct net_device *dev, | 2055 | static int ks_wlan_set_wps_enable(struct net_device *dev, |
| 2053 | struct iw_request_info *info, __u32 *uwrq, | 2056 | struct iw_request_info *info, |
| 2054 | char *extra) | 2057 | union iwreq_data *uwrq, char *extra) |
| 2055 | { | 2058 | { |
| 2056 | struct ks_wlan_private *priv = netdev_priv(dev); | 2059 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2057 | 2060 | ||
| 2058 | if (priv->sleep_mode == SLP_SLEEP) | 2061 | if (priv->sleep_mode == SLP_SLEEP) |
| 2059 | return -EPERM; | 2062 | return -EPERM; |
| 2060 | /* for SLEEP MODE */ | 2063 | /* for SLEEP MODE */ |
| 2061 | if (*uwrq != 0 && *uwrq != 1) | 2064 | if (uwrq->mode != 0 && uwrq->mode != 1) |
| 2062 | return -EINVAL; | 2065 | return -EINVAL; |
| 2063 | 2066 | ||
| 2064 | priv->wps.wps_enabled = *uwrq; | 2067 | priv->wps.wps_enabled = uwrq->mode; |
| 2065 | hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST); | 2068 | hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST); |
| 2066 | 2069 | ||
| 2067 | return 0; | 2070 | return 0; |
| 2068 | } | 2071 | } |
| 2069 | 2072 | ||
| 2070 | static int ks_wlan_get_wps_enable(struct net_device *dev, | 2073 | static int ks_wlan_get_wps_enable(struct net_device *dev, |
| 2071 | struct iw_request_info *info, __u32 *uwrq, | 2074 | struct iw_request_info *info, |
| 2072 | char *extra) | 2075 | union iwreq_data *uwrq, char *extra) |
| 2073 | { | 2076 | { |
| 2074 | struct ks_wlan_private *priv = netdev_priv(dev); | 2077 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2075 | 2078 | ||
| 2076 | if (priv->sleep_mode == SLP_SLEEP) | 2079 | if (priv->sleep_mode == SLP_SLEEP) |
| 2077 | return -EPERM; | 2080 | return -EPERM; |
| 2078 | /* for SLEEP MODE */ | 2081 | /* for SLEEP MODE */ |
| 2079 | *uwrq = priv->wps.wps_enabled; | 2082 | uwrq->mode = priv->wps.wps_enabled; |
| 2080 | netdev_info(dev, "return=%d\n", *uwrq); | 2083 | netdev_info(dev, "return=%d\n", uwrq->mode); |
| 2081 | 2084 | ||
| 2082 | return 0; | 2085 | return 0; |
| 2083 | } | 2086 | } |
| 2084 | 2087 | ||
| 2085 | static int ks_wlan_set_wps_probe_req(struct net_device *dev, | 2088 | static int ks_wlan_set_wps_probe_req(struct net_device *dev, |
| 2086 | struct iw_request_info *info, | 2089 | struct iw_request_info *info, |
| 2087 | struct iw_point *dwrq, char *extra) | 2090 | union iwreq_data *uwrq, char *extra) |
| 2088 | { | 2091 | { |
| 2092 | struct iw_point *dwrq = &uwrq->data; | ||
| 2089 | u8 *p = extra; | 2093 | u8 *p = extra; |
| 2090 | unsigned char len; | 2094 | unsigned char len; |
| 2091 | struct ks_wlan_private *priv = netdev_priv(dev); | 2095 | struct ks_wlan_private *priv = netdev_priv(dev); |
| @@ -2114,76 +2118,76 @@ static int ks_wlan_set_wps_probe_req(struct net_device *dev, · 22 unmodified lines | |||
| 2114 | } | 2118 | } |
| 2115 | 2119 | ||
| 2116 | static int ks_wlan_set_tx_gain(struct net_device *dev, | 2120 | static int ks_wlan_set_tx_gain(struct net_device *dev, |
| 2117 | struct iw_request_info *info, __u32 *uwrq, | 2121 | struct iw_request_info *info, |
| 2118 | char *extra) | 2122 | union iwreq_data *uwrq, char *extra) |
| 2119 | { | 2123 | { |
| 2120 | struct ks_wlan_private *priv = netdev_priv(dev); | 2124 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2121 | 2125 | ||
| 2122 | if (priv->sleep_mode == SLP_SLEEP) | 2126 | if (priv->sleep_mode == SLP_SLEEP) |
| 2123 | return -EPERM; | 2127 | return -EPERM; |
| 2124 | /* for SLEEP MODE */ | 2128 | /* for SLEEP MODE */ |
| 2125 | if (*uwrq > 0xFF) | 2129 | if (uwrq->mode > 0xFF) |
| 2126 | return -EINVAL; | 2130 | return -EINVAL; |
| 2127 | 2131 | ||
| 2128 | priv->gain.tx_gain = (u8)*uwrq; | 2132 | priv->gain.tx_gain = (u8)uwrq->mode; |
| 2129 | priv->gain.tx_mode = (priv->gain.tx_gain < 0xFF) ? 1 : 0; | 2133 | priv->gain.tx_mode = (priv->gain.tx_gain < 0xFF) ? 1 : 0; |
| 2130 | hostif_sme_enqueue(priv, SME_SET_GAIN); | 2134 | hostif_sme_enqueue(priv, SME_SET_GAIN); |
| 2131 | return 0; | 2135 | return 0; |
| 2132 | } | 2136 | } |
| 2133 | 2137 | ||
| 2134 | static int ks_wlan_get_tx_gain(struct net_device *dev, | 2138 | static int ks_wlan_get_tx_gain(struct net_device *dev, |
| 2135 | struct iw_request_info *info, __u32 *uwrq, | 2139 | struct iw_request_info *info, |
| 2136 | char *extra) | 2140 | union iwreq_data *uwrq, char *extra) |
| 2137 | { | 2141 | { |
| 2138 | struct ks_wlan_private *priv = netdev_priv(dev); | 2142 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2139 | 2143 | ||
| 2140 | if (priv->sleep_mode == SLP_SLEEP) | 2144 | if (priv->sleep_mode == SLP_SLEEP) |
| 2141 | return -EPERM; | 2145 | return -EPERM; |
| 2142 | /* for SLEEP MODE */ | 2146 | /* for SLEEP MODE */ |
| 2143 | *uwrq = priv->gain.tx_gain; | 2147 | uwrq->mode = priv->gain.tx_gain; |
| 2144 | hostif_sme_enqueue(priv, SME_GET_GAIN); | 2148 | hostif_sme_enqueue(priv, SME_GET_GAIN); |
| 2145 | return 0; | 2149 | return 0; |
| 2146 | } | 2150 | } |
| 2147 | 2151 | ||
| 2148 | static int ks_wlan_set_rx_gain(struct net_device *dev, | 2152 | static int ks_wlan_set_rx_gain(struct net_device *dev, |
| 2149 | struct iw_request_info *info, __u32 *uwrq, | 2153 | struct iw_request_info *info, |
| 2150 | char *extra) | 2154 | union iwreq_data *uwrq, char *extra) |
| 2151 | { | 2155 | { |
| 2152 | struct ks_wlan_private *priv = netdev_priv(dev); | 2156 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2153 | 2157 | ||
| 2154 | if (priv->sleep_mode == SLP_SLEEP) | 2158 | if (priv->sleep_mode == SLP_SLEEP) |
| 2155 | return -EPERM; | 2159 | return -EPERM; |
| 2156 | /* for SLEEP MODE */ | 2160 | /* for SLEEP MODE */ |
| 2157 | if (*uwrq > 0xFF) | 2161 | if (uwrq->mode > 0xFF) |
| 2158 | return -EINVAL; | 2162 | return -EINVAL; |
| 2159 | 2163 | ||
| 2160 | priv->gain.rx_gain = (u8)*uwrq; | 2164 | priv->gain.rx_gain = (u8)uwrq->mode; |
| 2161 | priv->gain.rx_mode = (priv->gain.rx_gain < 0xFF) ? 1 : 0; | 2165 | priv->gain.rx_mode = (priv->gain.rx_gain < 0xFF) ? 1 : 0; |
| 2162 | hostif_sme_enqueue(priv, SME_SET_GAIN); | 2166 | hostif_sme_enqueue(priv, SME_SET_GAIN); |
| 2163 | return 0; | 2167 | return 0; |
| 2164 | } | 2168 | } |
| 2165 | 2169 | ||
| 2166 | static int ks_wlan_get_rx_gain(struct net_device *dev, | 2170 | static int ks_wlan_get_rx_gain(struct net_device *dev, |
| 2167 | struct iw_request_info *info, __u32 *uwrq, | 2171 | struct iw_request_info *info, |
| 2168 | char *extra) | 2172 | union iwreq_data *uwrq, char *extra) |
| 2169 | { | 2173 | { |
| 2170 | struct ks_wlan_private *priv = netdev_priv(dev); | 2174 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2171 | 2175 | ||
| 2172 | if (priv->sleep_mode == SLP_SLEEP) | 2176 | if (priv->sleep_mode == SLP_SLEEP) |
| 2173 | return -EPERM; | 2177 | return -EPERM; |
| 2174 | /* for SLEEP MODE */ | 2178 | /* for SLEEP MODE */ |
| 2175 | *uwrq = priv->gain.rx_gain; | 2179 | uwrq->mode = priv->gain.rx_gain; |
| 2176 | hostif_sme_enqueue(priv, SME_GET_GAIN); | 2180 | hostif_sme_enqueue(priv, SME_GET_GAIN); |
| 2177 | return 0; | 2181 | return 0; |
| 2178 | } | 2182 | } |
| 2179 | 2183 | ||
| 2180 | static int ks_wlan_get_eeprom_cksum(struct net_device *dev, | 2184 | static int ks_wlan_get_eeprom_cksum(struct net_device *dev, |
| 2181 | struct iw_request_info *info, __u32 *uwrq, | 2185 | struct iw_request_info *info, |
| 2182 | char *extra) | 2186 | union iwreq_data *uwrq, char *extra) |
| 2183 | { | 2187 | { |
| 2184 | struct ks_wlan_private *priv = netdev_priv(dev); | 2188 | struct ks_wlan_private *priv = netdev_priv(dev); |
| 2185 | 2189 | ||
| 2186 | *uwrq = priv->eeprom_checksum; | 2190 | uwrq->mode = priv->eeprom_checksum; |
| 2187 | return 0; | 2191 | return 0; |
| 2188 | } | 2192 | } |
| 2189 | 2193 | ||
| @@ -2302,7 +2306,7 @@ static void print_hif_event(struct net_device *dev, int event) · 112 unmodified lines | |||
| 2302 | 2306 | ||
| 2303 | /* get host command history */ | 2307 | /* get host command history */ |
| 2304 | static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info, | 2308 | static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info, |
| 2305 | __u32 *uwrq, char *extra) | 2309 | union iwreq_data *uwrq, char *extra) |
| 2306 | { | 2310 | { |
| 2307 | int i, event; | 2311 | int i, event; |
| 2308 | struct ks_wlan_private *priv = netdev_priv(dev); | 2312 | struct ks_wlan_private *priv = netdev_priv(dev); |
| @@ -2409,38 +2413,38 @@ static const iw_handler ks_wlan_handler[] = { · 100 unmodified lines | |||
| 2409 | 2413 | ||
| 2410 | /* private_handler */ | 2414 | /* private_handler */ |
| 2411 | static const iw_handler ks_wlan_private_handler[] = { | 2415 | static const iw_handler ks_wlan_private_handler[] = { |
| 2412 | (iw_handler)NULL, /* 0 */ | 2416 | NULL, /* 0 */ |
| 2413 | (iw_handler)NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */ | 2417 | NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */ |
| 2414 | (iw_handler)NULL, /* 2 */ | 2418 | NULL, /* 2 */ |
| 2415 | (iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */ | 2419 | ks_wlan_get_firmware_version, /* 3 KS_WLAN_GET_FIRM_VERSION */ |
| 2416 | (iw_handler)ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */ | 2420 | ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */ |
| 2417 | (iw_handler)ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */ | 2421 | ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */ |
| 2418 | (iw_handler)ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */ | 2422 | ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */ |
| 2419 | (iw_handler)ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */ | 2423 | ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */ |
| 2420 | (iw_handler)ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */ | 2424 | ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */ |
| 2421 | (iw_handler)ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */ | 2425 | ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */ |
| 2422 | (iw_handler)ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */ | 2426 | ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */ |
| 2423 | (iw_handler)ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */ | 2427 | ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */ |
| 2424 | (iw_handler)ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */ | 2428 | ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */ |
| 2425 | (iw_handler)ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */ | 2429 | ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */ |
| 2426 | (iw_handler)ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */ | 2430 | ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */ |
| 2427 | (iw_handler)ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */ | 2431 | ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */ |
| 2428 | (iw_handler)ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */ | 2432 | ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */ |
| 2429 | (iw_handler)NULL, /* 17 */ | 2433 | NULL, /* 17 */ |
| 2430 | (iw_handler)ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */ | 2434 | ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */ |
| 2431 | (iw_handler)ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */ | 2435 | ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */ |
| 2432 | (iw_handler)ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */ | 2436 | ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */ |
| 2433 | (iw_handler)ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */ | 2437 | ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */ |
| 2434 | (iw_handler)ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */ | 2438 | ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */ |
| 2435 | (iw_handler)ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */ | 2439 | ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */ |
| 2436 | (iw_handler)ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */ | 2440 | ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */ |
| 2437 | (iw_handler)ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */ | 2441 | ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */ |
| 2438 | (iw_handler)NULL, /* 26 */ | 2442 | NULL, /* 26 */ |
| 2439 | (iw_handler)NULL, /* 27 */ | 2443 | NULL, /* 27 */ |
| 2440 | (iw_handler)ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */ | 2444 | ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */ |
| 2441 | (iw_handler)ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */ | 2445 | ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */ |
| 2442 | (iw_handler)NULL, /* 30 */ | 2446 | NULL, /* 30 */ |
| 2443 | (iw_handler)NULL, /* 31 */ | 2447 | NULL, /* 31 */ |
| 2444 | }; | 2448 | }; |
| 2445 | 2449 | ||
| 2446 | static const struct iw_handler_def ks_wlan_handler_def = { | 2450 | static const struct iw_handler_def ks_wlan_handler_def = { |
| @@ -2461,7 +2465,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, · 14 unmodified lines | |||
| 2461 | 2465 | ||
| 2462 | switch (cmd) { | 2466 | switch (cmd) { |
| 2463 | case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */ | 2467 | case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */ |
| 2464 | ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u.mode, NULL); | 2468 | ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u, NULL); |
| 2465 | break; | 2469 | break; |
| 2466 | // All other calls are currently unsupported | 2470 | // All other calls are currently unsupported |
| 2467 | default: | 2471 | default: |
| @@ -161,7 +161,7 @@ static int try_start_dim_transfer(struct hdm_channel *hdm_ch) · 160 unmodified lines | |||
| 161 | struct list_head *head = &hdm_ch->pending_list; | 161 | struct list_head *head = &hdm_ch->pending_list; |
| 162 | struct mbo *mbo; | 162 | struct mbo *mbo; |
| 163 | unsigned long flags; | 163 | unsigned long flags; |
| 164 | struct dim_ch_state_t st; | 164 | struct dim_ch_state st; |
| 165 | 165 | ||
| 166 | BUG_ON(!hdm_ch); | 166 | BUG_ON(!hdm_ch); |
| 167 | BUG_ON(!hdm_ch->is_initialized); | 167 | BUG_ON(!hdm_ch->is_initialized); |
| @@ -259,7 +259,7 @@ static void retrieve_netinfo(struct dim2_hdm *dev, struct mbo *mbo) · 91 unmodified lines | |||
| 259 | static void service_done_flag(struct dim2_hdm *dev, int ch_idx) | 259 | static void service_done_flag(struct dim2_hdm *dev, int ch_idx) |
| 260 | { | 260 | { |
| 261 | struct hdm_channel *hdm_ch = dev->hch + ch_idx; | 261 | struct hdm_channel *hdm_ch = dev->hch + ch_idx; |
| 262 | struct dim_ch_state_t st; | 262 | struct dim_ch_state st; |
| 263 | struct list_head *head; | 263 | struct list_head *head; |
| 264 | struct mbo *mbo; | 264 | struct mbo *mbo; |
| 265 | int done_buffers; | 265 | int done_buffers; |
| @@ -943,8 +943,8 @@ u8 dim_service_channel(struct dim_channel *ch) · 942 unmodified lines | |||
| 943 | return channel_service(ch); | 943 | return channel_service(ch); |
| 944 | } | 944 | } |
| 945 | 945 | ||
| 946 | struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch, | 946 | struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch, |
| 947 | struct dim_ch_state_t *state_ptr) | 947 | struct dim_ch_state *state_ptr) |
| 948 | { | 948 | { |
| 949 | if (!ch || !state_ptr) | 949 | if (!ch || !state_ptr) |
| 950 | return NULL; | 950 | return NULL; |
| @@ -27,7 +27,7 @@ enum mlb_clk_speed { · 26 unmodified lines | |||
| 27 | CLK_8192FS = 7, | 27 | CLK_8192FS = 7, |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | struct dim_ch_state_t { | 30 | struct dim_ch_state { |
| 31 | bool ready; /* Shows readiness to enqueue next buffer */ | 31 | bool ready; /* Shows readiness to enqueue next buffer */ |
| 32 | u16 done_buffers; /* Number of completed buffers */ | 32 | u16 done_buffers; /* Number of completed buffers */ |
| 33 | }; | 33 | }; |
| @@ -87,8 +87,8 @@ void dim_service_ahb_int_irq(struct dim_channel *const *channels); · 53 unmodified lines | |||
| 87 | 87 | ||
| 88 | u8 dim_service_channel(struct dim_channel *ch); | 88 | u8 dim_service_channel(struct dim_channel *ch); |
| 89 | 89 | ||
| 90 | struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch, | 90 | struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch, |
| 91 | struct dim_ch_state_t *state_ptr); | 91 | struct dim_ch_state *state_ptr); |
| 92 | 92 | ||
| 93 | u16 dim_dbr_space(struct dim_channel *ch); | 93 | u16 dim_dbr_space(struct dim_channel *ch); |
| 94 | 94 | ||
| @@ -284,7 +284,7 @@ static irqreturn_t most_irq_handler(int irq, void *_dev) · 283 unmodified lines | |||
| 284 | * | 284 | * |
| 285 | * Register the i2c client device as a MOST interface | 285 | * Register the i2c client device as a MOST interface |
| 286 | */ | 286 | */ |
| 287 | static int i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) | 287 | static int i2c_probe(struct i2c_client *client) |
| 288 | { | 288 | { |
| 289 | struct hdm_i2c *dev; | 289 | struct hdm_i2c *dev; |
| 290 | int ret, i; | 290 | int ret, i; |
| @@ -359,7 +359,7 @@ static struct i2c_driver i2c_driver = { · 68 unmodified lines | |||
| 359 | .driver = { | 359 | .driver = { |
| 360 | .name = "hdm_i2c", | 360 | .name = "hdm_i2c", |
| 361 | }, | 361 | }, |
| 362 | .probe = i2c_probe, | 362 | .probe_new = i2c_probe, |
| 363 | .remove = i2c_remove, | 363 | .remove = i2c_remove, |
| 364 | .id_table = i2c_id, | 364 | .id_table = i2c_id, |
| 365 | }; | 365 | }; |
| @@ -73,7 +73,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) · 72 unmodified lines | |||
| 73 | { | 73 | { |
| 74 | int skb_to_free; | 74 | int skb_to_free; |
| 75 | int qos, queues_per_port; | 75 | int qos, queues_per_port; |
| 76 | int total_freed = 0; | ||
| 77 | int total_remaining = 0; | 76 | int total_remaining = 0; |
| 78 | unsigned long flags; | 77 | unsigned long flags; |
| 79 | struct octeon_ethernet *priv = netdev_priv(dev); | 78 | struct octeon_ethernet *priv = netdev_priv(dev); |
| @@ -87,7 +86,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) · 7 unmodified lines | |||
| 87 | MAX_SKB_TO_FREE); | 86 | MAX_SKB_TO_FREE); |
| 88 | skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free, | 87 | skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free, |
| 89 | priv->fau + qos * 4); | 88 | priv->fau + qos * 4); |
| 90 | total_freed += skb_to_free; | ||
| 91 | if (skb_to_free > 0) { | 89 | if (skb_to_free > 0) { |
| 92 | struct sk_buff *to_free_list = NULL; | 90 | struct sk_buff *to_free_list = NULL; |
| 93 | 91 | ||
| @@ -1212,7 +1212,7 @@ static inline void *cvmx_phys_to_ptr(uint64_t physical_address) · 1211 unmodified lines | |||
| 1212 | return (void *)(uintptr_t)(physical_address); | 1212 | return (void *)(uintptr_t)(physical_address); |
| 1213 | } | 1213 | } |
| 1214 | 1214 | ||
| 1215 | static inline uint64_t cvmx_ptr_to_phys(void *ptr) | 1215 | static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) |
| 1216 | { | 1216 | { |
| 1217 | return (unsigned long)ptr; | 1217 | return (unsigned long)ptr; |
| 1218 | } | 1218 | } |
| @@ -579,7 +579,7 @@ static int dcon_detect(struct i2c_client *client, struct i2c_board_info *info) · 578 unmodified lines | |||
| 579 | return 0; | 579 | return 0; |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) | 582 | static int dcon_probe(struct i2c_client *client) |
| 583 | { | 583 | { |
| 584 | struct dcon_priv *dcon; | 584 | struct dcon_priv *dcon; |
| 585 | int rc, i, j; | 585 | int rc, i, j; |
| @@ -779,7 +779,7 @@ static struct i2c_driver dcon_driver = { · 193 unmodified lines | |||
| 779 | }, | 779 | }, |
| 780 | .class = I2C_CLASS_DDC | I2C_CLASS_HWMON, | 780 | .class = I2C_CLASS_DDC | I2C_CLASS_HWMON, |
| 781 | .id_table = dcon_idtable, | 781 | .id_table = dcon_idtable, |
| 782 | .probe = dcon_probe, | 782 | .probe_new = dcon_probe, |
| 783 | .remove = dcon_remove, | 783 | .remove = dcon_remove, |
| 784 | .detect = dcon_detect, | 784 | .detect = dcon_detect, |
| 785 | .address_list = normal_i2c, | 785 | .address_list = normal_i2c, |
| @@ -1017,10 +1017,9 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, · 1016 unmodified lines | |||
| 1017 | return beacon_updated; | 1017 | return beacon_updated; |
| 1018 | } | 1018 | } |
| 1019 | 1019 | ||
| 1020 | int rtw_sta_flush(struct adapter *padapter) | 1020 | void rtw_sta_flush(struct adapter *padapter) |
| 1021 | { | 1021 | { |
| 1022 | struct list_head *phead, *plist; | 1022 | struct list_head *phead, *plist; |
| 1023 | int ret = 0; | ||
| 1024 | struct sta_info *psta = NULL; | 1023 | struct sta_info *psta = NULL; |
| 1025 | struct sta_priv *pstapriv = &padapter->stapriv; | 1024 | struct sta_priv *pstapriv = &padapter->stapriv; |
| 1026 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 1025 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| @@ -1028,7 +1027,7 @@ int rtw_sta_flush(struct adapter *padapter) · 1 unmodified line | |||
| 1028 | u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | 1027 | u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; |
| 1029 | 1028 | ||
| 1030 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) | 1029 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) |
| 1031 | return ret; | 1030 | return; |
| 1032 | 1031 | ||
| 1033 | spin_lock_bh(&pstapriv->asoc_list_lock); | 1032 | spin_lock_bh(&pstapriv->asoc_list_lock); |
| 1034 | phead = &pstapriv->asoc_list; | 1033 | phead = &pstapriv->asoc_list; |
| @@ -1050,8 +1049,6 @@ int rtw_sta_flush(struct adapter *padapter) · 15 unmodified lines | |||
| 1050 | issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING); | 1049 | issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING); |
| 1051 | 1050 | ||
| 1052 | associated_clients_update(padapter, true); | 1051 | associated_clients_update(padapter, true); |
| 1053 | |||
| 1054 | return ret; | ||
| 1055 | } | 1052 | } |
| 1056 | 1053 | ||
| 1057 | /* called > TSR LEVEL for USB or SDIO Interface*/ | 1054 | /* called > TSR LEVEL for USB or SDIO Interface*/ |
| @@ -50,17 +50,17 @@ · 49 unmodified lines | |||
| 50 | static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) | 50 | static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) |
| 51 | { | 51 | { |
| 52 | unsigned char *cur_ptr, *start_ptr; | 52 | unsigned char *cur_ptr, *start_ptr; |
| 53 | unsigned short tagLen, tagType; | 53 | unsigned short tag_len, tag_type; |
| 54 | 54 | ||
| 55 | start_ptr = (unsigned char *)ph->tag; | 55 | start_ptr = (unsigned char *)ph->tag; |
| 56 | cur_ptr = (unsigned char *)ph->tag; | 56 | cur_ptr = (unsigned char *)ph->tag; |
| 57 | while ((cur_ptr - start_ptr) < ntohs(ph->length)) { | 57 | while ((cur_ptr - start_ptr) < ntohs(ph->length)) { |
| 58 | /* prevent un-alignment access */ | 58 | /* prevent un-alignment access */ |
| 59 | tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); | 59 | tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); |
| 60 | tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); | 60 | tag_len = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); |
| 61 | if (tagType == type) | 61 | if (tag_type == type) |
| 62 | return cur_ptr; | 62 | return cur_ptr; |
| 63 | cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen; | 63 | cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len; |
| 64 | } | 64 | } |
| 65 | return NULL; | 65 | return NULL; |
| 66 | } | 66 | } |
| @@ -111,32 +111,32 @@ static int __nat25_has_expired(struct nat25_network_db_entry *fdb) · 44 unmodified lines | |||
| 111 | return 0; | 111 | return 0; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr, | 114 | static void __nat25_generate_ipv4_network_addr(unsigned char *addr, |
| 115 | unsigned int *ipAddr) | 115 | unsigned int *ip_addr) |
| 116 | { | 116 | { |
| 117 | memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); | 117 | memset(addr, 0, MAX_NETWORK_ADDR_LEN); |
| 118 | 118 | ||
| 119 | networkAddr[0] = NAT25_IPV4; | 119 | addr[0] = NAT25_IPV4; |
| 120 | memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4); | 120 | memcpy(addr + 7, (unsigned char *)ip_addr, 4); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr, | 123 | static void __nat25_generate_pppoe_network_addr(unsigned char *addr, |
| 124 | unsigned char *ac_mac, __be16 *sid) | 124 | unsigned char *ac_mac, __be16 *sid) |
| 125 | { | 125 | { |
| 126 | memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); | 126 | memset(addr, 0, MAX_NETWORK_ADDR_LEN); |
| 127 | 127 | ||
| 128 | networkAddr[0] = NAT25_PPPOE; | 128 | addr[0] = NAT25_PPPOE; |
| 129 | memcpy(networkAddr + 1, (unsigned char *)sid, 2); | 129 | memcpy(addr + 1, (unsigned char *)sid, 2); |
| 130 | memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6); | 130 | memcpy(addr + 3, (unsigned char *)ac_mac, 6); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr, | 133 | static void __nat25_generate_ipv6_network_addr(unsigned char *addr, |
| 134 | unsigned int *ipAddr) | 134 | unsigned int *ip_addr) |
| 135 | { | 135 | { |
| 136 | memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); | 136 | memset(addr, 0, MAX_NETWORK_ADDR_LEN); |
| 137 | 137 | ||
| 138 | networkAddr[0] = NAT25_IPV6; | 138 | addr[0] = NAT25_IPV6; |
| 139 | memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16); | 139 | memcpy(addr + 1, (unsigned char *)ip_addr, 16); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b) | 142 | static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b) |
| @@ -200,40 +200,40 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char · 57 unmodified lines | |||
| 200 | return 0; | 200 | return 0; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | static int __nat25_network_hash(unsigned char *networkAddr) | 203 | static int __nat25_network_hash(unsigned char *addr) |
| 204 | { | 204 | { |
| 205 | if (networkAddr[0] == NAT25_IPV4) { | 205 | if (addr[0] == NAT25_IPV4) { |
| 206 | unsigned long x; | 206 | unsigned long x; |
| 207 | 207 | ||
| 208 | x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; | 208 | x = addr[7] ^ addr[8] ^ addr[9] ^ addr[10]; |
| 209 | 209 | ||
| 210 | return x & (NAT25_HASH_SIZE - 1); | 210 | return x & (NAT25_HASH_SIZE - 1); |
| 211 | } else if (networkAddr[0] == NAT25_IPX) { | 211 | } else if (addr[0] == NAT25_IPX) { |
| 212 | unsigned long x; | 212 | unsigned long x; |
| 213 | 213 | ||
| 214 | x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ | 214 | x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ |
| 215 | networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; | 215 | addr[6] ^ addr[7] ^ addr[8] ^ addr[9] ^ addr[10]; |
| 216 | 216 | ||
| 217 | return x & (NAT25_HASH_SIZE - 1); | 217 | return x & (NAT25_HASH_SIZE - 1); |
| 218 | } else if (networkAddr[0] == NAT25_APPLE) { | 218 | } else if (addr[0] == NAT25_APPLE) { |
| 219 | unsigned long x; | 219 | unsigned long x; |
| 220 | 220 | ||
| 221 | x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3]; | 221 | x = addr[1] ^ addr[2] ^ addr[3]; |
| 222 | 222 | ||
| 223 | return x & (NAT25_HASH_SIZE - 1); | 223 | return x & (NAT25_HASH_SIZE - 1); |
| 224 | } else if (networkAddr[0] == NAT25_PPPOE) { | 224 | } else if (addr[0] == NAT25_PPPOE) { |
| 225 | unsigned long x; | 225 | unsigned long x; |
| 226 | 226 | ||
| 227 | x = networkAddr[0] ^ networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8]; | 227 | x = addr[0] ^ addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ |
| 228 | addr[5] ^ addr[6] ^ addr[7] ^ addr[8]; | ||
| 228 | 229 | ||
| 229 | return x & (NAT25_HASH_SIZE - 1); | 230 | return x & (NAT25_HASH_SIZE - 1); |
| 230 | } else if (networkAddr[0] == NAT25_IPV6) { | 231 | } else if (addr[0] == NAT25_IPV6) { |
| 231 | unsigned long x; | 232 | unsigned long x; |
| 232 | 233 | ||
| 233 | x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ | 234 | x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ addr[6] ^ |
| 234 | networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^ | 235 | addr[7] ^ addr[8] ^ addr[9] ^ addr[10] ^ addr[11] ^ addr[12] ^ |
| 235 | networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^ | 236 | addr[13] ^ addr[14] ^ addr[15] ^ addr[16]; |
| 236 | networkAddr[16]; | ||
| 237 | 237 | ||
| 238 | return x & (NAT25_HASH_SIZE - 1); | 238 | return x & (NAT25_HASH_SIZE - 1); |
| 239 | } else { | 239 | } else { |
| @@ -241,7 +241,7 @@ static int __nat25_network_hash(unsigned char *networkAddr) · 1 unmodified line | |||
| 241 | int i; | 241 | int i; |
| 242 | 242 | ||
| 243 | for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++) | 243 | for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++) |
| 244 | x ^= networkAddr[i]; | 244 | x ^= addr[i]; |
| 245 | 245 | ||
| 246 | return x & (NAT25_HASH_SIZE - 1); | 246 | return x & (NAT25_HASH_SIZE - 1); |
| 247 | } | 247 | } |
| @@ -269,17 +269,17 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent) · 21 unmodified lines | |||
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | static void __nat25_db_network_insert(struct adapter *priv, | 271 | static void __nat25_db_network_insert(struct adapter *priv, |
| 272 | unsigned char *macAddr, unsigned char *networkAddr) | 272 | unsigned char *mac_addr, unsigned char *addr) |
| 273 | { | 273 | { |
| 274 | struct nat25_network_db_entry *db; | 274 | struct nat25_network_db_entry *db; |
| 275 | int hash; | 275 | int hash; |
| 276 | 276 | ||
| 277 | spin_lock_bh(&priv->br_ext_lock); | 277 | spin_lock_bh(&priv->br_ext_lock); |
| 278 | hash = __nat25_network_hash(networkAddr); | 278 | hash = __nat25_network_hash(addr); |
| 279 | db = priv->nethash[hash]; | 279 | db = priv->nethash[hash]; |
| 280 | while (db) { | 280 | while (db) { |
| 281 | if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { | 281 | if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) { |
| 282 | memcpy(db->macAddr, macAddr, ETH_ALEN); | 282 | memcpy(db->macAddr, mac_addr, ETH_ALEN); |
| 283 | db->ageing_timer = jiffies; | 283 | db->ageing_timer = jiffies; |
| 284 | spin_unlock_bh(&priv->br_ext_lock); | 284 | spin_unlock_bh(&priv->br_ext_lock); |
| 285 | return; | 285 | return; |
| @@ -291,8 +291,8 @@ static void __nat25_db_network_insert(struct adapter *priv, · 5 unmodified lines | |||
| 291 | spin_unlock_bh(&priv->br_ext_lock); | 291 | spin_unlock_bh(&priv->br_ext_lock); |
| 292 | return; | 292 | return; |
| 293 | } | 293 | } |
| 294 | memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN); | 294 | memcpy(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN); |
| 295 | memcpy(db->macAddr, macAddr, ETH_ALEN); | 295 | memcpy(db->macAddr, mac_addr, ETH_ALEN); |
| 296 | atomic_set(&db->use_count, 1); | 296 | atomic_set(&db->use_count, 1); |
| 297 | db->ageing_timer = jiffies; | 297 | db->ageing_timer = jiffies; |
| 298 | 298 | ||
| @@ -366,7 +366,7 @@ void nat25_db_expire(struct adapter *priv) · 67 unmodified lines | |||
| 366 | int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) | 366 | int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) |
| 367 | { | 367 | { |
| 368 | unsigned short protocol; | 368 | unsigned short protocol; |
| 369 | unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; | 369 | unsigned char addr[MAX_NETWORK_ADDR_LEN]; |
| 370 | unsigned int tmp; | 370 | unsigned int tmp; |
| 371 | 371 | ||
| 372 | if (!skb) | 372 | if (!skb) |
| @@ -395,9 +395,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 22 unmodified lines | |||
| 395 | if (iph->saddr == 0) | 395 | if (iph->saddr == 0) |
| 396 | return 0; | 396 | return 0; |
| 397 | tmp = be32_to_cpu(iph->saddr); | 397 | tmp = be32_to_cpu(iph->saddr); |
| 398 | __nat25_generate_ipv4_network_addr(networkAddr, &tmp); | 398 | __nat25_generate_ipv4_network_addr(addr, &tmp); |
| 399 | /* record source IP address and , source mac address into db */ | 399 | /* record source IP address and , source mac address into db */ |
| 400 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); | 400 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); |
| 401 | return 0; | 401 | return 0; |
| 402 | default: | 402 | default: |
| 403 | return -1; | 403 | return -1; |
| @@ -421,8 +421,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 17 unmodified lines | |||
| 421 | memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN); | 421 | memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN); |
| 422 | arp_ptr += arp->ar_hln; | 422 | arp_ptr += arp->ar_hln; |
| 423 | sender = (unsigned int *)arp_ptr; | 423 | sender = (unsigned int *)arp_ptr; |
| 424 | __nat25_generate_ipv4_network_addr(networkAddr, sender); | 424 | __nat25_generate_ipv4_network_addr(addr, sender); |
| 425 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); | 425 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); |
| 426 | return 0; | 426 | return 0; |
| 427 | default: | 427 | default: |
| 428 | return -1; | 428 | return -1; |
| @@ -495,9 +495,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 66 unmodified lines | |||
| 495 | return -1; | 495 | return -1; |
| 496 | } | 496 | } |
| 497 | } else { /* session phase */ | 497 | } else { /* session phase */ |
| 498 | __nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid); | 498 | __nat25_generate_pppoe_network_addr(addr, skb->data, &ph->sid); |
| 499 | 499 | ||
| 500 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); | 500 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); |
| 501 | 501 | ||
| 502 | if (!priv->ethBrExtInfo.addPPPoETag && | 502 | if (!priv->ethBrExtInfo.addPPPoETag && |
| 503 | priv->pppoe_connection_in_progress && | 503 | priv->pppoe_connection_in_progress && |
| @@ -548,8 +548,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 44 unmodified lines | |||
| 548 | return -1; | 548 | return -1; |
| 549 | case NAT25_INSERT: | 549 | case NAT25_INSERT: |
| 550 | if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) { | 550 | if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) { |
| 551 | __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr); | 551 | __nat25_generate_ipv6_network_addr(addr, (unsigned int *)&iph->saddr); |
| 552 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); | 552 | __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); |
| 553 | 553 | ||
| 554 | if (iph->nexthdr == IPPROTO_ICMPV6 && | 554 | if (iph->nexthdr == IPPROTO_ICMPV6 && |
| 555 | skb->len > (ETH_HLEN + sizeof(*iph) + 4)) { | 555 | skb->len > (ETH_HLEN + sizeof(*iph) + 4)) { |
| @@ -606,17 +606,16 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) · 50 unmodified lines | |||
| 606 | if (!priv->ethBrExtInfo.dhcp_bcst_disable) { | 606 | if (!priv->ethBrExtInfo.dhcp_bcst_disable) { |
| 607 | __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN)); | 607 | __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN)); |
| 608 | 608 | ||
| 609 | if (protocol == __constant_htons(ETH_P_IP)) { /* IP */ | 609 | if (protocol == htons(ETH_P_IP)) { /* IP */ |
| 610 | struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN); | 610 | struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN); |
| 611 | 611 | ||
| 612 | if (iph->protocol == IPPROTO_UDP) { /* UDP */ | 612 | if (iph->protocol == IPPROTO_UDP) { /* UDP */ |
| 613 | struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2)); | 613 | struct udphdr *udph = (void *)iph + (iph->ihl << 2); |
| 614 | 614 | ||
| 615 | if ((udph->source == __constant_htons(CLIENT_PORT)) && | 615 | if ((udph->source == htons(CLIENT_PORT)) && |
| 616 | (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */ | 616 | (udph->dest == htons(SERVER_PORT))) { /* DHCP request */ |
| 617 | struct dhcpMessage *dhcph = | 617 | struct dhcpMessage *dhcph = (void *)udph + sizeof(struct udphdr); |
| 618 | (struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr)); | 618 | u32 cookie = be32_to_cpu(dhcph->cookie); |
| 619 | u32 cookie = be32_to_cpu((__be32)dhcph->cookie); | ||
| 620 | 619 | ||
| 621 | if (cookie == DHCP_MAGIC) { /* match magic word */ | 620 | if (cookie == DHCP_MAGIC) { /* match magic word */ |
| 622 | if (!(dhcph->flags & htons(BROADCAST_FLAG))) { | 621 | if (!(dhcph->flags & htons(BROADCAST_FLAG))) { |
| @@ -639,19 +638,18 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) · 16 unmodified lines | |||
| 639 | } | 638 | } |
| 640 | } | 639 | } |
| 641 | 640 | ||
| 642 | void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr) | 641 | void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr) |
| 643 | { | 642 | { |
| 644 | unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; | 643 | unsigned char addr[MAX_NETWORK_ADDR_LEN]; |
| 645 | struct nat25_network_db_entry *db; | 644 | struct nat25_network_db_entry *db; |
| 646 | int hash; | 645 | int hash; |
| 647 | 646 | ||
| 648 | __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr); | 647 | __nat25_generate_ipv4_network_addr(addr, (unsigned int *)ip_addr); |
| 649 | hash = __nat25_network_hash(networkAddr); | 648 | hash = __nat25_network_hash(addr); |
| 650 | db = priv->nethash[hash]; | 649 | db = priv->nethash[hash]; |
| 651 | while (db) { | 650 | while (db) { |
| 652 | if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { | 651 | if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) |
| 653 | return (void *)db; | 652 | return (void *)db; |
| 654 | } | ||
| 655 | 653 | ||
| 656 | db = db->next_hash; | 654 | db = db->next_hash; |
| 657 | } | 655 | } |
| @@ -54,7 +54,7 @@ exit: · 53 unmodified lines | |||
| 54 | return _SUCCESS; | 54 | return _SUCCESS; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) | 57 | int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) |
| 58 | { | 58 | { |
| 59 | init_completion(&pcmdpriv->enqueue_cmd); | 59 | init_completion(&pcmdpriv->enqueue_cmd); |
| 60 | /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */ | 60 | /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */ |
| @@ -71,7 +71,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 10 unmodified lines | |||
| 71 | GFP_KERNEL); | 71 | GFP_KERNEL); |
| 72 | 72 | ||
| 73 | if (!pcmdpriv->cmd_allocated_buf) | 73 | if (!pcmdpriv->cmd_allocated_buf) |
| 74 | return _FAIL; | 74 | return -ENOMEM; |
| 75 | 75 | ||
| 76 | pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1)); | 76 | pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1)); |
| 77 | 77 | ||
| @@ -79,7 +79,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 1 unmodified line | |||
| 79 | 79 | ||
| 80 | if (!pcmdpriv->rsp_allocated_buf) { | 80 | if (!pcmdpriv->rsp_allocated_buf) { |
| 81 | kfree(pcmdpriv->cmd_allocated_buf); | 81 | kfree(pcmdpriv->cmd_allocated_buf); |
| 82 | return _FAIL; | 82 | return -ENOMEM; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3); | 85 | pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3); |
| @@ -87,13 +87,11 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 1 unmodified line | |||
| 87 | pcmdpriv->cmd_done_cnt = 0; | 87 | pcmdpriv->cmd_done_cnt = 0; |
| 88 | pcmdpriv->rsp_cnt = 0; | 88 | pcmdpriv->rsp_cnt = 0; |
| 89 | 89 | ||
| 90 | return _SUCCESS; | 90 | return 0; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) | 93 | int rtw_init_evt_priv(struct evt_priv *pevtpriv) |
| 94 | { | 94 | { |
| 95 | u32 res = _SUCCESS; | ||
| 96 | |||
| 97 | /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ | 95 | /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ |
| 98 | atomic_set(&pevtpriv->event_seq, 0); | 96 | atomic_set(&pevtpriv->event_seq, 0); |
| 99 | 97 | ||
| @@ -101,9 +99,9 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) · 1 unmodified line | |||
| 101 | pevtpriv->c2h_wk_alive = false; | 99 | pevtpriv->c2h_wk_alive = false; |
| 102 | pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1); | 100 | pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1); |
| 103 | if (!pevtpriv->c2h_queue) | 101 | if (!pevtpriv->c2h_queue) |
| 104 | res = _FAIL; | 102 | return -ENOMEM; |
| 105 | 103 | ||
| 106 | return res; | 104 | return 0; |
| 107 | } | 105 | } |
| 108 | 106 | ||
| 109 | void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) | 107 | void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) |
| @@ -342,33 +340,29 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, · 232 unmodified lines | |||
| 342 | return res; | 340 | return res; |
| 343 | } | 341 | } |
| 344 | 342 | ||
| 345 | u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) | 343 | int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) |
| 346 | { | 344 | { |
| 347 | struct cmd_obj *ph2c; | 345 | struct cmd_obj *ph2c; |
| 348 | struct setdatarate_parm *pbsetdataratepara; | 346 | struct setdatarate_parm *pbsetdataratepara; |
| 349 | struct cmd_priv *pcmdpriv = &padapter->cmdpriv; | 347 | struct cmd_priv *pcmdpriv = &padapter->cmdpriv; |
| 350 | u8 res = _SUCCESS; | ||
| 351 | 348 | ||
| 352 | ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); | 349 | ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); |
| 353 | if (!ph2c) { | 350 | if (!ph2c) |
| 354 | res = _FAIL; | 351 | return -ENOMEM; |
| 355 | goto exit; | ||
| 356 | } | ||
| 357 | 352 | ||
| 358 | pbsetdataratepara = kzalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC); | 353 | pbsetdataratepara = kzalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC); |
| 359 | if (!pbsetdataratepara) { | 354 | if (!pbsetdataratepara) { |
| 360 | kfree(ph2c); | 355 | kfree(ph2c); |
| 361 | res = _FAIL; | 356 | return -ENOMEM; |
| 362 | goto exit; | ||
| 363 | } | 357 | } |
| 364 | 358 | ||
| 365 | init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); | 359 | init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); |
| 366 | pbsetdataratepara->mac_id = 5; | 360 | pbsetdataratepara->mac_id = 5; |
| 367 | memcpy(pbsetdataratepara->datarates, rateset, NumRates); | 361 | memcpy(pbsetdataratepara->datarates, rateset, NumRates); |
| 368 | res = rtw_enqueue_cmd(pcmdpriv, ph2c); | 362 | if (rtw_enqueue_cmd(pcmdpriv, ph2c) == _FAIL) |
| 369 | exit: | 363 | return -EPERM; |
| 370 | 364 | ||
| 371 | return res; | 365 | return 0; |
| 372 | } | 366 | } |
| 373 | 367 | ||
| 374 | void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) | 368 | void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) |
| @@ -287,7 +287,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 286 unmodified lines | |||
| 287 | 287 | ||
| 288 | if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { | 288 | if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { |
| 289 | if (check_fwstate(pmlmepriv, _FW_LINKED)) | 289 | if (check_fwstate(pmlmepriv, _FW_LINKED)) |
| 290 | rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */ | 290 | rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | *pold_state = networktype; | 293 | *pold_state = networktype; |
| @@ -314,7 +314,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 20 unmodified lines | |||
| 314 | return true; | 314 | return true; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | u8 rtw_set_802_11_disassociate(struct adapter *padapter) | 317 | void rtw_set_802_11_disassociate(struct adapter *padapter) |
| 318 | { | 318 | { |
| 319 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 319 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 320 | 320 | ||
| @@ -328,8 +328,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) · 7 unmodified lines | |||
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | spin_unlock_bh(&pmlmepriv->lock); | 330 | spin_unlock_bh(&pmlmepriv->lock); |
| 331 | |||
| 332 | return true; | ||
| 333 | } | 331 | } |
| 334 | 332 | ||
| 335 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) | 333 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) |
| @@ -26,47 +26,32 @@ static void ResetLedStatus(struct led_priv *pLed) · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */ | 27 | pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */ |
| 28 | 28 | ||
| 29 | pLed->bLedLinkBlinkInProgress = false; | ||
| 30 | pLed->bLedScanBlinkInProgress = false; | 29 | pLed->bLedScanBlinkInProgress = false; |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) | 32 | static void SwLedOn(struct led_priv *pLed) |
| 34 | { | 33 | { |
| 35 | u8 LedCfg; | 34 | struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); |
| 36 | int res; | ||
| 37 | 35 | ||
| 38 | if (padapter->bDriverStopped) | 36 | if (padapter->bDriverStopped) |
| 39 | return; | 37 | return; |
| 40 | 38 | ||
| 41 | res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg); | 39 | if (rtw_write8(padapter, REG_LEDCFG2, BIT(5)) != _SUCCESS) |
| 42 | if (res) | ||
| 43 | return; | 40 | return; |
| 44 | 41 | ||
| 45 | rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */ | ||
| 46 | pLed->bLedOn = true; | 42 | pLed->bLedOn = true; |
| 47 | } | 43 | } |
| 48 | 44 | ||
| 49 | static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) | 45 | static void SwLedOff(struct led_priv *pLed) |
| 50 | { | 46 | { |
| 51 | u8 LedCfg; | 47 | struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); |
| 52 | int res; | ||
| 53 | 48 | ||
| 54 | if (padapter->bDriverStopped) | 49 | if (padapter->bDriverStopped) |
| 55 | goto exit; | 50 | return; |
| 56 | |||
| 57 | res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ | ||
| 58 | if (res) | ||
| 59 | goto exit; | ||
| 60 | 51 | ||
| 61 | LedCfg &= 0x90; /* Set to software control. */ | 52 | if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS) |
| 62 | rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3))); | 53 | return; |
| 63 | res = rtw_read8(padapter, REG_MAC_PINMUX_CFG, &LedCfg); | ||
| 64 | if (res) | ||
| 65 | goto exit; | ||
| 66 | 54 | ||
| 67 | LedCfg &= 0xFE; | ||
| 68 | rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); | ||
| 69 | exit: | ||
| 70 | pLed->bLedOn = false; | 55 | pLed->bLedOn = false; |
| 71 | } | 56 | } |
| 72 | 57 | ||
| @@ -74,19 +59,19 @@ static void blink_work(struct work_struct *work) · 1 unmodified line | |||
| 74 | { | 59 | { |
| 75 | struct delayed_work *dwork = to_delayed_work(work); | 60 | struct delayed_work *dwork = to_delayed_work(work); |
| 76 | struct led_priv *pLed = container_of(dwork, struct led_priv, blink_work); | 61 | struct led_priv *pLed = container_of(dwork, struct led_priv, blink_work); |
| 77 | struct adapter *padapter = pLed->padapter; | 62 | struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); |
| 78 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 63 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 79 | 64 | ||
| 80 | if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) { | 65 | if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) { |
| 81 | SwLedOff(padapter, pLed); | 66 | SwLedOff(pLed); |
| 82 | ResetLedStatus(pLed); | 67 | ResetLedStatus(pLed); |
| 83 | return; | 68 | return; |
| 84 | } | 69 | } |
| 85 | 70 | ||
| 86 | if (pLed->bLedOn) | 71 | if (pLed->bLedOn) |
| 87 | SwLedOff(padapter, pLed); | 72 | SwLedOff(pLed); |
| 88 | else | 73 | else |
| 89 | SwLedOn(padapter, pLed); | 74 | SwLedOn(pLed); |
| 90 | 75 | ||
| 91 | switch (pLed->CurrLedState) { | 76 | switch (pLed->CurrLedState) { |
| 92 | case LED_BLINK_SLOWLY: | 77 | case LED_BLINK_SLOWLY: |
| @@ -96,26 +81,10 @@ static void blink_work(struct work_struct *work) · 3 unmodified lines | |||
| 96 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); | 81 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); |
| 97 | break; | 82 | break; |
| 98 | case LED_BLINK_SCAN: | 83 | case LED_BLINK_SCAN: |
| 99 | pLed->BlinkTimes--; | ||
| 100 | if (pLed->BlinkTimes == 0) { | ||
| 101 | if (check_fwstate(pmlmepriv, _FW_LINKED)) { | ||
| 102 | pLed->bLedLinkBlinkInProgress = true; | ||
| 103 | pLed->CurrLedState = LED_BLINK_NORMAL; | ||
| 104 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); | ||
| 105 | } else { | ||
| 106 | pLed->CurrLedState = LED_BLINK_SLOWLY; | ||
| 107 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); | ||
| 108 | } | ||
| 109 | pLed->bLedScanBlinkInProgress = false; | ||
| 110 | } else { | ||
| 111 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL); | ||
| 112 | } | ||
| 113 | break; | ||
| 114 | case LED_BLINK_TXRX: | 84 | case LED_BLINK_TXRX: |
| 115 | pLed->BlinkTimes--; | 85 | pLed->BlinkTimes--; |
| 116 | if (pLed->BlinkTimes == 0) { | 86 | if (pLed->BlinkTimes == 0) { |
| 117 | if (check_fwstate(pmlmepriv, _FW_LINKED)) { | 87 | if (check_fwstate(pmlmepriv, _FW_LINKED)) { |
| 118 | pLed->bLedLinkBlinkInProgress = true; | ||
| 119 | pLed->CurrLedState = LED_BLINK_NORMAL; | 88 | pLed->CurrLedState = LED_BLINK_NORMAL; |
| 120 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); | 89 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); |
| 121 | } else { | 90 | } else { |
| @@ -123,8 +92,11 @@ static void blink_work(struct work_struct *work) · 1 unmodified line | |||
| 123 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); | 92 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); |
| 124 | } | 93 | } |
| 125 | pLed->bLedBlinkInProgress = false; | 94 | pLed->bLedBlinkInProgress = false; |
| 95 | pLed->bLedScanBlinkInProgress = false; | ||
| 126 | } else { | 96 | } else { |
| 127 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL); | 97 | schedule_delayed_work(&pLed->blink_work, |
| 98 | pLed->CurrLedState == LED_BLINK_SCAN ? | ||
| 99 | LED_BLINK_SCAN_INTVL : LED_BLINK_FASTER_INTVL); | ||
| 128 | } | 100 | } |
| 129 | break; | 101 | break; |
| 130 | case LED_BLINK_WPS: | 102 | case LED_BLINK_WPS: |
| @@ -132,7 +104,6 @@ static void blink_work(struct work_struct *work) · 1 unmodified line | |||
| 132 | break; | 104 | break; |
| 133 | case LED_BLINK_WPS_STOP: /* WPS success */ | 105 | case LED_BLINK_WPS_STOP: /* WPS success */ |
| 134 | if (!pLed->bLedOn) { | 106 | if (!pLed->bLedOn) { |
| 135 | pLed->bLedLinkBlinkInProgress = true; | ||
| 136 | pLed->CurrLedState = LED_BLINK_NORMAL; | 107 | pLed->CurrLedState = LED_BLINK_NORMAL; |
| 137 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); | 108 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); |
| 138 | 109 | ||
| @@ -150,7 +121,6 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter) · 11 unmodified lines | |||
| 150 | { | 121 | { |
| 151 | struct led_priv *pledpriv = &padapter->ledpriv; | 122 | struct led_priv *pledpriv = &padapter->ledpriv; |
| 152 | 123 | ||
| 153 | pledpriv->padapter = padapter; | ||
| 154 | ResetLedStatus(pledpriv); | 124 | ResetLedStatus(pledpriv); |
| 155 | INIT_DELAYED_WORK(&pledpriv->blink_work, blink_work); | 125 | INIT_DELAYED_WORK(&pledpriv->blink_work, blink_work); |
| 156 | } | 126 | } |
| @@ -161,7 +131,7 @@ void rtl8188eu_DeInitSwLeds(struct adapter *padapter) · 4 unmodified lines | |||
| 161 | 131 | ||
| 162 | cancel_delayed_work_sync(&ledpriv->blink_work); | 132 | cancel_delayed_work_sync(&ledpriv->blink_work); |
| 163 | ResetLedStatus(ledpriv); | 133 | ResetLedStatus(ledpriv); |
| 164 | SwLedOff(padapter, ledpriv); | 134 | SwLedOff(ledpriv); |
| 165 | } | 135 | } |
| 166 | 136 | ||
| 167 | void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) | 137 | void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) |
| @@ -170,8 +140,7 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 2 unmodified lines | |||
| 170 | struct registry_priv *registry_par; | 140 | struct registry_priv *registry_par; |
| 171 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 141 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 172 | 142 | ||
| 173 | if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) || | 143 | if (!padapter->hw_init_completed) |
| 174 | (!padapter->hw_init_completed)) | ||
| 175 | return; | 144 | return; |
| 176 | 145 | ||
| 177 | if (!pLed->bRegUseLed) | 146 | if (!pLed->bRegUseLed) |
| @@ -189,23 +158,18 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 11 unmodified lines | |||
| 189 | 158 | ||
| 190 | cancel_delayed_work(&pLed->blink_work); | 159 | cancel_delayed_work(&pLed->blink_work); |
| 191 | 160 | ||
| 192 | pLed->bLedLinkBlinkInProgress = false; | ||
| 193 | pLed->bLedBlinkInProgress = false; | 161 | pLed->bLedBlinkInProgress = false; |
| 194 | 162 | ||
| 195 | pLed->CurrLedState = LED_BLINK_SLOWLY; | 163 | pLed->CurrLedState = LED_BLINK_SLOWLY; |
| 196 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); | 164 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); |
| 197 | break; | 165 | break; |
| 198 | case LED_CTL_LINK: | 166 | case LED_CTL_LINK: |
| 199 | if (!pLed->bLedLinkBlinkInProgress) | ||
| 200 | return; | ||
| 201 | |||
| 202 | if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) | 167 | if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) |
| 203 | return; | 168 | return; |
| 204 | 169 | ||
| 205 | cancel_delayed_work(&pLed->blink_work); | 170 | cancel_delayed_work(&pLed->blink_work); |
| 206 | 171 | ||
| 207 | pLed->bLedBlinkInProgress = false; | 172 | pLed->bLedBlinkInProgress = false; |
| 208 | pLed->bLedLinkBlinkInProgress = true; | ||
| 209 | 173 | ||
| 210 | pLed->CurrLedState = LED_BLINK_NORMAL; | 174 | pLed->CurrLedState = LED_BLINK_NORMAL; |
| 211 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); | 175 | schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); |
| @@ -222,7 +186,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 10 unmodified lines | |||
| 222 | 186 | ||
| 223 | cancel_delayed_work(&pLed->blink_work); | 187 | cancel_delayed_work(&pLed->blink_work); |
| 224 | 188 | ||
| 225 | pLed->bLedLinkBlinkInProgress = false; | ||
| 226 | pLed->bLedBlinkInProgress = false; | 189 | pLed->bLedBlinkInProgress = false; |
| 227 | pLed->bLedScanBlinkInProgress = true; | 190 | pLed->bLedScanBlinkInProgress = true; |
| 228 | 191 | ||
| @@ -240,7 +203,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 11 unmodified lines | |||
| 240 | 203 | ||
| 241 | cancel_delayed_work(&pLed->blink_work); | 204 | cancel_delayed_work(&pLed->blink_work); |
| 242 | 205 | ||
| 243 | pLed->bLedLinkBlinkInProgress = false; | ||
| 244 | pLed->bLedBlinkInProgress = true; | 206 | pLed->bLedBlinkInProgress = true; |
| 245 | 207 | ||
| 246 | pLed->CurrLedState = LED_BLINK_TXRX; | 208 | pLed->CurrLedState = LED_BLINK_TXRX; |
| @@ -253,7 +215,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 6 unmodified lines | |||
| 253 | 215 | ||
| 254 | cancel_delayed_work(&pLed->blink_work); | 216 | cancel_delayed_work(&pLed->blink_work); |
| 255 | 217 | ||
| 256 | pLed->bLedLinkBlinkInProgress = false; | ||
| 257 | pLed->bLedBlinkInProgress = false; | 218 | pLed->bLedBlinkInProgress = false; |
| 258 | pLed->bLedScanBlinkInProgress = false; | 219 | pLed->bLedScanBlinkInProgress = false; |
| 259 | pLed->bLedWPSBlinkInProgress = true; | 220 | pLed->bLedWPSBlinkInProgress = true; |
| @@ -263,7 +224,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 3 unmodified lines | |||
| 263 | case LED_CTL_STOP_WPS: | 224 | case LED_CTL_STOP_WPS: |
| 264 | cancel_delayed_work(&pLed->blink_work); | 225 | cancel_delayed_work(&pLed->blink_work); |
| 265 | 226 | ||
| 266 | pLed->bLedLinkBlinkInProgress = false; | ||
| 267 | pLed->bLedBlinkInProgress = false; | 227 | pLed->bLedBlinkInProgress = false; |
| 268 | pLed->bLedScanBlinkInProgress = false; | 228 | pLed->bLedScanBlinkInProgress = false; |
| 269 | pLed->bLedWPSBlinkInProgress = true; | 229 | pLed->bLedWPSBlinkInProgress = true; |
| @@ -283,12 +243,11 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 13 unmodified lines | |||
| 283 | break; | 243 | break; |
| 284 | case LED_CTL_POWER_OFF: | 244 | case LED_CTL_POWER_OFF: |
| 285 | pLed->CurrLedState = RTW_LED_OFF; | 245 | pLed->CurrLedState = RTW_LED_OFF; |
| 286 | pLed->bLedLinkBlinkInProgress = false; | ||
| 287 | pLed->bLedBlinkInProgress = false; | 246 | pLed->bLedBlinkInProgress = false; |
| 288 | pLed->bLedWPSBlinkInProgress = false; | 247 | pLed->bLedWPSBlinkInProgress = false; |
| 289 | pLed->bLedScanBlinkInProgress = false; | 248 | pLed->bLedScanBlinkInProgress = false; |
| 290 | cancel_delayed_work(&pLed->blink_work); | 249 | cancel_delayed_work(&pLed->blink_work); |
| 291 | SwLedOff(padapter, pLed); | 250 | SwLedOff(pLed); |
| 292 | break; | 251 | break; |
| 293 | default: | 252 | default: |
| 294 | break; | 253 | break; |
| @@ -76,19 +76,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor · 75 unmodified lines | |||
| 76 | spin_unlock_bh(&free_queue->lock); | 76 | spin_unlock_bh(&free_queue->lock); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) | ||
| 80 | { | ||
| 81 | struct __queue *free_queue = &pmlmepriv->free_bss_pool; | ||
| 82 | |||
| 83 | if (!pnetwork) | ||
| 84 | return; | ||
| 85 | if (pnetwork->fixed) | ||
| 86 | return; | ||
| 87 | list_del_init(&pnetwork->list); | ||
| 88 | list_add_tail(&pnetwork->list, get_list_head(free_queue)); | ||
| 89 | pmlmepriv->num_of_scanned--; | ||
| 90 | } | ||
| 91 | |||
| 92 | /* | 79 | /* |
| 93 | return the wlan_network with the matching addr | 80 | return the wlan_network with the matching addr |
| 94 | 81 | ||
| @@ -224,7 +211,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 129 unmodified lines | |||
| 224 | u8 *pbuf; | 211 | u8 *pbuf; |
| 225 | struct wlan_network *pnetwork; | 212 | struct wlan_network *pnetwork; |
| 226 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 213 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 227 | int res = _SUCCESS; | ||
| 228 | 214 | ||
| 229 | /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ | 215 | /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ |
| 230 | 216 | ||
| @@ -245,10 +231,9 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 14 unmodified lines | |||
| 245 | 231 | ||
| 246 | pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); | 232 | pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); |
| 247 | 233 | ||
| 248 | if (!pbuf) { | 234 | if (!pbuf) |
| 249 | res = _FAIL; | 235 | return -ENOMEM; |
| 250 | goto exit; | 236 | |
| 251 | } | ||
| 252 | pmlmepriv->free_bss_buf = pbuf; | 237 | pmlmepriv->free_bss_buf = pbuf; |
| 253 | 238 | ||
| 254 | pnetwork = (struct wlan_network *)pbuf; | 239 | pnetwork = (struct wlan_network *)pbuf; |
| @@ -265,9 +250,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 10 unmodified lines | |||
| 265 | 250 | ||
| 266 | rtw_init_mlme_timer(padapter); | 251 | rtw_init_mlme_timer(padapter); |
| 267 | 252 | ||
| 268 | exit: | 253 | return 0; |
| 269 | |||
| 270 | return res; | ||
| 271 | } | 254 | } |
| 272 | 255 | ||
| 273 | void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) | 256 | void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) |
| @@ -311,9 +294,15 @@ exit: · 37 unmodified lines | |||
| 311 | static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, | 294 | static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, |
| 312 | struct wlan_network *pnetwork) | 295 | struct wlan_network *pnetwork) |
| 313 | { | 296 | { |
| 297 | struct __queue *free_queue = &pmlmepriv->free_bss_pool; | ||
| 314 | 298 | ||
| 315 | _rtw_free_network_nolock(pmlmepriv, pnetwork); | 299 | if (!pnetwork) |
| 316 | 300 | return; | |
| 301 | if (pnetwork->fixed) | ||
| 302 | return; | ||
| 303 | list_del_init(&pnetwork->list); | ||
| 304 | list_add_tail(&pnetwork->list, get_list_head(free_queue)); | ||
| 305 | pmlmepriv->num_of_scanned--; | ||
| 317 | } | 306 | } |
| 318 | 307 | ||
| 319 | void rtw_free_network_queue(struct adapter *dev, u8 isfreeall) | 308 | void rtw_free_network_queue(struct adapter *dev, u8 isfreeall) |
| @@ -1823,22 +1812,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter) · 1503 unmodified lines | |||
| 1823 | 1812 | ||
| 1824 | pdev_network->Rssi = 0; | 1813 | pdev_network->Rssi = 0; |
| 1825 | 1814 | ||
| 1826 | switch (pregistrypriv->wireless_mode) { | ||
| 1827 | case WIRELESS_11B: | ||
| 1828 | pdev_network->NetworkTypeInUse = (Ndis802_11DS); | ||
| 1829 | break; | ||
| 1830 | case WIRELESS_11G: | ||
| 1831 | case WIRELESS_11BG: | ||
| 1832 | case WIRELESS_11_24N: | ||
| 1833 | case WIRELESS_11G_24N: | ||
| 1834 | case WIRELESS_11BG_24N: | ||
| 1835 | pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24); | ||
| 1836 | break; | ||
| 1837 | default: | ||
| 1838 | /* TODO */ | ||
| 1839 | break; | ||
| 1840 | } | ||
| 1841 | |||
| 1842 | pdev_network->Configuration.DSConfig = (pregistrypriv->channel); | 1815 | pdev_network->Configuration.DSConfig = (pregistrypriv->channel); |
| 1843 | 1816 | ||
| 1844 | if (cur_network->network.InfrastructureMode == Ndis802_11IBSS) | 1817 | if (cur_network->network.InfrastructureMode == Ndis802_11IBSS) |
| @@ -12,24 +12,6 @@ · 11 unmodified lines | |||
| 12 | #include "../include/rtl8188e_xmit.h" | 12 | #include "../include/rtl8188e_xmit.h" |
| 13 | #include "../include/rtl8188e_dm.h" | 13 | #include "../include/rtl8188e_dm.h" |
| 14 | 14 | ||
| 15 | /* response function for each management frame subtype, do not reorder */ | ||
| 16 | static mlme_handler mlme_sta_tbl[] = { | ||
| 17 | OnAssocReq, | ||
| 18 | OnAssocRsp, | ||
| 19 | OnAssocReq, | ||
| 20 | OnAssocRsp, | ||
| 21 | OnProbeReq, | ||
| 22 | OnProbeRsp, | ||
| 23 | NULL, | ||
| 24 | NULL, | ||
| 25 | OnBeacon, | ||
| 26 | NULL, | ||
| 27 | OnDisassoc, | ||
| 28 | OnAuthClient, | ||
| 29 | OnDeAuth, | ||
| 30 | OnAction, | ||
| 31 | }; | ||
| 32 | |||
| 33 | static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; | 15 | static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; |
| 34 | 16 | ||
| 35 | /************************************************** | 17 | /************************************************** |
| @@ -137,7 +119,7 @@ static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { · 101 unmodified lines | |||
| 137 | {0x03}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ | 119 | {0x03}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ |
| 138 | }; | 120 | }; |
| 139 | 121 | ||
| 140 | static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the conbination for max channel numbers */ | 122 | static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the combination for max channel numbers */ |
| 141 | 123 | ||
| 142 | /* | 124 | /* |
| 143 | * Search the @param channel_num in given @param channel_set | 125 | * Search the @param channel_num in given @param channel_set |
| @@ -393,47 +375,6 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) · 249 unmodified lines | |||
| 393 | } | 375 | } |
| 394 | } | 376 | } |
| 395 | 377 | ||
| 396 | void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) | ||
| 397 | { | ||
| 398 | int index; | ||
| 399 | mlme_handler fct; | ||
| 400 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | ||
| 401 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; | ||
| 402 | struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2); | ||
| 403 | |||
| 404 | if (!ieee80211_is_mgmt(hdr->frame_control)) | ||
| 405 | return; | ||
| 406 | |||
| 407 | /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ | ||
| 408 | if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) && | ||
| 409 | !is_broadcast_ether_addr(hdr->addr1)) | ||
| 410 | return; | ||
| 411 | |||
| 412 | index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4; | ||
| 413 | if (index >= ARRAY_SIZE(mlme_sta_tbl)) | ||
| 414 | return; | ||
| 415 | fct = mlme_sta_tbl[index]; | ||
| 416 | |||
| 417 | if (psta) { | ||
| 418 | if (ieee80211_has_retry(hdr->frame_control)) { | ||
| 419 | if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) | ||
| 420 | /* drop the duplicate management frame */ | ||
| 421 | return; | ||
| 422 | } | ||
| 423 | psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num; | ||
| 424 | } | ||
| 425 | |||
| 426 | if (ieee80211_is_auth(hdr->frame_control)) { | ||
| 427 | if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) | ||
| 428 | fct = OnAuth; | ||
| 429 | else | ||
| 430 | fct = OnAuthClient; | ||
| 431 | } | ||
| 432 | |||
| 433 | if (fct) | ||
| 434 | fct(padapter, precv_frame); | ||
| 435 | } | ||
| 436 | |||
| 437 | static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) | 378 | static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) |
| 438 | { | 379 | { |
| 439 | bool response = true; | 380 | bool response = true; |
| @@ -448,21 +389,6 @@ static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) · 8 unmodified lines | |||
| 448 | return _SUCCESS; | 389 | return _SUCCESS; |
| 449 | } | 390 | } |
| 450 | 391 | ||
| 451 | static void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe) | ||
| 452 | { | ||
| 453 | u8 *pIE; | ||
| 454 | __le32 *pbuf; | ||
| 455 | |||
| 456 | pIE = pframe + sizeof(struct ieee80211_hdr_3addr); | ||
| 457 | pbuf = (__le32 *)pIE; | ||
| 458 | |||
| 459 | pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1)); | ||
| 460 | |||
| 461 | pmlmeext->TSFValue = pmlmeext->TSFValue << 32; | ||
| 462 | |||
| 463 | pmlmeext->TSFValue |= le32_to_cpu(*pbuf); | ||
| 464 | } | ||
| 465 | |||
| 466 | static void correct_TSF(struct adapter *padapter) | 392 | static void correct_TSF(struct adapter *padapter) |
| 467 | { | 393 | { |
| 468 | u8 reg; | 394 | u8 reg; |
| @@ -506,7 +432,7 @@ Following are the callback functions for each subtype of the management frames · 37 unmodified lines | |||
| 506 | 432 | ||
| 507 | *****************************************************************************/ | 433 | *****************************************************************************/ |
| 508 | 434 | ||
| 509 | unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame) | 435 | static void OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame) |
| 510 | { | 436 | { |
| 511 | unsigned int ielen; | 437 | unsigned int ielen; |
| 512 | unsigned char *p; | 438 | unsigned char *p; |
| @@ -540,17 +466,17 @@ unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame · 27 unmodified lines | |||
| 540 | report_survey_event(padapter, precv_frame); | 466 | report_survey_event(padapter, precv_frame); |
| 541 | p2p_listen_state_process(padapter, get_sa(pframe)); | 467 | p2p_listen_state_process(padapter, get_sa(pframe)); |
| 542 | 468 | ||
| 543 | return _SUCCESS; | 469 | return; |
| 544 | } | 470 | } |
| 545 | } | 471 | } |
| 546 | } | 472 | } |
| 547 | 473 | ||
| 548 | if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) | 474 | if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) |
| 549 | return _SUCCESS; | 475 | return; |
| 550 | 476 | ||
| 551 | if (!check_fwstate(pmlmepriv, _FW_LINKED) && | 477 | if (!check_fwstate(pmlmepriv, _FW_LINKED) && |
| 552 | !check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) | 478 | !check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) |
| 553 | return _SUCCESS; | 479 | return; |
| 554 | 480 | ||
| 555 | p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen, | 481 | p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen, |
| 556 | len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); | 482 | len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); |
| @@ -562,7 +488,7 @@ unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame · 5 unmodified lines | |||
| 562 | 488 | ||
| 563 | if ((ielen != 0 && memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) || | 489 | if ((ielen != 0 && memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) || |
| 564 | (ielen == 0 && pmlmeinfo->hidden_ssid_mode)) | 490 | (ielen == 0 && pmlmeinfo->hidden_ssid_mode)) |
| 565 | return _SUCCESS; | 491 | return; |
| 566 | 492 | ||
| 567 | _issue_probersp: | 493 | _issue_probersp: |
| 568 | 494 | ||
| @@ -571,10 +497,9 @@ _issue_probersp: · 2 unmodified lines | |||
| 571 | check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) | 497 | check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) |
| 572 | issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); | 498 | issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); |
| 573 | } | 499 | } |
| 574 | return _SUCCESS; | ||
| 575 | } | 500 | } |
| 576 | 501 | ||
| 577 | unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame) | 502 | static void OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame) |
| 578 | { | 503 | { |
| 579 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 504 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 580 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; | 505 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; |
| @@ -596,7 +521,7 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame · 15 unmodified lines | |||
| 596 | } | 521 | } |
| 597 | } | 522 | } |
| 598 | } | 523 | } |
| 599 | return _SUCCESS; | 524 | return; |
| 600 | } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { | 525 | } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { |
| 601 | if (pwdinfo->nego_req_info.benable) { | 526 | if (pwdinfo->nego_req_info.benable) { |
| 602 | if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN)) { | 527 | if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN)) { |
| @@ -614,14 +539,13 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame · 11 unmodified lines | |||
| 614 | } | 539 | } |
| 615 | if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { | 540 | if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { |
| 616 | report_survey_event(padapter, precv_frame); | 541 | report_survey_event(padapter, precv_frame); |
| 617 | return _SUCCESS; | 542 | return; |
| 618 | } | 543 | } |
| 619 | |||
| 620 | return _SUCCESS; | ||
| 621 | } | 544 | } |
| 622 | 545 | ||
| 623 | unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) | 546 | static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) |
| 624 | { | 547 | { |
| 548 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | ||
| 625 | int cam_idx; | 549 | int cam_idx; |
| 626 | struct sta_info *psta; | 550 | struct sta_info *psta; |
| 627 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 551 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| @@ -631,86 +555,86 @@ unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) · 3 unmodified lines | |||
| 631 | u8 *pframe = precv_frame->rx_data; | 555 | u8 *pframe = precv_frame->rx_data; |
| 632 | uint len = precv_frame->len; | 556 | uint len = precv_frame->len; |
| 633 | struct wlan_bssid_ex *pbss; | 557 | struct wlan_bssid_ex *pbss; |
| 634 | int ret = _SUCCESS; | 558 | u8 *ie_ptr; |
| 559 | u32 ie_len; | ||
| 560 | |||
| 561 | ie_ptr = (u8 *)&mgmt->u.beacon.variable; | ||
| 562 | if (precv_frame->len < offsetof(struct ieee80211_mgmt, u.beacon.variable)) | ||
| 563 | return; | ||
| 564 | ie_len = precv_frame->len - offsetof(struct ieee80211_mgmt, u.beacon.variable); | ||
| 635 | 565 | ||
| 636 | if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { | 566 | if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { |
| 637 | report_survey_event(padapter, precv_frame); | 567 | report_survey_event(padapter, precv_frame); |
| 638 | return _SUCCESS; | 568 | return; |
| 639 | } | 569 | } |
| 640 | 570 | ||
| 641 | if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) { | 571 | if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) |
| 642 | if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { | 572 | return; |
| 643 | /* we should update current network before auth, or some IE is wrong */ | ||
| 644 | pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC); | ||
| 645 | if (pbss) { | ||
| 646 | if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { | ||
| 647 | update_network(&pmlmepriv->cur_network.network, pbss, padapter, true); | ||
| 648 | rtw_get_bcn_info(&pmlmepriv->cur_network); | ||
| 649 | } | ||
| 650 | kfree(pbss); | ||
| 651 | } | ||
| 652 | 573 | ||
| 653 | /* check the vendor of the assoc AP */ | 574 | if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { |
| 654 | pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); | 575 | /* we should update current network before auth, or some IE is wrong */ |
| 576 | pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC); | ||
| 577 | if (!pbss) | ||
| 578 | return; | ||
| 655 | 579 | ||
| 656 | /* update TSF Value */ | 580 | if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { |
| 657 | update_TSF(pmlmeext, pframe); | 581 | update_network(&pmlmepriv->cur_network.network, pbss, padapter, true); |
| 582 | rtw_get_bcn_info(&pmlmepriv->cur_network); | ||
| 583 | } | ||
| 584 | kfree(pbss); | ||
| 658 | 585 | ||
| 659 | /* start auth */ | 586 | /* check the vendor of the assoc AP */ |
| 660 | start_clnt_auth(padapter); | 587 | pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); |
| 661 | 588 | ||
| 662 | return _SUCCESS; | 589 | pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp); |
| 590 | |||
| 591 | /* start auth */ | ||
| 592 | start_clnt_auth(padapter); | ||
| 593 | |||
| 594 | return; | ||
| 595 | } | ||
| 596 | |||
| 597 | if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { | ||
| 598 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); | ||
| 599 | if (!psta) | ||
| 600 | return; | ||
| 601 | |||
| 602 | if (rtw_check_bcn_info(padapter, pframe, len) != _SUCCESS) { | ||
| 603 | receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0); | ||
| 604 | return; | ||
| 663 | } | 605 | } |
| 606 | /* update WMM, ERP in the beacon */ | ||
| 607 | /* todo: the timer is used instead of the number of the beacon received */ | ||
| 608 | if ((sta_rx_pkts(psta) & 0xf) == 0) | ||
| 609 | update_beacon_info(padapter, ie_ptr, ie_len, psta); | ||
| 610 | process_p2p_ps_ie(padapter, ie_ptr, ie_len); | ||
| 611 | } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { | ||
| 612 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); | ||
| 613 | if (psta) { | ||
| 614 | /* update WMM, ERP in the beacon */ | ||
| 615 | /* todo: the timer is used instead of the number of the beacon received */ | ||
| 616 | if ((sta_rx_pkts(psta) & 0xf) == 0) | ||
| 617 | update_beacon_info(padapter, ie_ptr, ie_len, psta); | ||
| 618 | } else { | ||
| 619 | /* allocate a new CAM entry for IBSS station */ | ||
| 620 | cam_idx = allocate_fw_sta_entry(padapter); | ||
| 621 | if (cam_idx == NUM_STA) | ||
| 622 | return; | ||
| 664 | 623 | ||
| 665 | if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { | 624 | /* get supported rate */ |
| 666 | psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); | 625 | if (update_sta_support_rate(padapter, ie_ptr, ie_len, cam_idx) == _FAIL) { |
| 667 | if (psta) { | 626 | pmlmeinfo->FW_sta_info[cam_idx].status = 0; |
| 668 | ret = rtw_check_bcn_info(padapter, pframe, len); | 627 | return; |
| 669 | if (!ret) { | ||
| 670 | receive_disconnect(padapter, | ||
| 671 | pmlmeinfo->network.MacAddress, 0); | ||
| 672 | return _SUCCESS; | ||
| 673 | } | ||
| 674 | /* update WMM, ERP in the beacon */ | ||
| 675 | /* todo: the timer is used instead of the number of the beacon received */ | ||
| 676 | if ((sta_rx_pkts(psta) & 0xf) == 0) | ||
| 677 | update_beacon_info(padapter, pframe, len, psta); | ||
| 678 | process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN)); | ||
| 679 | } | 628 | } |
| 680 | } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { | ||
| 681 | psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); | ||
| 682 | if (psta) { | ||
| 683 | /* update WMM, ERP in the beacon */ | ||
| 684 | /* todo: the timer is used instead of the number of the beacon received */ | ||
| 685 | if ((sta_rx_pkts(psta) & 0xf) == 0) | ||
| 686 | update_beacon_info(padapter, pframe, len, psta); | ||
| 687 | } else { | ||
| 688 | /* allocate a new CAM entry for IBSS station */ | ||
| 689 | cam_idx = allocate_fw_sta_entry(padapter); | ||
| 690 | if (cam_idx == NUM_STA) | ||
| 691 | goto _END_ONBEACON_; | ||
| 692 | |||
| 693 | /* get supported rate */ | ||
| 694 | if (update_sta_support_rate(padapter, (pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_), (len - WLAN_HDR_A3_LEN - _BEACON_IE_OFFSET_), cam_idx) == _FAIL) { | ||
| 695 | pmlmeinfo->FW_sta_info[cam_idx].status = 0; | ||
| 696 | goto _END_ONBEACON_; | ||
| 697 | } | ||
| 698 | 629 | ||
| 699 | /* update TSF Value */ | 630 | pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp); |
| 700 | update_TSF(pmlmeext, pframe); | ||
| 701 | 631 | ||
| 702 | /* report sta add event */ | 632 | report_add_sta_event(padapter, mgmt->sa, cam_idx); |
| 703 | report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx); | ||
| 704 | } | ||
| 705 | } | 633 | } |
| 706 | } | 634 | } |
| 707 | |||
| 708 | _END_ONBEACON_: | ||
| 709 | |||
| 710 | return _SUCCESS; | ||
| 711 | } | 635 | } |
| 712 | 636 | ||
| 713 | unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) | 637 | static void OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) |
| 714 | { | 638 | { |
| 715 | unsigned int auth_mode, ie_len; | 639 | unsigned int auth_mode, ie_len; |
| 716 | u16 seq; | 640 | u16 seq; |
| @@ -727,7 +651,7 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) · 10 unmodified lines | |||
| 727 | uint len = precv_frame->len; | 651 | uint len = precv_frame->len; |
| 728 | 652 | ||
| 729 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) | 653 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) |
| 730 | return _FAIL; | 654 | return; |
| 731 | 655 | ||
| 732 | sa = GetAddr2Ptr(pframe); | 656 | sa = GetAddr2Ptr(pframe); |
| 733 | 657 | ||
| @@ -843,7 +767,7 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) · 109 unmodified lines | |||
| 843 | if (pstat->state & WIFI_FW_AUTH_SUCCESS) | 767 | if (pstat->state & WIFI_FW_AUTH_SUCCESS) |
| 844 | pstat->auth_seq = 0; | 768 | pstat->auth_seq = 0; |
| 845 | 769 | ||
| 846 | return _SUCCESS; | 770 | return; |
| 847 | 771 | ||
| 848 | auth_fail: | 772 | auth_fail: |
| 849 | 773 | ||
| @@ -856,27 +780,26 @@ auth_fail: · 6 unmodified lines | |||
| 856 | memcpy(pstat->hwaddr, sa, 6); | 780 | memcpy(pstat->hwaddr, sa, 6); |
| 857 | 781 | ||
| 858 | issue_auth(padapter, pstat, (unsigned short)status); | 782 | issue_auth(padapter, pstat, (unsigned short)status); |
| 859 | return _FAIL; | ||
| 860 | } | 783 | } |
| 861 | 784 | ||
| 862 | unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame) | 785 | static void OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame) |
| 863 | { | 786 | { |
| 864 | unsigned int seq, len, status, offset; | 787 | unsigned int seq, len, status, offset; |
| 865 | unsigned char *p; | 788 | unsigned char *p; |
| 866 | unsigned int go2asoc = 0; | ||
| 867 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 789 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 868 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 790 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 791 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; | ||
| 869 | u8 *pframe = precv_frame->rx_data; | 792 | u8 *pframe = precv_frame->rx_data; |
| 870 | uint pkt_len = precv_frame->len; | 793 | uint pkt_len = precv_frame->len; |
| 871 | 794 | ||
| 872 | /* check A1 matches or not */ | 795 | /* check A1 matches or not */ |
| 873 | if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN)) | 796 | if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA(hdr), ETH_ALEN)) |
| 874 | return _SUCCESS; | 797 | return; |
| 875 | 798 | ||
| 876 | if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) | 799 | if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) |
| 877 | return _SUCCESS; | 800 | return; |
| 878 | 801 | ||
| 879 | offset = (GetPrivacy(pframe)) ? 4 : 0; | 802 | offset = ieee80211_has_protected(hdr->frame_control) ? 4 : 0; |
| 880 | 803 | ||
| 881 | seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2)); | 804 | seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2)); |
| 882 | status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4)); | 805 | status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4)); |
| @@ -890,7 +813,7 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra · 7 unmodified lines | |||
| 890 | } | 813 | } |
| 891 | 814 | ||
| 892 | set_link_timer(pmlmeext, 1); | 815 | set_link_timer(pmlmeext, 1); |
| 893 | goto authclnt_fail; | 816 | return; |
| 894 | } | 817 | } |
| 895 | 818 | ||
| 896 | if (seq == 2) { | 819 | if (seq == 2) { |
| @@ -900,34 +823,22 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra · 3 unmodified lines | |||
| 900 | pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); | 823 | pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); |
| 901 | 824 | ||
| 902 | if (!p) | 825 | if (!p) |
| 903 | goto authclnt_fail; | 826 | return; |
| 904 | 827 | ||
| 905 | memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len); | 828 | memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len); |
| 906 | pmlmeinfo->auth_seq = 3; | 829 | pmlmeinfo->auth_seq = 3; |
| 907 | issue_auth(padapter, NULL, 0); | 830 | issue_auth(padapter, NULL, 0); |
| 908 | set_link_timer(pmlmeext, REAUTH_TO); | 831 | set_link_timer(pmlmeext, REAUTH_TO); |
| 909 | 832 | ||
| 910 | return _SUCCESS; | 833 | return; |
| 911 | } else { | 834 | } else { |
| 912 | /* open system */ | 835 | /* open system */ |
| 913 | go2asoc = 1; | 836 | start_clnt_assoc(padapter); |
| 914 | } | 837 | } |
| 915 | } else if (seq == 4) { | 838 | } else if (seq == 4) { |
| 916 | if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) | 839 | if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) |
| 917 | go2asoc = 1; | 840 | start_clnt_assoc(padapter); |
| 918 | else | ||
| 919 | goto authclnt_fail; | ||
| 920 | } else { | ||
| 921 | /* this is also illegal */ | ||
| 922 | goto authclnt_fail; | ||
| 923 | } | 841 | } |
| 924 | |||
| 925 | if (go2asoc) { | ||
| 926 | start_clnt_assoc(padapter); | ||
| 927 | return _SUCCESS; | ||
| 928 | } | ||
| 929 | authclnt_fail: | ||
| 930 | return _FAIL; | ||
| 931 | } | 842 | } |
| 932 | 843 | ||
| 933 | static void UpdateBrateTbl(u8 *mbrate) | 844 | static void UpdateBrateTbl(u8 *mbrate) |
| @@ -970,7 +881,7 @@ static void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen) · 36 unmodified lines | |||
| 970 | } | 881 | } |
| 971 | } | 882 | } |
| 972 | 883 | ||
| 973 | unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame) | 884 | static void OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame) |
| 974 | { | 885 | { |
| 975 | u16 capab_info; | 886 | u16 capab_info; |
| 976 | struct rtw_ieee802_11_elems elems; | 887 | struct rtw_ieee802_11_elems elems; |
| @@ -996,7 +907,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 19 unmodified lines | |||
| 996 | u32 p2pielen = 0; | 907 | u32 p2pielen = 0; |
| 997 | 908 | ||
| 998 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) | 909 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) |
| 999 | return _FAIL; | 910 | return; |
| 1000 | 911 | ||
| 1001 | frame_type = GetFrameSubType(pframe); | 912 | frame_type = GetFrameSubType(pframe); |
| 1002 | if (frame_type == WIFI_ASSOCREQ) | 913 | if (frame_type == WIFI_ASSOCREQ) |
| @@ -1005,7 +916,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 2 unmodified lines | |||
| 1005 | ie_offset = _REASOCREQ_IE_OFFSET_; | 916 | ie_offset = _REASOCREQ_IE_OFFSET_; |
| 1006 | 917 | ||
| 1007 | if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) | 918 | if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) |
| 1008 | return _FAIL; | 919 | return; |
| 1009 | 920 | ||
| 1010 | pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); | 921 | pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); |
| 1011 | if (pstat == (struct sta_info *)NULL) { | 922 | if (pstat == (struct sta_info *)NULL) { |
| @@ -1359,13 +1270,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 347 unmodified lines | |||
| 1359 | report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); | 1270 | report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); |
| 1360 | } | 1271 | } |
| 1361 | 1272 | ||
| 1362 | return _SUCCESS; | 1273 | return; |
| 1363 | 1274 | ||
| 1364 | asoc_class2_error: | 1275 | asoc_class2_error: |
| 1365 | 1276 | ||
| 1366 | issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status); | 1277 | issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status); |
| 1367 | 1278 | ||
| 1368 | return _FAIL; | 1279 | return; |
| 1369 | 1280 | ||
| 1370 | OnAssocReqFail: | 1281 | OnAssocReqFail: |
| 1371 | 1282 | ||
| @@ -1375,10 +1286,10 @@ OnAssocReqFail: · 3 unmodified lines | |||
| 1375 | else | 1286 | else |
| 1376 | issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); | 1287 | issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); |
| 1377 | 1288 | ||
| 1378 | return _FAIL; | 1289 | return; |
| 1379 | } | 1290 | } |
| 1380 | 1291 | ||
| 1381 | unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame) | 1292 | static void OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame) |
| 1382 | { | 1293 | { |
| 1383 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | 1294 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; |
| 1384 | uint i; | 1295 | uint i; |
| @@ -1392,13 +1303,13 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame · 7 unmodified lines | |||
| 1392 | 1303 | ||
| 1393 | /* check A1 matches or not */ | 1304 | /* check A1 matches or not */ |
| 1394 | if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) | 1305 | if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) |
| 1395 | return _SUCCESS; | 1306 | return; |
| 1396 | 1307 | ||
| 1397 | if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE))) | 1308 | if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE))) |
| 1398 | return _SUCCESS; | 1309 | return; |
| 1399 | 1310 | ||
| 1400 | if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) | 1311 | if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) |
| 1401 | return _SUCCESS; | 1312 | return; |
| 1402 | 1313 | ||
| 1403 | _cancel_timer_ex(&pmlmeext->link_timer); | 1314 | _cancel_timer_ex(&pmlmeext->link_timer); |
| 1404 | 1315 | ||
| @@ -1451,163 +1362,143 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame · 46 unmodified lines | |||
| 1451 | 1362 | ||
| 1452 | report_assoc_result: | 1363 | report_assoc_result: |
| 1453 | report_join_res(padapter, res); | 1364 | report_join_res(padapter, res); |
| 1454 | |||
| 1455 | return _SUCCESS; | ||
| 1456 | } | 1365 | } |
| 1457 | 1366 | ||
| 1458 | unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) | 1367 | static void OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) |
| 1459 | { | 1368 | { |
| 1369 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | ||
| 1460 | unsigned short reason; | 1370 | unsigned short reason; |
| 1461 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 1371 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 1462 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 1372 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 1463 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 1373 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 1464 | u8 *pframe = precv_frame->rx_data; | ||
| 1465 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; | 1374 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; |
| 1466 | 1375 | ||
| 1467 | /* check A3 */ | 1376 | if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) |
| 1468 | if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) | 1377 | return; |
| 1469 | return _SUCCESS; | ||
| 1470 | 1378 | ||
| 1471 | if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { | 1379 | if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { |
| 1472 | _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); | 1380 | _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); |
| 1473 | _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); | 1381 | _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); |
| 1474 | } | 1382 | } |
| 1475 | 1383 | ||
| 1476 | reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); | 1384 | reason = le16_to_cpu(mgmt->u.disassoc.reason_code); |
| 1477 | 1385 | ||
| 1478 | if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { | 1386 | if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { |
| 1479 | struct sta_info *psta; | 1387 | struct sta_info *psta; |
| 1480 | struct sta_priv *pstapriv = &padapter->stapriv; | 1388 | struct sta_priv *pstapriv = &padapter->stapriv; |
| 1389 | u8 updated = 0; | ||
| 1481 | 1390 | ||
| 1482 | psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); | 1391 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); |
| 1483 | if (psta) { | 1392 | if (!psta) |
| 1484 | u8 updated = 0; | 1393 | return; |
| 1485 | |||
| 1486 | spin_lock_bh(&pstapriv->asoc_list_lock); | ||
| 1487 | if (!list_empty(&psta->asoc_list)) { | ||
| 1488 | list_del_init(&psta->asoc_list); | ||
| 1489 | pstapriv->asoc_list_cnt--; | ||
| 1490 | updated = ap_free_sta(padapter, psta, false, reason); | ||
| 1491 | } | ||
| 1492 | spin_unlock_bh(&pstapriv->asoc_list_lock); | ||
| 1493 | 1394 | ||
| 1494 | associated_clients_update(padapter, updated); | 1395 | spin_lock_bh(&pstapriv->asoc_list_lock); |
| 1396 | if (!list_empty(&psta->asoc_list)) { | ||
| 1397 | list_del_init(&psta->asoc_list); | ||
| 1398 | pstapriv->asoc_list_cnt--; | ||
| 1399 | updated = ap_free_sta(padapter, psta, false, reason); | ||
| 1495 | } | 1400 | } |
| 1401 | spin_unlock_bh(&pstapriv->asoc_list_lock); | ||
| 1496 | 1402 | ||
| 1497 | return _SUCCESS; | 1403 | associated_clients_update(padapter, updated); |
| 1498 | } else { | 1404 | } else { |
| 1499 | int ignore_received_deauth = 0; | 1405 | bool ignore_received_deauth = false; |
| 1500 | 1406 | ||
| 1501 | /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, | 1407 | /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, |
| 1502 | * we will send the deauth first. | 1408 | * we will send the deauth first. |
| 1503 | * However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. | 1409 | * However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. |
| 1504 | * Added the following code to avoid this case. | 1410 | * Added the following code to avoid this case. |
| 1505 | */ | 1411 | */ |
| 1506 | if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) || | 1412 | if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) { |
| 1507 | (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) { | ||
| 1508 | if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { | 1413 | if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { |
| 1509 | ignore_received_deauth = 1; | 1414 | ignore_received_deauth = true; |
| 1510 | } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { | 1415 | } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { |
| 1511 | // TODO: 802.11r | 1416 | // TODO: 802.11r |
| 1512 | ignore_received_deauth = 1; | 1417 | ignore_received_deauth = true; |
| 1513 | } | 1418 | } |
| 1514 | } | 1419 | } |
| 1515 | 1420 | ||
| 1516 | if (!ignore_received_deauth) | 1421 | if (!ignore_received_deauth) |
| 1517 | receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); | 1422 | receive_disconnect(padapter, mgmt->bssid, reason); |
| 1423 | |||
| 1424 | pmlmepriv->LinkDetectInfo.bBusyTraffic = false; | ||
| 1518 | } | 1425 | } |
| 1519 | pmlmepriv->LinkDetectInfo.bBusyTraffic = false; | ||
| 1520 | return _SUCCESS; | ||
| 1521 | } | 1426 | } |
| 1522 | 1427 | ||
| 1523 | unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) | 1428 | static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) |
| 1524 | { | 1429 | { |
| 1430 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | ||
| 1525 | u16 reason; | 1431 | u16 reason; |
| 1526 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 1432 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 1527 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 1433 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 1528 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 1434 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 1529 | u8 *pframe = precv_frame->rx_data; | ||
| 1530 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; | 1435 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; |
| 1436 | struct sta_info *psta; | ||
| 1437 | struct sta_priv *pstapriv = &padapter->stapriv; | ||
| 1438 | u8 updated = 0; | ||
| 1531 | 1439 | ||
| 1532 | /* check A3 */ | 1440 | if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) |
| 1533 | if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) | 1441 | return; |
| 1534 | return _SUCCESS; | ||
| 1535 | 1442 | ||
| 1536 | if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { | 1443 | if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { |
| 1537 | _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); | 1444 | _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); |
| 1538 | _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); | 1445 | _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); |
| 1539 | } | 1446 | } |
| 1540 | 1447 | ||
| 1541 | reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); | 1448 | reason = le16_to_cpu(mgmt->u.disassoc.reason_code); |
| 1542 | |||
| 1543 | if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { | ||
| 1544 | struct sta_info *psta; | ||
| 1545 | struct sta_priv *pstapriv = &padapter->stapriv; | ||
| 1546 | |||
| 1547 | psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); | ||
| 1548 | if (psta) { | ||
| 1549 | u8 updated = 0; | ||
| 1550 | 1449 | ||
| 1551 | spin_lock_bh(&pstapriv->asoc_list_lock); | 1450 | if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) { |
| 1552 | if (!list_empty(&psta->asoc_list)) { | 1451 | receive_disconnect(padapter, mgmt->bssid, reason); |
| 1553 | list_del_init(&psta->asoc_list); | 1452 | pmlmepriv->LinkDetectInfo.bBusyTraffic = false; |
| 1554 | pstapriv->asoc_list_cnt--; | 1453 | return; |
| 1555 | updated = ap_free_sta(padapter, psta, false, reason); | 1454 | } |
| 1556 | } | ||
| 1557 | spin_unlock_bh(&pstapriv->asoc_list_lock); | ||
| 1558 | 1455 | ||
| 1559 | associated_clients_update(padapter, updated); | 1456 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); |
| 1560 | } | 1457 | if (!psta) |
| 1458 | return; | ||
| 1561 | 1459 | ||
| 1562 | return _SUCCESS; | 1460 | spin_lock_bh(&pstapriv->asoc_list_lock); |
| 1563 | } else { | 1461 | if (!list_empty(&psta->asoc_list)) { |
| 1564 | receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); | 1462 | list_del_init(&psta->asoc_list); |
| 1463 | pstapriv->asoc_list_cnt--; | ||
| 1464 | updated = ap_free_sta(padapter, psta, false, reason); | ||
| 1565 | } | 1465 | } |
| 1566 | pmlmepriv->LinkDetectInfo.bBusyTraffic = false; | 1466 | spin_unlock_bh(&pstapriv->asoc_list_lock); |
| 1567 | return _SUCCESS; | 1467 | |
| 1468 | associated_clients_update(padapter, updated); | ||
| 1568 | } | 1469 | } |
| 1569 | 1470 | ||
| 1570 | unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) | 1471 | static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) |
| 1571 | { | 1472 | { |
| 1572 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | 1473 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; |
| 1573 | struct sta_info *psta = NULL; | 1474 | struct sta_info *psta = NULL; |
| 1574 | struct recv_reorder_ctrl *preorder_ctrl; | 1475 | struct recv_reorder_ctrl *preorder_ctrl; |
| 1575 | unsigned char *frame_body; | ||
| 1576 | unsigned short tid; | 1476 | unsigned short tid; |
| 1577 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 1477 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 1578 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 1478 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 1579 | u8 *pframe = precv_frame->rx_data; | ||
| 1580 | struct sta_priv *pstapriv = &padapter->stapriv; | 1479 | struct sta_priv *pstapriv = &padapter->stapriv; |
| 1581 | /* check RA matches or not */ | ||
| 1582 | if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ | ||
| 1583 | return _SUCCESS; | ||
| 1584 | 1480 | ||
| 1585 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) | 1481 | if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) |
| 1586 | if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) | 1482 | if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) |
| 1587 | return _SUCCESS; | 1483 | return; |
| 1588 | 1484 | ||
| 1589 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); | 1485 | psta = rtw_get_stainfo(pstapriv, mgmt->sa); |
| 1590 | |||
| 1591 | if (!psta) | 1486 | if (!psta) |
| 1592 | return _SUCCESS; | 1487 | return; |
| 1593 | |||
| 1594 | frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); | ||
| 1595 | 1488 | ||
| 1596 | if (!pmlmeinfo->HT_enable) | 1489 | if (!pmlmeinfo->HT_enable) |
| 1597 | return _SUCCESS; | 1490 | return; |
| 1598 | /* All union members start with an action code, it's ok to use addba_req. */ | 1491 | /* All union members start with an action code, it's ok to use addba_req. */ |
| 1599 | switch (mgmt->u.action.u.addba_req.action_code) { | 1492 | switch (mgmt->u.action.u.addba_req.action_code) { |
| 1600 | case WLAN_ACTION_ADDBA_REQ: | 1493 | case WLAN_ACTION_ADDBA_REQ: |
| 1601 | memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request)); | ||
| 1602 | tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab), | 1494 | tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab), |
| 1603 | IEEE80211_ADDBA_PARAM_TID_MASK); | 1495 | IEEE80211_ADDBA_PARAM_TID_MASK); |
| 1604 | preorder_ctrl = &psta->recvreorder_ctrl[tid]; | 1496 | preorder_ctrl = &psta->recvreorder_ctrl[tid]; |
| 1605 | preorder_ctrl->indicate_seq = 0xffff; | 1497 | preorder_ctrl->indicate_seq = 0xffff; |
| 1606 | preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq; | 1498 | preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq; |
| 1607 | |||
| 1608 | issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, | 1499 | issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, |
| 1609 | pmlmeinfo->bAcceptAddbaReq ? | 1500 | pmlmeinfo->bAcceptAddbaReq ? |
| 1610 | WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED); | 1501 | WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED, mgmt); |
| 1611 | break; | 1502 | break; |
| 1612 | case WLAN_ACTION_ADDBA_RESP: | 1503 | case WLAN_ACTION_ADDBA_RESP: |
| 1613 | tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), | 1504 | tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), |
| @@ -1636,8 +1527,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr · 22 unmodified lines | |||
| 1636 | default: | 1527 | default: |
| 1637 | break; | 1528 | break; |
| 1638 | } | 1529 | } |
| 1639 | |||
| 1640 | return _SUCCESS; | ||
| 1641 | } | 1530 | } |
| 1642 | 1531 | ||
| 1643 | static int get_reg_classes_full_count(struct p2p_channels *channel_list) | 1532 | static int get_reg_classes_full_count(struct p2p_channels *channel_list) |
| @@ -1754,7 +1643,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr) · 110 unmodified lines | |||
| 1754 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ | 1643 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ |
| 1755 | 1644 | ||
| 1756 | /* Commented by Albert 20110306 */ | 1645 | /* Commented by Albert 20110306 */ |
| 1757 | /* According to the P2P Specification, the group negoitation request frame should contain 9 P2P attributes */ | 1646 | /* According to the P2P Specification, the group negotiation request frame should contain 9 P2P attributes */ |
| 1758 | /* 1. P2P Capability */ | 1647 | /* 1. P2P Capability */ |
| 1759 | /* 2. Group Owner Intent */ | 1648 | /* 2. Group Owner Intent */ |
| 1760 | /* 3. Configuration Timeout */ | 1649 | /* 3. Configuration Timeout */ |
| @@ -2109,7 +1998,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame · 348 unmodified lines | |||
| 2109 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ | 1998 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ |
| 2110 | 1999 | ||
| 2111 | /* Commented by Albert 20100908 */ | 2000 | /* Commented by Albert 20100908 */ |
| 2112 | /* According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes */ | 2001 | /* According to the P2P Specification, the group negotiation response frame should contain 9 P2P attributes */ |
| 2113 | /* 1. Status */ | 2002 | /* 1. Status */ |
| 2114 | /* 2. P2P Capability */ | 2003 | /* 2. P2P Capability */ |
| 2115 | /* 3. Group Owner Intent */ | 2004 | /* 3. Group Owner Intent */ |
| @@ -2405,7 +2294,7 @@ static void issue_p2p_GO_confirm(struct adapter *padapter, u8 *raddr, u8 result) · 289 unmodified lines | |||
| 2405 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ | 2294 | p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ |
| 2406 | 2295 | ||
| 2407 | /* Commented by Albert 20110306 */ | 2296 | /* Commented by Albert 20110306 */ |
| 2408 | /* According to the P2P Specification, the group negoitation request frame should contain 5 P2P attributes */ | 2297 | /* According to the P2P Specification, the group negotiation request frame should contain 5 P2P attributes */ |
| 2409 | /* 1. Status */ | 2298 | /* 1. Status */ |
| 2410 | /* 2. P2P Capability */ | 2299 | /* 2. P2P Capability */ |
| 2411 | /* 3. Operating Channel */ | 2300 | /* 3. Operating Channel */ |
| @@ -3294,9 +3183,8 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) · 882 unmodified lines | |||
| 3294 | dump_mgntframe(padapter, pmgntframe); | 3183 | dump_mgntframe(padapter, pmgntframe); |
| 3295 | } | 3184 | } |
| 3296 | 3185 | ||
| 3297 | static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) | 3186 | inline void issue_probereq_p2p(struct adapter *padapter) |
| 3298 | { | 3187 | { |
| 3299 | int ret = _FAIL; | ||
| 3300 | struct xmit_frame *pmgntframe; | 3188 | struct xmit_frame *pmgntframe; |
| 3301 | struct pkt_attrib *pattrib; | 3189 | struct pkt_attrib *pattrib; |
| 3302 | unsigned char *pframe; | 3190 | unsigned char *pframe; |
| @@ -3312,7 +3200,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 9 unmodified lines | |||
| 3312 | 3200 | ||
| 3313 | pmgntframe = alloc_mgtxmitframe(pxmitpriv); | 3201 | pmgntframe = alloc_mgtxmitframe(pxmitpriv); |
| 3314 | if (!pmgntframe) | 3202 | if (!pmgntframe) |
| 3315 | goto exit; | 3203 | return; |
| 3316 | 3204 | ||
| 3317 | /* update attribute */ | 3205 | /* update attribute */ |
| 3318 | pattrib = &pmgntframe->attrib; | 3206 | pattrib = &pmgntframe->attrib; |
| @@ -3328,20 +3216,16 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 9 unmodified lines | |||
| 3328 | fctrl = &pwlanhdr->frame_control; | 3216 | fctrl = &pwlanhdr->frame_control; |
| 3329 | *(fctrl) = 0; | 3217 | *(fctrl) = 0; |
| 3330 | 3218 | ||
| 3331 | if (da) { | 3219 | if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { |
| 3332 | memcpy(pwlanhdr->addr1, da, ETH_ALEN); | 3220 | /* This two flags will be set when this is only the P2P client mode. */ |
| 3333 | memcpy(pwlanhdr->addr3, da, ETH_ALEN); | 3221 | memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); |
| 3222 | memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); | ||
| 3334 | } else { | 3223 | } else { |
| 3335 | if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { | 3224 | /* broadcast probe request frame */ |
| 3336 | /* This two flags will be set when this is only the P2P client mode. */ | 3225 | eth_broadcast_addr(pwlanhdr->addr1); |
| 3337 | memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); | 3226 | eth_broadcast_addr(pwlanhdr->addr3); |
| 3338 | memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); | ||
| 3339 | } else { | ||
| 3340 | /* broadcast probe request frame */ | ||
| 3341 | eth_broadcast_addr(pwlanhdr->addr1); | ||
| 3342 | eth_broadcast_addr(pwlanhdr->addr3); | ||
| 3343 | } | ||
| 3344 | } | 3227 | } |
| 3228 | |||
| 3345 | memcpy(pwlanhdr->addr2, mac, ETH_ALEN); | 3229 | memcpy(pwlanhdr->addr2, mac, ETH_ALEN); |
| 3346 | 3230 | ||
| 3347 | SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); | 3231 | SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); |
| @@ -3567,23 +3451,10 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 219 unmodified lines | |||
| 3567 | 3451 | ||
| 3568 | pattrib->last_txcmdsz = pattrib->pktlen; | 3452 | pattrib->last_txcmdsz = pattrib->pktlen; |
| 3569 | 3453 | ||
| 3570 | if (wait_ack) { | 3454 | dump_mgntframe(padapter, pmgntframe); |
| 3571 | ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); | ||
| 3572 | } else { | ||
| 3573 | dump_mgntframe(padapter, pmgntframe); | ||
| 3574 | ret = _SUCCESS; | ||
| 3575 | } | ||
| 3576 | |||
| 3577 | exit: | ||
| 3578 | return ret; | ||
| 3579 | } | ||
| 3580 | |||
| 3581 | inline void issue_probereq_p2p(struct adapter *adapter, u8 *da) | ||
| 3582 | { | ||
| 3583 | _issue_probereq_p2p(adapter, da, false); | ||
| 3584 | } | 3455 | } |
| 3585 | 3456 | ||
| 3586 | static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) | 3457 | static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token) |
| 3587 | { | 3458 | { |
| 3588 | struct adapter *adapter = recv_frame->adapter; | 3459 | struct adapter *adapter = recv_frame->adapter; |
| 3589 | struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; | 3460 | struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; |
| @@ -3592,21 +3463,13 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) · 2 unmodified lines | |||
| 3592 | (recv_frame->attrib.frag_num & 0xf); | 3463 | (recv_frame->attrib.frag_num & 0xf); |
| 3593 | 3464 | ||
| 3594 | if (GetRetry(frame)) { | 3465 | if (GetRetry(frame)) { |
| 3595 | if (token >= 0) { | 3466 | if ((seq_ctrl == mlmeext->action_public_rxseq) && |
| 3596 | if ((seq_ctrl == mlmeext->action_public_rxseq) && | 3467 | (token == mlmeext->action_public_dialog_token)) |
| 3597 | (token == mlmeext->action_public_dialog_token)) | 3468 | return _FAIL; |
| 3598 | return _FAIL; | ||
| 3599 | } else { | ||
| 3600 | if (seq_ctrl == mlmeext->action_public_rxseq) | ||
| 3601 | return _FAIL; | ||
| 3602 | } | ||
| 3603 | } | 3469 | } |
| 3604 | 3470 | ||
| 3605 | mlmeext->action_public_rxseq = seq_ctrl; | 3471 | mlmeext->action_public_rxseq = seq_ctrl; |
| 3606 | 3472 | mlmeext->action_public_dialog_token = token; | |
| 3607 | if (token >= 0) | ||
| 3608 | mlmeext->action_public_dialog_token = token; | ||
| 3609 | |||
| 3610 | return _SUCCESS; | 3473 | return _SUCCESS; |
| 3611 | } | 3474 | } |
| 3612 | 3475 | ||
| @@ -3872,110 +3735,64 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) · 259 unmodified lines | |||
| 3872 | return _SUCCESS; | 3735 | return _SUCCESS; |
| 3873 | } | 3736 | } |
| 3874 | 3737 | ||
| 3875 | static unsigned int on_action_public_vendor(struct recv_frame *precv_frame) | 3738 | static void on_action_public_vendor(struct recv_frame *precv_frame) |
| 3876 | { | 3739 | { |
| 3877 | unsigned int ret = _FAIL; | ||
| 3878 | u8 *pframe = precv_frame->rx_data; | 3740 | u8 *pframe = precv_frame->rx_data; |
| 3879 | u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); | 3741 | u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); |
| 3880 | 3742 | ||
| 3881 | if (!memcmp(frame_body + 2, P2P_OUI, 4)) { | 3743 | if (!memcmp(frame_body + 2, P2P_OUI, 4)) |
| 3882 | ret = on_action_public_p2p(precv_frame); | 3744 | on_action_public_p2p(precv_frame); |
| 3883 | } | ||
| 3884 | |||
| 3885 | return ret; | ||
| 3886 | } | 3745 | } |
| 3887 | 3746 | ||
| 3888 | static unsigned int on_action_public_default(struct recv_frame *precv_frame) | 3747 | static void on_action_public_default(struct recv_frame *precv_frame) |
| 3889 | { | 3748 | { |
| 3890 | unsigned int ret = _FAIL; | ||
| 3891 | u8 *pframe = precv_frame->rx_data; | 3749 | u8 *pframe = precv_frame->rx_data; |
| 3892 | u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); | 3750 | u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); |
| 3893 | u8 token; | 3751 | u8 token; |
| 3894 | 3752 | ||
| 3895 | token = frame_body[2]; | 3753 | token = frame_body[2]; |
| 3896 | 3754 | ||
| 3897 | if (rtw_action_public_decache(precv_frame, token) == _FAIL) | 3755 | rtw_action_public_decache(precv_frame, token); |
| 3898 | goto exit; | ||
| 3899 | |||
| 3900 | ret = _SUCCESS; | ||
| 3901 | |||
| 3902 | exit: | ||
| 3903 | return ret; | ||
| 3904 | } | 3756 | } |
| 3905 | 3757 | ||
| 3906 | unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) | 3758 | static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) |
| 3907 | { | 3759 | { |
| 3908 | unsigned int ret = _FAIL; | 3760 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; |
| 3909 | u8 *pframe = precv_frame->rx_data; | ||
| 3910 | u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); | ||
| 3911 | u8 category, action; | ||
| 3912 | |||
| 3913 | /* check RA matches or not */ | ||
| 3914 | if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN)) | ||
| 3915 | goto exit; | ||
| 3916 | |||
| 3917 | category = frame_body[0]; | ||
| 3918 | if (category != WLAN_CATEGORY_PUBLIC) | ||
| 3919 | goto exit; | ||
| 3920 | |||
| 3921 | action = frame_body[1]; | ||
| 3922 | switch (action) { | ||
| 3923 | case ACT_PUBLIC_VENDOR: | ||
| 3924 | ret = on_action_public_vendor(precv_frame); | ||
| 3925 | break; | ||
| 3926 | default: | ||
| 3927 | ret = on_action_public_default(precv_frame); | ||
| 3928 | break; | ||
| 3929 | } | ||
| 3930 | 3761 | ||
| 3931 | exit: | 3762 | /* All members of the action enum start with action_code. */ |
| 3932 | return ret; | 3763 | if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) |
| 3764 | on_action_public_vendor(precv_frame); | ||
| 3765 | else | ||
| 3766 | on_action_public_default(precv_frame); | ||
| 3933 | } | 3767 | } |
| 3934 | 3768 | ||
| 3935 | unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) | 3769 | static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) |
| 3936 | { | 3770 | { |
| 3937 | u8 *frame_body; | 3771 | u8 *frame_body; |
| 3938 | u8 category, OUI_Subtype; | 3772 | u8 OUI_Subtype; |
| 3939 | u8 *pframe = precv_frame->rx_data; | 3773 | u8 *pframe = precv_frame->rx_data; |
| 3940 | uint len = precv_frame->len; | 3774 | uint len = precv_frame->len; |
| 3941 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; | 3775 | struct wifidirect_info *pwdinfo = &padapter->wdinfo; |
| 3942 | 3776 | ||
| 3943 | /* check RA matches or not */ | ||
| 3944 | if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ | ||
| 3945 | return _SUCCESS; | ||
| 3946 | |||
| 3947 | frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); | 3777 | frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); |
| 3948 | 3778 | ||
| 3949 | category = frame_body[0]; | ||
| 3950 | if (category != RTW_WLAN_CATEGORY_P2P) | ||
| 3951 | return _SUCCESS; | ||
| 3952 | |||
| 3953 | if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) | 3779 | if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) |
| 3954 | return _SUCCESS; | 3780 | return; |
| 3955 | 3781 | ||
| 3956 | len -= sizeof(struct ieee80211_hdr_3addr); | 3782 | len -= sizeof(struct ieee80211_hdr_3addr); |
| 3957 | OUI_Subtype = frame_body[5]; | 3783 | OUI_Subtype = frame_body[5]; |
| 3958 | 3784 | ||
| 3959 | switch (OUI_Subtype) { | 3785 | if (OUI_Subtype == P2P_PRESENCE_REQUEST) |
| 3960 | case P2P_NOTICE_OF_ABSENCE: | ||
| 3961 | break; | ||
| 3962 | case P2P_PRESENCE_REQUEST: | ||
| 3963 | process_p2p_presence_req(pwdinfo, pframe, len); | 3786 | process_p2p_presence_req(pwdinfo, pframe, len); |
| 3964 | break; | ||
| 3965 | case P2P_PRESENCE_RESPONSE: | ||
| 3966 | break; | ||
| 3967 | case P2P_GO_DISC_REQUEST: | ||
| 3968 | break; | ||
| 3969 | default: | ||
| 3970 | break; | ||
| 3971 | } | ||
| 3972 | return _SUCCESS; | ||
| 3973 | } | 3787 | } |
| 3974 | 3788 | ||
| 3975 | unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame) | 3789 | static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) |
| 3976 | { | 3790 | { |
| 3977 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | 3791 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; |
| 3978 | 3792 | ||
| 3793 | if (!ether_addr_equal(myid(&padapter->eeprompriv), mgmt->da)) | ||
| 3794 | return; | ||
| 3795 | |||
| 3979 | switch (mgmt->u.action.category) { | 3796 | switch (mgmt->u.action.category) { |
| 3980 | case WLAN_CATEGORY_BACK: | 3797 | case WLAN_CATEGORY_BACK: |
| 3981 | OnAction_back(padapter, precv_frame); | 3798 | OnAction_back(padapter, precv_frame); |
| @@ -3987,7 +3804,6 @@ unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame) · 5 unmodified lines | |||
| 3987 | OnAction_p2p(padapter, precv_frame); | 3804 | OnAction_p2p(padapter, precv_frame); |
| 3988 | break; | 3805 | break; |
| 3989 | } | 3806 | } |
| 3990 | return _SUCCESS; | ||
| 3991 | } | 3807 | } |
| 3992 | 3808 | ||
| 3993 | struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) | 3809 | struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) |
| @@ -4011,9 +3827,66 @@ struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) · 17 unmodified lines | |||
| 4011 | return pmgntframe; | 3827 | return pmgntframe; |
| 4012 | } | 3828 | } |
| 4013 | 3829 | ||
| 3830 | void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) | ||
| 3831 | { | ||
| 3832 | mlme_handler mlme_sta_tbl[] = { | ||
| 3833 | OnAssocReq, | ||
| 3834 | OnAssocRsp, | ||
| 3835 | OnAssocReq, | ||
| 3836 | OnAssocRsp, | ||
| 3837 | OnProbeReq, | ||
| 3838 | OnProbeRsp, | ||
| 3839 | NULL, | ||
| 3840 | NULL, | ||
| 3841 | OnBeacon, | ||
| 3842 | NULL, | ||
| 3843 | OnDisassoc, | ||
| 3844 | OnAuthClient, | ||
| 3845 | OnDeAuth, | ||
| 3846 | OnAction, | ||
| 3847 | }; | ||
| 3848 | int index; | ||
| 3849 | mlme_handler fct; | ||
| 3850 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | ||
| 3851 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; | ||
| 3852 | struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2); | ||
| 3853 | |||
| 3854 | if (!ieee80211_is_mgmt(hdr->frame_control)) | ||
| 3855 | return; | ||
| 3856 | |||
| 3857 | /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ | ||
| 3858 | if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) && | ||
| 3859 | !is_broadcast_ether_addr(hdr->addr1)) | ||
| 3860 | return; | ||
| 3861 | |||
| 3862 | index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4; | ||
| 3863 | if (index >= ARRAY_SIZE(mlme_sta_tbl)) | ||
| 3864 | return; | ||
| 3865 | fct = mlme_sta_tbl[index]; | ||
| 3866 | |||
| 3867 | if (psta) { | ||
| 3868 | if (ieee80211_has_retry(hdr->frame_control)) { | ||
| 3869 | if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) | ||
| 3870 | /* drop the duplicate management frame */ | ||
| 3871 | return; | ||
| 3872 | } | ||
| 3873 | psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num; | ||
| 3874 | } | ||
| 3875 | |||
| 3876 | if (ieee80211_is_auth(hdr->frame_control)) { | ||
| 3877 | if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) | ||
| 3878 | fct = OnAuth; | ||
| 3879 | else | ||
| 3880 | fct = OnAuthClient; | ||
| 3881 | } | ||
| 3882 | |||
| 3883 | if (fct) | ||
| 3884 | fct(padapter, precv_frame); | ||
| 3885 | } | ||
| 3886 | |||
| 4014 | /**************************************************************************** | 3887 | /**************************************************************************** |
| 4015 | 3888 | ||
| 4016 | Following are some TX fuctions for WiFi MLME | 3889 | Following are some TX functions for WiFi MLME |
| 4017 | 3890 | ||
| 4018 | *****************************************************************************/ | 3891 | *****************************************************************************/ |
| 4019 | 3892 | ||
| @@ -4059,9 +3932,6 @@ void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattri · 39 unmodified lines | |||
| 4059 | 3932 | ||
| 4060 | void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe) | 3933 | void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe) |
| 4061 | { | 3934 | { |
| 4062 | if (padapter->bSurpriseRemoved || padapter->bDriverStopped) | ||
| 4063 | return; | ||
| 4064 | |||
| 4065 | rtl8188eu_mgnt_xmit(padapter, pmgntframe); | 3935 | rtl8188eu_mgnt_xmit(padapter, pmgntframe); |
| 4066 | } | 3936 | } |
| 4067 | 3937 | ||
| @@ -4091,9 +3961,6 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg · 23 unmodified lines | |||
| 4091 | u32 timeout_ms = 500;/* 500ms */ | 3961 | u32 timeout_ms = 500;/* 500ms */ |
| 4092 | struct xmit_priv *pxmitpriv = &padapter->xmitpriv; | 3962 | struct xmit_priv *pxmitpriv = &padapter->xmitpriv; |
| 4093 | 3963 | ||
| 4094 | if (padapter->bSurpriseRemoved || padapter->bDriverStopped) | ||
| 4095 | return -1; | ||
| 4096 | |||
| 4097 | mutex_lock(&pxmitpriv->ack_tx_mutex); | 3964 | mutex_lock(&pxmitpriv->ack_tx_mutex); |
| 4098 | pxmitpriv->ack_tx = true; | 3965 | pxmitpriv->ack_tx = true; |
| 4099 | 3966 | ||
| @@ -4588,34 +4455,19 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps · 488 unmodified lines | |||
| 4588 | _issue_probereq(padapter, pssid, da, false); | 4455 | _issue_probereq(padapter, pssid, da, false); |
| 4589 | } | 4456 | } |
| 4590 | 4457 | ||
| 4591 | int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, | 4458 | void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da) |
| 4592 | int try_cnt, int wait_ms) | ||
| 4593 | { | 4459 | { |
| 4594 | int ret; | 4460 | int i; |
| 4595 | int i = 0; | ||
| 4596 | |||
| 4597 | do { | ||
| 4598 | ret = _issue_probereq(padapter, pssid, da, wait_ms > 0); | ||
| 4599 | |||
| 4600 | i++; | ||
| 4601 | 4461 | ||
| 4602 | if (padapter->bDriverStopped || padapter->bSurpriseRemoved) | 4462 | for (i = 0; i < 3; i++) { |
| 4463 | if (_issue_probereq(padapter, pssid, da, true) == _FAIL) | ||
| 4464 | msleep(1); | ||
| 4465 | else | ||
| 4603 | break; | 4466 | break; |
| 4604 | |||
| 4605 | if (i < try_cnt && wait_ms > 0 && ret == _FAIL) | ||
| 4606 | msleep(wait_ms); | ||
| 4607 | |||
| 4608 | } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); | ||
| 4609 | |||
| 4610 | if (ret != _FAIL) { | ||
| 4611 | ret = _SUCCESS; | ||
| 4612 | goto exit; | ||
| 4613 | } | 4467 | } |
| 4614 | exit: | ||
| 4615 | return ret; | ||
| 4616 | } | 4468 | } |
| 4617 | 4469 | ||
| 4618 | /* if psta == NULL, indiate we are station(client) now... */ | 4470 | /* if psta == NULL, indicate we are station (client) now... */ |
| 4619 | void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status) | 4471 | void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status) |
| 4620 | { | 4472 | { |
| 4621 | struct xmit_frame *pmgntframe; | 4473 | struct xmit_frame *pmgntframe; |
| @@ -5014,7 +4866,7 @@ void issue_assocreq(struct adapter *padapter) · 392 unmodified lines | |||
| 5014 | if (!padapter->registrypriv.wifi_spec) { | 4866 | if (!padapter->registrypriv.wifi_spec) { |
| 5015 | /* Commented by Kurt 20110629 */ | 4867 | /* Commented by Kurt 20110629 */ |
| 5016 | /* In some older APs, WPS handshake */ | 4868 | /* In some older APs, WPS handshake */ |
| 5017 | /* would be fail if we append vender extensions informations to AP */ | 4869 | /* would be fail if we append vendor extension information to AP */ |
| 5018 | if (!memcmp(pIE->data, WPS_OUI, 4)) | 4870 | if (!memcmp(pIE->data, WPS_OUI, 4)) |
| 5019 | pIE->Length = 14; | 4871 | pIE->Length = 14; |
| 5020 | } | 4872 | } |
| @@ -5169,7 +5021,7 @@ exit: · 148 unmodified lines | |||
| 5169 | kfree(pmlmepriv->assoc_req); | 5021 | kfree(pmlmepriv->assoc_req); |
| 5170 | } | 5022 | } |
| 5171 | 5023 | ||
| 5172 | /* when wait_ack is ture, this function shoule be called at process context */ | 5024 | /* when wait_ack is true, this function should be called at process context */ |
| 5173 | static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) | 5025 | static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) |
| 5174 | { | 5026 | { |
| 5175 | int ret = _FAIL; | 5027 | int ret = _FAIL; |
| @@ -5238,7 +5090,7 @@ exit: · 62 unmodified lines | |||
| 5238 | return ret; | 5090 | return ret; |
| 5239 | } | 5091 | } |
| 5240 | 5092 | ||
| 5241 | /* when wait_ms > 0 , this function shoule be called at process context */ | 5093 | /* when wait_ms > 0, this function should be called at process context */ |
| 5242 | /* da == NULL for station mode */ | 5094 | /* da == NULL for station mode */ |
| 5243 | int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) | 5095 | int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) |
| 5244 | { | 5096 | { |
| @@ -5247,7 +5099,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow · 2 unmodified lines | |||
| 5247 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 5099 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 5248 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 5100 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 5249 | 5101 | ||
| 5250 | /* da == NULL, assum it's null data for sta to ap*/ | 5102 | /* da == NULL, assume it's null data for sta to ap*/ |
| 5251 | if (!da) | 5103 | if (!da) |
| 5252 | da = get_my_bssid(&pmlmeinfo->network); | 5104 | da = get_my_bssid(&pmlmeinfo->network); |
| 5253 | 5105 | ||
| @@ -5271,7 +5123,7 @@ exit: · 17 unmodified lines | |||
| 5271 | return ret; | 5123 | return ret; |
| 5272 | } | 5124 | } |
| 5273 | 5125 | ||
| 5274 | /* when wait_ack is ture, this function shoule be called at process context */ | 5126 | /* when wait_ack is true, this function should be called at process context */ |
| 5275 | static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack) | 5127 | static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack) |
| 5276 | { | 5128 | { |
| 5277 | int ret = _FAIL; | 5129 | int ret = _FAIL; |
| @@ -5344,7 +5196,7 @@ exit: · 66 unmodified lines | |||
| 5344 | return ret; | 5196 | return ret; |
| 5345 | } | 5197 | } |
| 5346 | 5198 | ||
| 5347 | /* when wait_ms > 0 , this function shoule be called at process context */ | 5199 | /* when wait_ms > 0 , this function should be called at process context */ |
| 5348 | /* da == NULL for station mode */ | 5200 | /* da == NULL for station mode */ |
| 5349 | int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) | 5201 | int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) |
| 5350 | { | 5202 | { |
| @@ -5353,7 +5205,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int · 2 unmodified lines | |||
| 5353 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 5205 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 5354 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 5206 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 5355 | 5207 | ||
| 5356 | /* da == NULL, assum it's null data for sta to ap*/ | 5208 | /* da == NULL, assume it's null data for sta to ap*/ |
| 5357 | if (!da) | 5209 | if (!da) |
| 5358 | da = get_my_bssid(&pmlmeinfo->network); | 5210 | da = get_my_bssid(&pmlmeinfo->network); |
| 5359 | 5211 | ||
| @@ -5471,7 +5323,8 @@ exit: · 111 unmodified lines | |||
| 5471 | return ret; | 5323 | return ret; |
| 5472 | } | 5324 | } |
| 5473 | 5325 | ||
| 5474 | void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status) | 5326 | void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, |
| 5327 | u16 status, struct ieee80211_mgmt *mgmt_req) | ||
| 5475 | { | 5328 | { |
| 5476 | u16 start_seq; | 5329 | u16 start_seq; |
| 5477 | u16 BA_starting_seqctrl = 0; | 5330 | u16 BA_starting_seqctrl = 0; |
| @@ -5540,13 +5393,13 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, · 62 unmodified lines | |||
| 5540 | break; | 5393 | break; |
| 5541 | case WLAN_ACTION_ADDBA_RESP: | 5394 | case WLAN_ACTION_ADDBA_RESP: |
| 5542 | mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP; | 5395 | mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP; |
| 5543 | mgmt->u.action.u.addba_resp.dialog_token = pmlmeinfo->ADDBA_req.dialog_token; | 5396 | mgmt->u.action.u.addba_resp.dialog_token = mgmt_req->u.action.u.addba_req.dialog_token; |
| 5544 | mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); | 5397 | mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); |
| 5545 | capab = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f; | 5398 | capab = le16_to_cpu(mgmt_req->u.action.u.addba_req.capab) & 0x3f; |
| 5546 | capab |= u16_encode_bits(64, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); | 5399 | capab |= u16_encode_bits(64, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); |
| 5547 | capab |= u16_encode_bits(pregpriv->ampdu_amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK); | 5400 | capab |= u16_encode_bits(pregpriv->ampdu_amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK); |
| 5548 | mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); | 5401 | mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); |
| 5549 | mgmt->u.action.u.addba_resp.timeout = pmlmeinfo->ADDBA_req.BA_timeout_value; | 5402 | mgmt->u.action.u.addba_resp.timeout = mgmt_req->u.action.u.addba_req.timeout; |
| 5550 | pattrib->pktlen = offsetofend(struct ieee80211_mgmt, u.action.u.addba_resp.timeout); | 5403 | pattrib->pktlen = offsetofend(struct ieee80211_mgmt, u.action.u.addba_resp.timeout); |
| 5551 | break; | 5404 | break; |
| 5552 | case WLAN_ACTION_DELBA: | 5405 | case WLAN_ACTION_DELBA: |
| @@ -5714,7 +5567,8 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) · 161 unmodified lines | |||
| 5714 | if (initiator == 0) { /* recipient */ | 5567 | if (initiator == 0) { /* recipient */ |
| 5715 | for (tid = 0; tid < MAXTID; tid++) { | 5568 | for (tid = 0; tid < MAXTID; tid++) { |
| 5716 | if (psta->recvreorder_ctrl[tid].enable) { | 5569 | if (psta->recvreorder_ctrl[tid].enable) { |
| 5717 | issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F)); | 5570 | issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, |
| 5571 | (((tid << 1) | initiator) & 0x1F), NULL); | ||
| 5718 | psta->recvreorder_ctrl[tid].enable = false; | 5572 | psta->recvreorder_ctrl[tid].enable = false; |
| 5719 | psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; | 5573 | psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; |
| 5720 | } | 5574 | } |
| @@ -5722,7 +5576,8 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) · 1 unmodified line | |||
| 5722 | } else if (initiator == 1) { /* originator */ | 5576 | } else if (initiator == 1) { /* originator */ |
| 5723 | for (tid = 0; tid < MAXTID; tid++) { | 5577 | for (tid = 0; tid < MAXTID; tid++) { |
| 5724 | if (psta->htpriv.agg_enable_bitmap & BIT(tid)) { | 5578 | if (psta->htpriv.agg_enable_bitmap & BIT(tid)) { |
| 5725 | issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F)); | 5579 | issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, |
| 5580 | (((tid << 1) | initiator) & 0x1F), NULL); | ||
| 5726 | psta->htpriv.agg_enable_bitmap &= ~BIT(tid); | 5581 | psta->htpriv.agg_enable_bitmap &= ~BIT(tid); |
| 5727 | psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); | 5582 | psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); |
| 5728 | } | 5583 | } |
| @@ -5885,7 +5740,7 @@ static void rtw_set_opmode(struct adapter *adapter, u8 mode) · 156 unmodified lines | |||
| 5885 | 5740 | ||
| 5886 | /**************************************************************************** | 5741 | /**************************************************************************** |
| 5887 | 5742 | ||
| 5888 | Following are some utitity fuctions for WiFi MLME | 5743 | Following are some utility functions for WiFi MLME |
| 5889 | 5744 | ||
| 5890 | *****************************************************************************/ | 5745 | *****************************************************************************/ |
| 5891 | 5746 | ||
| @@ -5937,7 +5792,7 @@ void rtw_mlme_site_survey_done(struct adapter *adapter) · 45 unmodified lines | |||
| 5937 | int res; | 5792 | int res; |
| 5938 | u8 reg; | 5793 | u8 reg; |
| 5939 | 5794 | ||
| 5940 | if ((is_client_associated_to_ap(adapter)) || | 5795 | if ((r8188eu_is_client_associated_to_ap(adapter)) || |
| 5941 | ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) { | 5796 | ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) { |
| 5942 | /* enable to rx data frame */ | 5797 | /* enable to rx data frame */ |
| 5943 | rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF); | 5798 | rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF); |
| @@ -6008,9 +5863,9 @@ void site_survey(struct adapter *padapter) · 64 unmodified lines | |||
| 6008 | if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */ | 5863 | if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */ |
| 6009 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || | 5864 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || |
| 6010 | rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) { | 5865 | rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) { |
| 6011 | issue_probereq_p2p(padapter, NULL); | 5866 | issue_probereq_p2p(padapter); |
| 6012 | issue_probereq_p2p(padapter, NULL); | 5867 | issue_probereq_p2p(padapter); |
| 6013 | issue_probereq_p2p(padapter, NULL); | 5868 | issue_probereq_p2p(padapter); |
| 6014 | } else { | 5869 | } else { |
| 6015 | int i; | 5870 | int i; |
| 6016 | for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) { | 5871 | for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) { |
| @@ -6058,7 +5913,7 @@ void site_survey(struct adapter *padapter) · 41 unmodified lines | |||
| 6058 | } else { | 5913 | } else { |
| 6059 | /* 20100721:Interrupt scan operation here. */ | 5914 | /* 20100721:Interrupt scan operation here. */ |
| 6060 | /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ | 5915 | /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ |
| 6061 | /* It compares the scan result and select beter one to do connection. */ | 5916 | /* It compares the scan result and selects a better one to do connection. */ |
| 6062 | if (AntDivBeforeLink8188E(padapter)) { | 5917 | if (AntDivBeforeLink8188E(padapter)) { |
| 6063 | pmlmeext->sitesurvey_res.bss_cnt = 0; | 5918 | pmlmeext->sitesurvey_res.bss_cnt = 0; |
| 6064 | pmlmeext->sitesurvey_res.channel_idx = -1; | 5919 | pmlmeext->sitesurvey_res.channel_idx = -1; |
| @@ -6088,7 +5943,7 @@ void site_survey(struct adapter *padapter) · 23 unmodified lines | |||
| 6088 | Restore_DM_Func_Flag(padapter); | 5943 | Restore_DM_Func_Flag(padapter); |
| 6089 | /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ | 5944 | /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ |
| 6090 | 5945 | ||
| 6091 | if (is_client_associated_to_ap(padapter)) | 5946 | if (r8188eu_is_client_associated_to_ap(padapter)) |
| 6092 | issue_nulldata(padapter, NULL, 0, 3, 500); | 5947 | issue_nulldata(padapter, NULL, 0, 3, 500); |
| 6093 | 5948 | ||
| 6094 | rtw_mlme_site_survey_done(padapter); | 5949 | rtw_mlme_site_survey_done(padapter); |
| @@ -6108,10 +5963,11 @@ void site_survey(struct adapter *padapter) · 13 unmodified lines | |||
| 6108 | /* collect bss info from Beacon and Probe request/response frames. */ | 5963 | /* collect bss info from Beacon and Probe request/response frames. */ |
| 6109 | u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid) | 5964 | u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid) |
| 6110 | { | 5965 | { |
| 5966 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; | ||
| 6111 | int i; | 5967 | int i; |
| 6112 | u32 len; | 5968 | u32 len; |
| 6113 | u8 *p; | 5969 | u8 *p; |
| 6114 | u16 val16, subtype; | 5970 | u16 val16; |
| 6115 | u8 *pframe = precv_frame->rx_data; | 5971 | u8 *pframe = precv_frame->rx_data; |
| 6116 | u32 packet_len = precv_frame->len; | 5972 | u32 packet_len = precv_frame->len; |
| 6117 | u8 ie_offset; | 5973 | u8 ie_offset; |
| @@ -6127,23 +5983,18 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st · 9 unmodified lines | |||
| 6127 | 5983 | ||
| 6128 | memset(bssid, 0, sizeof(struct wlan_bssid_ex)); | 5984 | memset(bssid, 0, sizeof(struct wlan_bssid_ex)); |
| 6129 | 5985 | ||
| 6130 | subtype = GetFrameSubType(pframe); | 5986 | if (ieee80211_is_beacon(mgmt->frame_control)) { |
| 6131 | |||
| 6132 | if (subtype == WIFI_BEACON) { | ||
| 6133 | bssid->Reserved[0] = 1; | 5987 | bssid->Reserved[0] = 1; |
| 6134 | ie_offset = _BEACON_IE_OFFSET_; | 5988 | ie_offset = _BEACON_IE_OFFSET_; |
| 5989 | } else if (ieee80211_is_probe_req(mgmt->frame_control)) { | ||
| 5990 | ie_offset = _PROBEREQ_IE_OFFSET_; | ||
| 5991 | bssid->Reserved[0] = 2; | ||
| 5992 | } else if (ieee80211_is_probe_resp(mgmt->frame_control)) { | ||
| 5993 | ie_offset = _PROBERSP_IE_OFFSET_; | ||
| 5994 | bssid->Reserved[0] = 3; | ||
| 6135 | } else { | 5995 | } else { |
| 6136 | /* FIXME : more type */ | 5996 | bssid->Reserved[0] = 0; |
| 6137 | if (subtype == WIFI_PROBEREQ) { | 5997 | ie_offset = _FIXED_IE_LENGTH_; |
| 6138 | ie_offset = _PROBEREQ_IE_OFFSET_; | ||
| 6139 | bssid->Reserved[0] = 2; | ||
| 6140 | } else if (subtype == WIFI_PROBERSP) { | ||
| 6141 | ie_offset = _PROBERSP_IE_OFFSET_; | ||
| 6142 | bssid->Reserved[0] = 3; | ||
| 6143 | } else { | ||
| 6144 | bssid->Reserved[0] = 0; | ||
| 6145 | ie_offset = _FIXED_IE_LENGTH_; | ||
| 6146 | } | ||
| 6147 | } | 5998 | } |
| 6148 | 5999 | ||
| 6149 | bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; | 6000 | bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; |
| @@ -6191,9 +6042,6 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st · 41 unmodified lines | |||
| 6191 | memcpy(bssid->SupportedRates + i, (p + 2), len); | 6042 | memcpy(bssid->SupportedRates + i, (p + 2), len); |
| 6192 | } | 6043 | } |
| 6193 | 6044 | ||
| 6194 | /* todo: */ | ||
| 6195 | bssid->NetworkTypeInUse = Ndis802_11OFDM24; | ||
| 6196 | |||
| 6197 | if (bssid->IELength < 12) | 6045 | if (bssid->IELength < 12) |
| 6198 | return _FAIL; | 6046 | return _FAIL; |
| 6199 | 6047 | ||
| @@ -6328,7 +6176,7 @@ void start_create_ibss(struct adapter *padapter) · 128 unmodified lines | |||
| 6328 | /* update wireless mode */ | 6176 | /* update wireless mode */ |
| 6329 | update_wireless_mode(padapter); | 6177 | update_wireless_mode(padapter); |
| 6330 | 6178 | ||
| 6331 | /* udpate capability */ | 6179 | /* update capability */ |
| 6332 | caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); | 6180 | caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); |
| 6333 | update_capinfo(padapter, caps); | 6181 | update_capinfo(padapter, caps); |
| 6334 | if (caps & cap_IBSS) {/* adhoc master */ | 6182 | if (caps & cap_IBSS) {/* adhoc master */ |
| @@ -6378,7 +6226,7 @@ void start_clnt_join(struct adapter *padapter) · 43 unmodified lines | |||
| 6378 | /* update wireless mode */ | 6226 | /* update wireless mode */ |
| 6379 | update_wireless_mode(padapter); | 6227 | update_wireless_mode(padapter); |
| 6380 | 6228 | ||
| 6381 | /* udpate capability */ | 6229 | /* update capability */ |
| 6382 | caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); | 6230 | caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); |
| 6383 | update_capinfo(padapter, caps); | 6231 | update_capinfo(padapter, caps); |
| 6384 | if (caps & cap_ESS) { | 6232 | if (caps & cap_ESS) { |
| @@ -6756,9 +6604,6 @@ void report_join_res(struct adapter *padapter, int res) · 371 unmodified lines | |||
| 6756 | pcmd_obj->cmdsz = cmdsz; | 6604 | pcmd_obj->cmdsz = cmdsz; |
| 6757 | pcmd_obj->parmbuf = pevtcmd; | 6605 | pcmd_obj->parmbuf = pevtcmd; |
| 6758 | 6606 | ||
| 6759 | pcmd_obj->rsp = NULL; | ||
| 6760 | pcmd_obj->rspsz = 0; | ||
| 6761 | |||
| 6762 | pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); | 6607 | pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); |
| 6763 | pc2h_evt_hdr->len = sizeof(struct joinbss_event); | 6608 | pc2h_evt_hdr->len = sizeof(struct joinbss_event); |
| 6764 | pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); | 6609 | pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); |
| @@ -6972,7 +6817,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) · 207 unmodified lines | |||
| 6972 | /* BCN interval */ | 6817 | /* BCN interval */ |
| 6973 | rtw_write16(padapter, REG_BCN_INTERVAL, pmlmeinfo->bcn_interval); | 6818 | rtw_write16(padapter, REG_BCN_INTERVAL, pmlmeinfo->bcn_interval); |
| 6974 | 6819 | ||
| 6975 | /* udpate capability */ | 6820 | /* update capability */ |
| 6976 | update_capinfo(padapter, pmlmeinfo->capability); | 6821 | update_capinfo(padapter, pmlmeinfo->capability); |
| 6977 | 6822 | ||
| 6978 | /* WMM, Update EDCA param */ | 6823 | /* WMM, Update EDCA param */ |
| @@ -7064,7 +6909,7 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter) · 85 unmodified lines | |||
| 7064 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 6909 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 7065 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 6910 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 7066 | 6911 | ||
| 7067 | if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) { | 6912 | if (r8188eu_is_client_associated_to_ap(padapter) || r8188eu_is_ibss_empty(padapter)) { |
| 7068 | mlme_disconnect(padapter); | 6913 | mlme_disconnect(padapter); |
| 7069 | rtw_set_bssid(padapter, null_addr); | 6914 | rtw_set_bssid(padapter, null_addr); |
| 7070 | 6915 | ||
| @@ -7137,7 +6982,7 @@ void linked_status_chk(struct adapter *padapter) · 66 unmodified lines | |||
| 7137 | 6982 | ||
| 7138 | rtl8188e_sreset_linked_status_check(padapter); | 6983 | rtl8188e_sreset_linked_status_check(padapter); |
| 7139 | 6984 | ||
| 7140 | if (is_client_associated_to_ap(padapter)) { | 6985 | if (r8188eu_is_client_associated_to_ap(padapter)) { |
| 7141 | /* linked infrastructure client mode */ | 6986 | /* linked infrastructure client mode */ |
| 7142 | 6987 | ||
| 7143 | int tx_chk = _SUCCESS, rx_chk = _SUCCESS; | 6988 | int tx_chk = _SUCCESS, rx_chk = _SUCCESS; |
| @@ -7165,7 +7010,7 @@ void linked_status_chk(struct adapter *padapter) · 21 unmodified lines | |||
| 7165 | } | 7010 | } |
| 7166 | 7011 | ||
| 7167 | if (rx_chk != _SUCCESS) | 7012 | if (rx_chk != _SUCCESS) |
| 7168 | issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1); | 7013 | issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr); |
| 7169 | 7014 | ||
| 7170 | if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { | 7015 | if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { |
| 7171 | tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); | 7016 | tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); |
| @@ -7209,7 +7054,7 @@ void linked_status_chk(struct adapter *padapter) · 37 unmodified lines | |||
| 7209 | pmlmeinfo->link_count = 0; | 7054 | pmlmeinfo->link_count = 0; |
| 7210 | } | 7055 | } |
| 7211 | } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */ | 7056 | } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */ |
| 7212 | } else if (is_client_associated_to_ibss(padapter)) { | 7057 | } else if (r8188eu_is_client_associated_to_ibss(padapter)) { |
| 7213 | /* linked IBSS mode */ | 7058 | /* linked IBSS mode */ |
| 7214 | /* for each assoc list entry to check the rx pkt counter */ | 7059 | /* for each assoc list entry to check the rx pkt counter */ |
| 7215 | for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { | 7060 | for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { |
| @@ -7527,7 +7372,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) · 311 unmodified lines | |||
| 7527 | u8 val8; | 7372 | u8 val8; |
| 7528 | int res; | 7373 | int res; |
| 7529 | 7374 | ||
| 7530 | if (is_client_associated_to_ap(padapter)) | 7375 | if (r8188eu_is_client_associated_to_ap(padapter)) |
| 7531 | issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100); | 7376 | issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100); |
| 7532 | 7377 | ||
| 7533 | mlme_disconnect(padapter); | 7378 | mlme_disconnect(padapter); |
| @@ -7639,7 +7484,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) · 105 unmodified lines | |||
| 7639 | pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; | 7484 | pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; |
| 7640 | 7485 | ||
| 7641 | /* issue null data if associating to the AP */ | 7486 | /* issue null data if associating to the AP */ |
| 7642 | if (is_client_associated_to_ap(padapter)) { | 7487 | if (r8188eu_is_client_associated_to_ap(padapter)) { |
| 7643 | pmlmeext->sitesurvey_res.state = SCAN_TXNULL; | 7488 | pmlmeext->sitesurvey_res.state = SCAN_TXNULL; |
| 7644 | 7489 | ||
| 7645 | issue_nulldata(padapter, NULL, 1, 3, 500); | 7490 | issue_nulldata(padapter, NULL, 1, 3, 500); |
| @@ -7783,7 +7628,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf) · 137 unmodified lines | |||
| 7783 | 7628 | ||
| 7784 | if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) || | 7629 | if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) || |
| 7785 | ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) { | 7630 | ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) { |
| 7786 | issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); | 7631 | issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid, NULL); |
| 7787 | _set_timer(&psta->addba_retry_timer, ADDBA_TO); | 7632 | _set_timer(&psta->addba_retry_timer, ADDBA_TO); |
| 7788 | } else { | 7633 | } else { |
| 7789 | psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid); | 7634 | psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid); |
| @@ -1453,7 +1453,7 @@ static void pre_tx_invitereq_handler(struct adapter *padapter) · 1452 unmodified lines | |||
| 1453 | 1453 | ||
| 1454 | set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); | 1454 | set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); |
| 1455 | rtw_mlme_under_site_survey(padapter); | 1455 | rtw_mlme_under_site_survey(padapter); |
| 1456 | issue_probereq_p2p(padapter, NULL); | 1456 | issue_probereq_p2p(padapter); |
| 1457 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); | 1457 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); |
| 1458 | 1458 | ||
| 1459 | } | 1459 | } |
| @@ -1464,7 +1464,7 @@ static void pre_tx_provdisc_handler(struct adapter *padapter) · 4 unmodified lines | |||
| 1464 | 1464 | ||
| 1465 | set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); | 1465 | set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); |
| 1466 | rtw_mlme_under_site_survey(padapter); | 1466 | rtw_mlme_under_site_survey(padapter); |
| 1467 | issue_probereq_p2p(padapter, NULL); | 1467 | issue_probereq_p2p(padapter); |
| 1468 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); | 1468 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); |
| 1469 | 1469 | ||
| 1470 | } | 1470 | } |
| @@ -1475,7 +1475,7 @@ static void pre_tx_negoreq_handler(struct adapter *padapter) · 4 unmodified lines | |||
| 1475 | 1475 | ||
| 1476 | set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); | 1476 | set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); |
| 1477 | rtw_mlme_under_site_survey(padapter); | 1477 | rtw_mlme_under_site_survey(padapter); |
| 1478 | issue_probereq_p2p(padapter, NULL); | 1478 | issue_probereq_p2p(padapter); |
| 1479 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); | 1479 | _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); |
| 1480 | 1480 | ||
| 1481 | } | 1481 | } |
| @@ -1505,8 +1505,6 @@ void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType) · 23 unmodified lines | |||
| 1505 | 1505 | ||
| 1506 | void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) | 1506 | void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) |
| 1507 | { | 1507 | { |
| 1508 | u8 *ies; | ||
| 1509 | u32 ies_len; | ||
| 1510 | u8 *p2p_ie; | 1508 | u8 *p2p_ie; |
| 1511 | u32 p2p_ielen = 0; | 1509 | u32 p2p_ielen = 0; |
| 1512 | u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */ | 1510 | u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */ |
| @@ -1518,13 +1516,8 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) · 5 unmodified lines | |||
| 1518 | 1516 | ||
| 1519 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) | 1517 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) |
| 1520 | return; | 1518 | return; |
| 1521 | if (IELength <= _BEACON_IE_OFFSET_) | ||
| 1522 | return; | ||
| 1523 | 1519 | ||
| 1524 | ies = IEs + _BEACON_IE_OFFSET_; | 1520 | p2p_ie = rtw_get_p2p_ie(IEs, IELength, NULL, &p2p_ielen); |
| 1525 | ies_len = IELength - _BEACON_IE_OFFSET_; | ||
| 1526 | |||
| 1527 | p2p_ie = rtw_get_p2p_ie(ies, ies_len, NULL, &p2p_ielen); | ||
| 1528 | 1521 | ||
| 1529 | while (p2p_ie) { | 1522 | while (p2p_ie) { |
| 1530 | find_p2p = true; | 1523 | find_p2p = true; |
| @@ -1579,7 +1572,7 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) · 48 unmodified lines | |||
| 1579 | } | 1572 | } |
| 1580 | 1573 | ||
| 1581 | /* Get the next P2P IE */ | 1574 | /* Get the next P2P IE */ |
| 1582 | p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen); | 1575 | p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, IELength - (p2p_ie - IEs + p2p_ielen), NULL, &p2p_ielen); |
| 1583 | } | 1576 | } |
| 1584 | 1577 | ||
| 1585 | if (find_p2p) { | 1578 | if (find_p2p) { |
| @@ -1732,7 +1725,7 @@ static void pre_tx_scan_timer_process(struct timer_list *t) · 146 unmodified lines | |||
| 1732 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { | 1725 | if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { |
| 1733 | if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ | 1726 | if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ |
| 1734 | p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK); | 1727 | p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK); |
| 1735 | /* issue_probereq_p2p(adapter, NULL); */ | 1728 | /* issue_probereq_p2p(adapter); */ |
| 1736 | /* _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); */ | 1729 | /* _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); */ |
| 1737 | } | 1730 | } |
| 1738 | } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { | 1731 | } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { |
| @@ -273,7 +273,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms) · 272 unmodified lines | |||
| 273 | err = -1; | 273 | err = -1; |
| 274 | break; | 274 | break; |
| 275 | } | 275 | } |
| 276 | msleep(1); | 276 | mdelay(1); |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | return err; | 279 | return err; |
| @@ -779,9 +779,8 @@ static int ap2sta_data_frame( · 778 unmodified lines | |||
| 779 | } | 779 | } |
| 780 | 780 | ||
| 781 | /* check BSSID */ | 781 | /* check BSSID */ |
| 782 | if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || | 782 | if (is_zero_ether_addr(pattrib->bssid) || is_zero_ether_addr(mybssid) || |
| 783 | !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || | 783 | (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { |
| 784 | (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { | ||
| 785 | if (!bmcast) | 784 | if (!bmcast) |
| 786 | issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); | 785 | issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); |
| 787 | 786 | ||
| @@ -972,7 +971,7 @@ static void validate_recv_ctrl_frame(struct adapter *padapter, · 184 unmodified lines | |||
| 972 | if (psta->sleepq_len == 0) { | 971 | if (psta->sleepq_len == 0) { |
| 973 | pstapriv->tim_bitmap &= ~BIT(psta->aid); | 972 | pstapriv->tim_bitmap &= ~BIT(psta->aid); |
| 974 | 973 | ||
| 975 | /* upate BCN for TIM IE */ | 974 | /* update BCN for TIM IE */ |
| 976 | /* update_BCNTIM(padapter); */ | 975 | /* update_BCNTIM(padapter); */ |
| 977 | update_beacon(padapter, _TIM_IE_, NULL, false); | 976 | update_beacon(padapter, _TIM_IE_, NULL, false); |
| 978 | } | 977 | } |
| @@ -986,7 +985,7 @@ static void validate_recv_ctrl_frame(struct adapter *padapter, · 7 unmodified lines | |||
| 986 | 985 | ||
| 987 | pstapriv->tim_bitmap &= ~BIT(psta->aid); | 986 | pstapriv->tim_bitmap &= ~BIT(psta->aid); |
| 988 | 987 | ||
| 989 | /* upate BCN for TIM IE */ | 988 | /* update BCN for TIM IE */ |
| 990 | /* update_BCNTIM(padapter); */ | 989 | /* update_BCNTIM(padapter); */ |
| 991 | update_beacon(padapter, _TIM_IE_, NULL, false); | 990 | update_beacon(padapter, _TIM_IE_, NULL, false); |
| 992 | } | 991 | } |
| @@ -1032,7 +1031,6 @@ static int validate_recv_data_frame(struct adapter *adapter, · 39 unmodified lines | |||
| 1032 | struct recv_frame *precv_frame) | 1031 | struct recv_frame *precv_frame) |
| 1033 | { | 1032 | { |
| 1034 | struct sta_info *psta = NULL; | 1033 | struct sta_info *psta = NULL; |
| 1035 | u8 *ptr = precv_frame->rx_data; | ||
| 1036 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; | 1034 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; |
| 1037 | struct rx_pkt_attrib *pattrib = &precv_frame->attrib; | 1035 | struct rx_pkt_attrib *pattrib = &precv_frame->attrib; |
| 1038 | struct security_priv *psecuritypriv = &adapter->securitypriv; | 1036 | struct security_priv *psecuritypriv = &adapter->securitypriv; |
| @@ -1065,18 +1063,18 @@ static int validate_recv_data_frame(struct adapter *adapter, · 26 unmodified lines | |||
| 1065 | if (!psta) | 1063 | if (!psta) |
| 1066 | return _FAIL; | 1064 | return _FAIL; |
| 1067 | 1065 | ||
| 1068 | /* psta->rssi = prxcmd->rssi; */ | ||
| 1069 | /* psta->signal_quality = prxcmd->sq; */ | ||
| 1070 | precv_frame->psta = psta; | 1066 | precv_frame->psta = psta; |
| 1071 | 1067 | ||
| 1072 | pattrib->amsdu = 0; | 1068 | pattrib->amsdu = 0; |
| 1073 | pattrib->ack_policy = 0; | 1069 | pattrib->ack_policy = 0; |
| 1074 | /* parsing QC field */ | 1070 | /* parsing QC field */ |
| 1075 | if (pattrib->qos) { | 1071 | if (pattrib->qos) { |
| 1072 | struct ieee80211_qos_hdr *qos_hdr = (struct ieee80211_qos_hdr *)hdr; | ||
| 1073 | |||
| 1076 | pattrib->priority = ieee80211_get_tid(hdr); | 1074 | pattrib->priority = ieee80211_get_tid(hdr); |
| 1077 | pattrib->ack_policy = GetAckpolicy((ptr + 24)); | 1075 | pattrib->ack_policy = GetAckpolicy(&qos_hdr->qos_ctrl); |
| 1078 | pattrib->amsdu = GetAMsdu((ptr + 24)); | 1076 | pattrib->amsdu = GetAMsdu(&qos_hdr->qos_ctrl); |
| 1079 | pattrib->hdrlen = 26; | 1077 | pattrib->hdrlen = sizeof(*qos_hdr); |
| 1080 | 1078 | ||
| 1081 | if (pattrib->priority != 0 && pattrib->priority != 3) | 1079 | if (pattrib->priority != 0 && pattrib->priority != 3) |
| 1082 | adapter->recvpriv.bIsAnyNonBEPkts = true; | 1080 | adapter->recvpriv.bIsAnyNonBEPkts = true; |
| @@ -1415,7 +1413,6 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) · 332 unmodified lines | |||
| 1415 | 1413 | ||
| 1416 | struct recv_priv *precvpriv = &padapter->recvpriv; | 1414 | struct recv_priv *precvpriv = &padapter->recvpriv; |
| 1417 | struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue; | 1415 | struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue; |
| 1418 | int ret = _SUCCESS; | ||
| 1419 | 1416 | ||
| 1420 | nr_subframes = 0; | 1417 | nr_subframes = 0; |
| 1421 | 1418 | ||
| @@ -1513,7 +1510,7 @@ exit: · 91 unmodified lines | |||
| 1513 | prframe->len = 0; | 1510 | prframe->len = 0; |
| 1514 | rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ | 1511 | rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ |
| 1515 | 1512 | ||
| 1516 | return ret; | 1513 | return _SUCCESS; |
| 1517 | } | 1514 | } |
| 1518 | 1515 | ||
| 1519 | static bool check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) | 1516 | static bool check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) |
| @@ -1984,13 +1981,13 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t) · 464 unmodified lines | |||
| 1984 | } else { | 1981 | } else { |
| 1985 | if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ | 1982 | if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ |
| 1986 | avg_signal_strength = recvpriv->signal_strength_data.avg_val; | 1983 | avg_signal_strength = recvpriv->signal_strength_data.avg_val; |
| 1987 | /* after avg_vals are accquired, we can re-stat the signal values */ | 1984 | /* after avg_vals are acquired, we can re-stat the signal values */ |
| 1988 | recvpriv->signal_strength_data.update_req = 1; | 1985 | recvpriv->signal_strength_data.update_req = 1; |
| 1989 | } | 1986 | } |
| 1990 | 1987 | ||
| 1991 | if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */ | 1988 | if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */ |
| 1992 | avg_signal_qual = recvpriv->signal_qual_data.avg_val; | 1989 | avg_signal_qual = recvpriv->signal_qual_data.avg_val; |
| 1993 | /* after avg_vals are accquired, we can re-stat the signal values */ | 1990 | /* after avg_vals are acquired, we can re-stat the signal values */ |
| 1994 | recvpriv->signal_qual_data.update_req = 1; | 1991 | recvpriv->signal_qual_data.update_req = 1; |
| 1995 | } | 1992 | } |
| 1996 | 1993 | ||
| @@ -954,7 +954,7 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) · 953 unmodified lines | |||
| 954 | 954 | ||
| 955 | } | 955 | } |
| 956 | 956 | ||
| 957 | static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) | 957 | static void aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) |
| 958 | { | 958 | { |
| 959 | uint qc_exists, a4_exists, i, j, payload_remainder, | 959 | uint qc_exists, a4_exists, i, j, payload_remainder, |
| 960 | num_blocks, payload_index; | 960 | num_blocks, payload_index; |
| @@ -1083,8 +1083,6 @@ static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) · 122 unmodified lines | |||
| 1083 | bitwise_xor(aes_out, padded_buffer, chain_buffer); | 1083 | bitwise_xor(aes_out, padded_buffer, chain_buffer); |
| 1084 | for (j = 0; j < 8; j++) | 1084 | for (j = 0; j < 8; j++) |
| 1085 | pframe[payload_index++] = chain_buffer[j]; | 1085 | pframe[payload_index++] = chain_buffer[j]; |
| 1086 | |||
| 1087 | return _SUCCESS; | ||
| 1088 | } | 1086 | } |
| 1089 | 1087 | ||
| 1090 | u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe) | 1088 | u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe) |
| @@ -45,7 +45,7 @@ static void _rtw_init_stainfo(struct sta_info *psta) · 44 unmodified lines | |||
| 45 | psta->keep_alive_trycnt = 0; | 45 | psta->keep_alive_trycnt = 0; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) | 48 | int _rtw_init_sta_priv(struct sta_priv *pstapriv) |
| 49 | { | 49 | { |
| 50 | struct sta_info *psta; | 50 | struct sta_info *psta; |
| 51 | s32 i; | 51 | s32 i; |
| @@ -53,7 +53,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) · 1 unmodified line | |||
| 53 | pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4); | 53 | pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4); |
| 54 | 54 | ||
| 55 | if (!pstapriv->pallocated_stainfo_buf) | 55 | if (!pstapriv->pallocated_stainfo_buf) |
| 56 | return _FAIL; | 56 | return -ENOMEM; |
| 57 | 57 | ||
| 58 | pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - | 58 | pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - |
| 59 | ((size_t)(pstapriv->pallocated_stainfo_buf) & 3); | 59 | ((size_t)(pstapriv->pallocated_stainfo_buf) & 3); |
| @@ -93,7 +93,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) · 33 unmodified lines | |||
| 93 | pstapriv->expire_to = 3; /* 3*2 = 6 sec */ | 93 | pstapriv->expire_to = 3; /* 3*2 = 6 sec */ |
| 94 | pstapriv->max_num_sta = NUM_STA; | 94 | pstapriv->max_num_sta = NUM_STA; |
| 95 | 95 | ||
| 96 | return _SUCCESS; | 96 | return 0; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta) | 99 | inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta) |
| @@ -242,7 +242,7 @@ exit: · 142 unmodified lines | |||
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | /* using pstapriv->sta_hash_lock to protect */ | 244 | /* using pstapriv->sta_hash_lock to protect */ |
| 245 | u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) | 245 | void rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) |
| 246 | { | 246 | { |
| 247 | int i; | 247 | int i; |
| 248 | struct __queue *pfree_sta_queue; | 248 | struct __queue *pfree_sta_queue; |
| @@ -252,7 +252,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) · 3 unmodified lines | |||
| 252 | struct sta_priv *pstapriv = &padapter->stapriv; | 252 | struct sta_priv *pstapriv = &padapter->stapriv; |
| 253 | 253 | ||
| 254 | if (!psta) | 254 | if (!psta) |
| 255 | goto exit; | 255 | return; |
| 256 | 256 | ||
| 257 | pfree_sta_queue = &pstapriv->free_sta_queue; | 257 | pfree_sta_queue = &pstapriv->free_sta_queue; |
| 258 | 258 | ||
| @@ -356,10 +356,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) · 97 unmodified lines | |||
| 356 | spin_lock_bh(&pfree_sta_queue->lock); | 356 | spin_lock_bh(&pfree_sta_queue->lock); |
| 357 | list_add_tail(&psta->list, get_list_head(pfree_sta_queue)); | 357 | list_add_tail(&psta->list, get_list_head(pfree_sta_queue)); |
| 358 | spin_unlock_bh(&pfree_sta_queue->lock); | 358 | spin_unlock_bh(&pfree_sta_queue->lock); |
| 359 | |||
| 360 | exit: | ||
| 361 | |||
| 362 | return _SUCCESS; | ||
| 363 | } | 359 | } |
| 364 | 360 | ||
| 365 | /* free all stainfo which in sta_hash[all] */ | 361 | /* free all stainfo which in sta_hash[all] */ |
| @@ -404,7 +400,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) · 38 unmodified lines | |||
| 404 | if (!hwaddr) | 400 | if (!hwaddr) |
| 405 | return NULL; | 401 | return NULL; |
| 406 | 402 | ||
| 407 | if (IS_MCAST(hwaddr)) | 403 | if (is_multicast_ether_addr(hwaddr)) |
| 408 | addr = bc_addr; | 404 | addr = bc_addr; |
| 409 | else | 405 | else |
| 410 | addr = hwaddr; | 406 | addr = hwaddr; |
| @@ -331,35 +331,35 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss) · 330 unmodified lines | |||
| 331 | return le16_to_cpu(val); | 331 | return le16_to_cpu(val); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | int is_client_associated_to_ap(struct adapter *padapter) | 334 | bool r8188eu_is_client_associated_to_ap(struct adapter *padapter) |
| 335 | { | 335 | { |
| 336 | struct mlme_ext_priv *pmlmeext; | 336 | struct mlme_ext_priv *pmlmeext; |
| 337 | struct mlme_ext_info *pmlmeinfo; | 337 | struct mlme_ext_info *pmlmeinfo; |
| 338 | 338 | ||
| 339 | if (!padapter) | 339 | if (!padapter) |
| 340 | return _FAIL; | 340 | return false; |
| 341 | 341 | ||
| 342 | pmlmeext = &padapter->mlmeextpriv; | 342 | pmlmeext = &padapter->mlmeextpriv; |
| 343 | pmlmeinfo = &pmlmeext->mlmext_info; | 343 | pmlmeinfo = &pmlmeext->mlmext_info; |
| 344 | 344 | ||
| 345 | if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) | 345 | if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) |
| 346 | return true; | 346 | return true; |
| 347 | else | 347 | |
| 348 | return _FAIL; | 348 | return false; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | int is_client_associated_to_ibss(struct adapter *padapter) | 351 | bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter) |
| 352 | { | 352 | { |
| 353 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 353 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| 354 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; | 354 | struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; |
| 355 | 355 | ||
| 356 | if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) | 356 | if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) |
| 357 | return true; | 357 | return true; |
| 358 | else | 358 | |
| 359 | return _FAIL; | 359 | return false; |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | int is_IBSS_empty(struct adapter *padapter) | 362 | bool r8188eu_is_ibss_empty(struct adapter *padapter) |
| 363 | { | 363 | { |
| 364 | unsigned int i; | 364 | unsigned int i; |
| 365 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; | 365 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; |
| @@ -367,7 +367,7 @@ int is_IBSS_empty(struct adapter *padapter) · 1 unmodified line | |||
| 367 | 367 | ||
| 368 | for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { | 368 | for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { |
| 369 | if (pmlmeinfo->FW_sta_info[i].status == 1) | 369 | if (pmlmeinfo->FW_sta_info[i].status == 1) |
| 370 | return _FAIL; | 370 | return false; |
| 371 | } | 371 | } |
| 372 | return true; | 372 | return true; |
| 373 | } | 373 | } |
| @@ -874,9 +874,10 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta) · 500 unmodified lines | |||
| 874 | 874 | ||
| 875 | int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) | 875 | int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) |
| 876 | { | 876 | { |
| 877 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe; | ||
| 877 | unsigned int len; | 878 | unsigned int len; |
| 878 | unsigned char *p; | 879 | unsigned char *p; |
| 879 | unsigned short val16, subtype; | 880 | unsigned short val16; |
| 880 | struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; | 881 | struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; |
| 881 | /* u8 wpa_ie[255], rsn_ie[255]; */ | 882 | /* u8 wpa_ie[255], rsn_ie[255]; */ |
| 882 | u16 wpa_len = 0, rsn_len = 0; | 883 | u16 wpa_len = 0, rsn_len = 0; |
| @@ -893,7 +894,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · 10 unmodified lines | |||
| 893 | unsigned short ht_cap_info; | 894 | unsigned short ht_cap_info; |
| 894 | unsigned char ht_info_infos_0; | 895 | unsigned char ht_info_infos_0; |
| 895 | 896 | ||
| 896 | if (!is_client_associated_to_ap(Adapter)) | 897 | if (!r8188eu_is_client_associated_to_ap(Adapter)) |
| 897 | return true; | 898 | return true; |
| 898 | 899 | ||
| 899 | len = packet_len - sizeof(struct ieee80211_hdr_3addr); | 900 | len = packet_len - sizeof(struct ieee80211_hdr_3addr); |
| @@ -908,9 +909,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · 8 unmodified lines | |||
| 908 | if (!bssid) | 909 | if (!bssid) |
| 909 | return _FAIL; | 910 | return _FAIL; |
| 910 | 911 | ||
| 911 | subtype = GetFrameSubType(pframe) >> 4; | 912 | if (ieee80211_is_beacon(mgmt->frame_control)) |
| 912 | |||
| 913 | if (subtype == WIFI_BEACON) | ||
| 914 | bssid->Reserved[0] = 1; | 913 | bssid->Reserved[0] = 1; |
| 915 | 914 | ||
| 916 | bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; | 915 | bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; |
| @@ -1035,16 +1034,13 @@ _mismatch: · 118 unmodified lines | |||
| 1035 | return _FAIL; | 1034 | return _FAIL; |
| 1036 | } | 1035 | } |
| 1037 | 1036 | ||
| 1038 | void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta) | 1037 | void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta) |
| 1039 | { | 1038 | { |
| 1040 | unsigned int i; | 1039 | unsigned int i; |
| 1041 | unsigned int len; | ||
| 1042 | struct ndis_802_11_var_ie *pIE; | 1040 | struct ndis_802_11_var_ie *pIE; |
| 1043 | 1041 | ||
| 1044 | len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); | 1042 | for (i = 0; i < ie_len;) { |
| 1045 | 1043 | pIE = (struct ndis_802_11_var_ie *)(ie_ptr + i); | |
| 1046 | for (i = 0; i < len;) { | ||
| 1047 | pIE = (struct ndis_802_11_var_ie *)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); | ||
| 1048 | 1044 | ||
| 1049 | switch (pIE->ElementID) { | 1045 | switch (pIE->ElementID) { |
| 1050 | case _HT_EXTRA_INFO_IE_: /* HT info */ | 1046 | case _HT_EXTRA_INFO_IE_: /* HT info */ |
| @@ -38,7 +38,7 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px · 37 unmodified lines | |||
| 38 | { | 38 | { |
| 39 | pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); | 39 | pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); |
| 40 | if (!pxmitbuf->pallocated_buf) | 40 | if (!pxmitbuf->pallocated_buf) |
| 41 | return _FAIL; | 41 | return -ENOMEM; |
| 42 | 42 | ||
| 43 | pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); | 43 | pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); |
| 44 | pxmitbuf->dma_transfer_addr = 0; | 44 | pxmitbuf->dma_transfer_addr = 0; |
| @@ -46,10 +46,10 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px · 1 unmodified line | |||
| 46 | pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL); | 46 | pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL); |
| 47 | if (!pxmitbuf->pxmit_urb) { | 47 | if (!pxmitbuf->pxmit_urb) { |
| 48 | kfree(pxmitbuf->pallocated_buf); | 48 | kfree(pxmitbuf->pallocated_buf); |
| 49 | return _FAIL; | 49 | return -ENOMEM; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | return _SUCCESS; | 52 | return 0; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, | 55 | static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, |
| @@ -59,12 +59,11 @@ static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *px · 3 unmodified lines | |||
| 59 | kfree(pxmitbuf->pallocated_buf); | 59 | kfree(pxmitbuf->pallocated_buf); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) | 62 | int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) |
| 63 | { | 63 | { |
| 64 | int i; | 64 | int i; |
| 65 | struct xmit_buf *pxmitbuf; | 65 | struct xmit_buf *pxmitbuf; |
| 66 | struct xmit_frame *pxframe; | 66 | struct xmit_frame *pxframe; |
| 67 | int res = _SUCCESS; | ||
| 68 | u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; | 67 | u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; |
| 69 | u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; | 68 | u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; |
| 70 | 69 | ||
| @@ -97,7 +96,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 26 unmodified lines | |||
| 97 | 96 | ||
| 98 | if (!pxmitpriv->pallocated_frame_buf) { | 97 | if (!pxmitpriv->pallocated_frame_buf) { |
| 99 | pxmitpriv->pxmit_frame_buf = NULL; | 98 | pxmitpriv->pxmit_frame_buf = NULL; |
| 100 | res = _FAIL; | ||
| 101 | goto exit; | 99 | goto exit; |
| 102 | } | 100 | } |
| 103 | pxmitpriv->pxmit_frame_buf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_frame_buf), 4); | 101 | pxmitpriv->pxmit_frame_buf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_frame_buf), 4); |
| @@ -132,10 +130,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 28 unmodified lines | |||
| 132 | 130 | ||
| 133 | pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4); | 131 | pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4); |
| 134 | 132 | ||
| 135 | if (!pxmitpriv->pallocated_xmitbuf) { | 133 | if (!pxmitpriv->pallocated_xmitbuf) |
| 136 | res = _FAIL; | ||
| 137 | goto free_frame_buf; | 134 | goto free_frame_buf; |
| 138 | } | ||
| 139 | 135 | ||
| 140 | pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4); | 136 | pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4); |
| 141 | /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ | 137 | /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ |
| @@ -151,11 +147,9 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 9 unmodified lines | |||
| 151 | pxmitbuf->ext_tag = false; | 147 | pxmitbuf->ext_tag = false; |
| 152 | 148 | ||
| 153 | /* Tx buf allocation may fail sometimes, so sleep and retry. */ | 149 | /* Tx buf allocation may fail sometimes, so sleep and retry. */ |
| 154 | res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); | 150 | if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { |
| 155 | if (res == _FAIL) { | ||
| 156 | msleep(10); | 151 | msleep(10); |
| 157 | res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); | 152 | if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) |
| 158 | if (res == _FAIL) | ||
| 159 | goto free_xmitbuf; | 153 | goto free_xmitbuf; |
| 160 | } | 154 | } |
| 161 | 155 | ||
| @@ -172,10 +166,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 10 unmodified lines | |||
| 172 | 166 | ||
| 173 | pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); | 167 | pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); |
| 174 | 168 | ||
| 175 | if (!pxmitpriv->pallocated_xmit_extbuf) { | 169 | if (!pxmitpriv->pallocated_xmit_extbuf) |
| 176 | res = _FAIL; | ||
| 177 | goto free_xmitbuf; | 170 | goto free_xmitbuf; |
| 178 | } | ||
| 179 | 171 | ||
| 180 | pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4); | 172 | pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4); |
| 181 | 173 | ||
| @@ -188,11 +180,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 6 unmodified lines | |||
| 188 | pxmitbuf->padapter = padapter; | 180 | pxmitbuf->padapter = padapter; |
| 189 | pxmitbuf->ext_tag = true; | 181 | pxmitbuf->ext_tag = true; |
| 190 | 182 | ||
| 191 | res = rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ); | 183 | if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) |
| 192 | if (res == _FAIL) { | ||
| 193 | res = _FAIL; | ||
| 194 | goto free_xmit_extbuf; | 184 | goto free_xmit_extbuf; |
| 195 | } | ||
| 196 | 185 | ||
| 197 | list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue); | 186 | list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue); |
| 198 | pxmitbuf++; | 187 | pxmitbuf++; |
| @@ -200,10 +189,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 1 unmodified line | |||
| 200 | 189 | ||
| 201 | pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; | 190 | pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; |
| 202 | 191 | ||
| 203 | if (rtw_alloc_hwxmits(padapter)) { | 192 | if (rtw_alloc_hwxmits(padapter)) |
| 204 | res = _FAIL; | ||
| 205 | goto free_xmit_extbuf; | 193 | goto free_xmit_extbuf; |
| 206 | } | ||
| 207 | 194 | ||
| 208 | rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); | 195 | rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); |
| 209 | 196 | ||
| @@ -226,7 +213,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 16 unmodified lines | |||
| 226 | 213 | ||
| 227 | rtl8188eu_init_xmit_priv(padapter); | 214 | rtl8188eu_init_xmit_priv(padapter); |
| 228 | 215 | ||
| 229 | return _SUCCESS; | 216 | return 0; |
| 230 | 217 | ||
| 231 | free_xmit_extbuf: | 218 | free_xmit_extbuf: |
| 232 | pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; | 219 | pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; |
| @@ -246,7 +233,7 @@ free_xmitbuf: · 13 unmodified lines | |||
| 246 | free_frame_buf: | 233 | free_frame_buf: |
| 247 | vfree(pxmitpriv->pallocated_frame_buf); | 234 | vfree(pxmitpriv->pallocated_frame_buf); |
| 248 | exit: | 235 | exit: |
| 249 | return res; | 236 | return -ENOMEM; |
| 250 | } | 237 | } |
| 251 | 238 | ||
| 252 | static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt) | 239 | static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt) |
| @@ -476,8 +463,7 @@ static uint rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen) · 223 unmodified lines | |||
| 476 | { | 463 | { |
| 477 | uint len; | 464 | uint len; |
| 478 | 465 | ||
| 479 | len = rtw_remainder_len(pfile); | 466 | len = min(rtw_remainder_len(pfile), rlen); |
| 480 | len = (rlen > len) ? len : rlen; | ||
| 481 | 467 | ||
| 482 | if (rmem) | 468 | if (rmem) |
| 483 | skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len); | 469 | skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len); |
| @@ -1622,14 +1608,14 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 1138 unmodified lines | |||
| 1622 | spin_lock_bh(&padapter->br_ext_lock); | 1608 | spin_lock_bh(&padapter->br_ext_lock); |
| 1623 | if (!(skb->data[0] & 1) && br_port && | 1609 | if (!(skb->data[0] & 1) && br_port && |
| 1624 | memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && | 1610 | memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && |
| 1625 | *((__be16 *)(skb->data + ETH_ALEN * 2)) != __constant_htons(ETH_P_8021Q) && | 1611 | *((__be16 *)(skb->data + ETH_ALEN * 2)) != htons(ETH_P_8021Q) && |
| 1626 | *((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP) && | 1612 | *((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP) && |
| 1627 | !memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN) && padapter->scdb_entry) { | 1613 | !memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN) && padapter->scdb_entry) { |
| 1628 | memcpy(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN); | 1614 | memcpy(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN); |
| 1629 | padapter->scdb_entry->ageing_timer = jiffies; | 1615 | padapter->scdb_entry->ageing_timer = jiffies; |
| 1630 | spin_unlock_bh(&padapter->br_ext_lock); | 1616 | spin_unlock_bh(&padapter->br_ext_lock); |
| 1631 | } else { | 1617 | } else { |
| 1632 | if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_8021Q)) { | 1618 | if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_8021Q)) { |
| 1633 | is_vlan_tag = 1; | 1619 | is_vlan_tag = 1; |
| 1634 | vlan_hdr = *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)); | 1620 | vlan_hdr = *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)); |
| 1635 | for (i = 0; i < 6; i++) | 1621 | for (i = 0; i < 6; i++) |
| @@ -1637,10 +1623,10 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 1 unmodified line | |||
| 1637 | skb_pull(skb, 4); | 1623 | skb_pull(skb, 4); |
| 1638 | } | 1624 | } |
| 1639 | if (!memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && | 1625 | if (!memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && |
| 1640 | (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP))) | 1626 | (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP))) |
| 1641 | memcpy(padapter->br_ip, skb->data + WLAN_ETHHDR_LEN + 12, 4); | 1627 | memcpy(padapter->br_ip, skb->data + WLAN_ETHHDR_LEN + 12, 4); |
| 1642 | 1628 | ||
| 1643 | if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) { | 1629 | if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP)) { |
| 1644 | if (memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN)) { | 1630 | if (memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN)) { |
| 1645 | padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter, | 1631 | padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter, |
| 1646 | skb->data + WLAN_ETHHDR_LEN + 12); | 1632 | skb->data + WLAN_ETHHDR_LEN + 12); |
| @@ -1669,7 +1655,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 22 unmodified lines | |||
| 1669 | skb_push(skb, 4); | 1655 | skb_push(skb, 4); |
| 1670 | for (i = 0; i < 6; i++) | 1656 | for (i = 0; i < 6; i++) |
| 1671 | *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); | 1657 | *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); |
| 1672 | *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q); | 1658 | *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q); |
| 1673 | *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; | 1659 | *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; |
| 1674 | } | 1660 | } |
| 1675 | 1661 | ||
| @@ -1708,7 +1694,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 32 unmodified lines | |||
| 1708 | skb_push(skb, 4); | 1694 | skb_push(skb, 4); |
| 1709 | for (i = 0; i < 6; i++) | 1695 | for (i = 0; i < 6; i++) |
| 1710 | *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); | 1696 | *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); |
| 1711 | *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q); | 1697 | *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q); |
| 1712 | *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; | 1698 | *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; |
| 1713 | } | 1699 | } |
| 1714 | } | 1700 | } |
| @@ -69,7 +69,7 @@ void ODM_TxPwrTrackAdjust88E(struct odm_dm_struct *dm_odm, u8 Type,/* 0 = OFDM, · 68 unmodified lines | |||
| 69 | /*----------------------------------------------------------------------------- | 69 | /*----------------------------------------------------------------------------- |
| 70 | * Function: odm_TxPwrTrackSetPwr88E() | 70 | * Function: odm_TxPwrTrackSetPwr88E() |
| 71 | * | 71 | * |
| 72 | * Overview: 88E change all channel tx power accordign to flag. | 72 | * Overview: 88E change all channel tx power according to flag. |
| 73 | * OFDM & CCK are all different. | 73 | * OFDM & CCK are all different. |
| 74 | * | 74 | * |
| 75 | * Input: NONE | 75 | * Input: NONE |
| @@ -583,7 +583,7 @@ static bool phy_SimularityCompare_8188E( · 507 unmodified lines | |||
| 583 | tmp2 = resulta[c2][i]; | 583 | tmp2 = resulta[c2][i]; |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1); | 586 | diff = abs(tmp1 - tmp2); |
| 587 | 587 | ||
| 588 | if (diff > MAX_TOLERANCE) { | 588 | if (diff > MAX_TOLERANCE) { |
| 589 | if ((i == 2 || i == 6) && !sim_bitmap) { | 589 | if ((i == 2 || i == 6) && !sim_bitmap) { |
| @@ -882,14 +882,6 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) · 292 unmodified lines | |||
| 882 | if (RegE94 != 0) | 882 | if (RegE94 != 0) |
| 883 | patha_fill_iqk(adapt, pathaok, result, final_candidate, (RegEA4 == 0)); | 883 | patha_fill_iqk(adapt, pathaok, result, final_candidate, (RegEA4 == 0)); |
| 884 | 884 | ||
| 885 | /* To Fix BSOD when final_candidate is 0xff */ | ||
| 886 | /* by sherry 20120321 */ | ||
| 887 | if (final_candidate < 4) { | ||
| 888 | for (i = 0; i < IQK_Matrix_REG_NUM; i++) | ||
| 889 | dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i]; | ||
| 890 | dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.bIQKDone = true; | ||
| 891 | } | ||
| 892 | |||
| 893 | _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); | 885 | _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); |
| 894 | } | 886 | } |
| 895 | 887 | ||
| @@ -6,24 +6,19 @@ · 5 unmodified lines | |||
| 6 | #include "../include/drv_types.h" | 6 | #include "../include/drv_types.h" |
| 7 | #include "../include/hal_intf.h" | 7 | #include "../include/hal_intf.h" |
| 8 | 8 | ||
| 9 | uint rtw_hal_init(struct adapter *adapt) | 9 | uint rtw_hal_init(struct adapter *adapt) |
| 10 | { | 10 | { |
| 11 | uint status = _SUCCESS; | ||
| 12 | |||
| 13 | adapt->hw_init_completed = false; | 11 | adapt->hw_init_completed = false; |
| 14 | 12 | ||
| 15 | status = rtl8188eu_hal_init(adapt); | 13 | if (rtl8188eu_hal_init(adapt) != _SUCCESS) |
| 14 | return _FAIL; | ||
| 16 | 15 | ||
| 17 | if (status == _SUCCESS) { | 16 | adapt->hw_init_completed = true; |
| 18 | adapt->hw_init_completed = true; | ||
| 19 | 17 | ||
| 20 | if (adapt->registrypriv.notch_filter == 1) | 18 | if (adapt->registrypriv.notch_filter == 1) |
| 21 | hal_notch_filter_8188e(adapt, 1); | 19 | hal_notch_filter_8188e(adapt, 1); |
| 22 | } else { | ||
| 23 | adapt->hw_init_completed = false; | ||
| 24 | } | ||
| 25 | 20 | ||
| 26 | return status; | 21 | return _SUCCESS; |
| 27 | } | 22 | } |
| 28 | 23 | ||
| 29 | uint rtw_hal_deinit(struct adapter *adapt) | 24 | uint rtw_hal_deinit(struct adapter *adapt) |
| @@ -194,12 +194,12 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) · 193 unmodified lines | |||
| 194 | for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { | 194 | for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { |
| 195 | pEntry = dm_odm->pODM_StaInfo[i]; | 195 | pEntry = dm_odm->pODM_StaInfo[i]; |
| 196 | if (IS_STA_VALID(pEntry)) { | 196 | if (IS_STA_VALID(pEntry)) { |
| 197 | /* 2 Caculate RSSI per Antenna */ | 197 | /* 2 Calculate RSSI per Antenna */ |
| 198 | Main_RSSI = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? (dm_fat_tbl->MainAnt_Sum[i] / dm_fat_tbl->MainAnt_Cnt[i]) : 0; | 198 | Main_RSSI = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? (dm_fat_tbl->MainAnt_Sum[i] / dm_fat_tbl->MainAnt_Cnt[i]) : 0; |
| 199 | Aux_RSSI = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? (dm_fat_tbl->AuxAnt_Sum[i] / dm_fat_tbl->AuxAnt_Cnt[i]) : 0; | 199 | Aux_RSSI = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? (dm_fat_tbl->AuxAnt_Sum[i] / dm_fat_tbl->AuxAnt_Cnt[i]) : 0; |
| 200 | TargetAnt = (Main_RSSI >= Aux_RSSI) ? MAIN_ANT : AUX_ANT; | 200 | TargetAnt = (Main_RSSI >= Aux_RSSI) ? MAIN_ANT : AUX_ANT; |
| 201 | /* 2 Select MaxRSSI for DIG */ | 201 | /* 2 Select MaxRSSI for DIG */ |
| 202 | LocalMaxRSSI = (Main_RSSI > Aux_RSSI) ? Main_RSSI : Aux_RSSI; | 202 | LocalMaxRSSI = max(Main_RSSI, Aux_RSSI); |
| 203 | if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) | 203 | if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) |
| 204 | AntDivMaxRSSI = LocalMaxRSSI; | 204 | AntDivMaxRSSI = LocalMaxRSSI; |
| 205 | if (LocalMaxRSSI > MaxRSSI) | 205 | if (LocalMaxRSSI > MaxRSSI) |
| @@ -211,7 +211,7 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) · 5 unmodified lines | |||
| 211 | else if ((dm_fat_tbl->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0)) | 211 | else if ((dm_fat_tbl->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0)) |
| 212 | Aux_RSSI = Main_RSSI; | 212 | Aux_RSSI = Main_RSSI; |
| 213 | 213 | ||
| 214 | LocalMinRSSI = (Main_RSSI > Aux_RSSI) ? Aux_RSSI : Main_RSSI; | 214 | LocalMinRSSI = min(Main_RSSI, Aux_RSSI); |
| 215 | if (LocalMinRSSI < MinRSSI) { | 215 | if (LocalMinRSSI < MinRSSI) { |
| 216 | MinRSSI = LocalMinRSSI; | 216 | MinRSSI = LocalMinRSSI; |
| 217 | RxIdleAnt = TargetAnt; | 217 | RxIdleAnt = TargetAnt; |
| @@ -355,7 +355,7 @@ void rtl8188e_EfusePowerSwitch(struct adapter *pAdapter, u8 PwrState) · 354 unmodified lines | |||
| 355 | if (PwrState) { | 355 | if (PwrState) { |
| 356 | rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); | 356 | rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); |
| 357 | 357 | ||
| 358 | /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid */ | 358 | /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), default valid */ |
| 359 | res = rtw_read16(pAdapter, REG_SYS_ISO_CTRL, &tmpV16); | 359 | res = rtw_read16(pAdapter, REG_SYS_ISO_CTRL, &tmpV16); |
| 360 | if (res) | 360 | if (res) |
| 361 | return; | 361 | return; |
| @@ -676,11 +676,7 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy) · 314 unmodified lines | |||
| 676 | return status; | 676 | return status; |
| 677 | } | 677 | } |
| 678 | 678 | ||
| 679 | void | 679 | void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo) |
| 680 | Hal_EfuseParseIDCode88E( | ||
| 681 | struct adapter *padapter, | ||
| 682 | u8 *hwinfo | ||
| 683 | ) | ||
| 684 | { | 680 | { |
| 685 | struct eeprom_priv *pEEPROM = &padapter->eeprompriv; | 681 | struct eeprom_priv *pEEPROM = &padapter->eeprompriv; |
| 686 | struct net_device *netdev = padapter->pnetdev; | 682 | struct net_device *netdev = padapter->pnetdev; |
| @@ -23,7 +23,7 @@ static u32 phy_calculate_bit_shift(u32 bitmask) · 22 unmodified lines | |||
| 23 | /** | 23 | /** |
| 24 | * Function: PHY_QueryBBReg | 24 | * Function: PHY_QueryBBReg |
| 25 | * | 25 | * |
| 26 | * OverView: Read "sepcific bits" from BB register | 26 | * Overview: Read "sepcific bits" from BB register |
| 27 | * | 27 | * |
| 28 | * Input: | 28 | * Input: |
| 29 | * struct adapter *Adapter, | 29 | * struct adapter *Adapter, |
| @@ -56,7 +56,7 @@ rtl8188e_PHY_QueryBBReg( · 26 unmodified lines | |||
| 56 | /** | 56 | /** |
| 57 | * Function: PHY_SetBBReg | 57 | * Function: PHY_SetBBReg |
| 58 | * | 58 | * |
| 59 | * OverView: Write "Specific bits" to BB register (page 8~) | 59 | * Overview: Write "Specific bits" to BB register (page 8~) |
| 60 | * | 60 | * |
| 61 | * Input: | 61 | * Input: |
| 62 | * struct adapter *Adapter, | 62 | * struct adapter *Adapter, |
| @@ -94,7 +94,7 @@ void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u3 · 31 unmodified lines | |||
| 94 | /** | 94 | /** |
| 95 | * Function: phy_RFSerialRead | 95 | * Function: phy_RFSerialRead |
| 96 | * | 96 | * |
| 97 | * OverView: Read regster from RF chips | 97 | * Overview: Read register from RF chips |
| 98 | * | 98 | * |
| 99 | * Input: | 99 | * Input: |
| 100 | * struct adapter *Adapter, | 100 | * struct adapter *Adapter, |
| @@ -160,7 +160,7 @@ phy_RFSerialRead( · 59 unmodified lines | |||
| 160 | /** | 160 | /** |
| 161 | * Function: phy_RFSerialWrite | 161 | * Function: phy_RFSerialWrite |
| 162 | * | 162 | * |
| 163 | * OverView: Write data to RF register (page 8~) | 163 | * Overview: Write data to RF register (page 8~) |
| 164 | * | 164 | * |
| 165 | * Input: | 165 | * Input: |
| 166 | * struct adapter *Adapter, | 166 | * struct adapter *Adapter, |
| @@ -235,7 +235,7 @@ phy_RFSerialWrite( · 68 unmodified lines | |||
| 235 | /** | 235 | /** |
| 236 | * Function: PHY_QueryRFReg | 236 | * Function: PHY_QueryRFReg |
| 237 | * | 237 | * |
| 238 | * OverView: Query "Specific bits" to RF register (page 8~) | 238 | * Overview: Query "Specific bits" to RF register (page 8~) |
| 239 | * | 239 | * |
| 240 | * Input: | 240 | * Input: |
| 241 | * struct adapter *Adapter, | 241 | * struct adapter *Adapter, |
| @@ -261,7 +261,7 @@ u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask) · 19 unmodified lines | |||
| 261 | /** | 261 | /** |
| 262 | * Function: PHY_SetRFReg | 262 | * Function: PHY_SetRFReg |
| 263 | * | 263 | * |
| 264 | * OverView: Write "Specific bits" to RF register (page 8~) | 264 | * Overview: Write "Specific bits" to RF register (page 8~) |
| 265 | * | 265 | * |
| 266 | * Input: | 266 | * Input: |
| 267 | * struct adapter *Adapter, | 267 | * struct adapter *Adapter, |
| @@ -335,7 +335,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter) · 67 unmodified lines | |||
| 335 | /** | 335 | /** |
| 336 | * Function: phy_InitBBRFRegisterDefinition | 336 | * Function: phy_InitBBRFRegisterDefinition |
| 337 | * | 337 | * |
| 338 | * OverView: Initialize Register definition offset for Radio Path A/B/C/D | 338 | * Overview: Initialize Register definition offset for Radio Path A/B/C/D |
| 339 | * | 339 | * |
| 340 | * Input: | 340 | * Input: |
| 341 | * struct adapter *Adapter, | 341 | * struct adapter *Adapter, |
| @@ -363,7 +363,7 @@ phy_InitBBRFRegisterDefinition( · 21 unmodified lines | |||
| 363 | /* RF Interface (Output and) Enable */ | 363 | /* RF Interface (Output and) Enable */ |
| 364 | pHalData->PHYRegDef.rfintfe = rFPGA0_XA_RFInterfaceOE; /* 16 MSBs if read 32-bit from 0x860 (16-bit for 0x862) */ | 364 | pHalData->PHYRegDef.rfintfe = rFPGA0_XA_RFInterfaceOE; /* 16 MSBs if read 32-bit from 0x860 (16-bit for 0x862) */ |
| 365 | 365 | ||
| 366 | /* Addr of LSSI. Wirte RF register by driver */ | 366 | /* Addr of LSSI. Write RF register by driver */ |
| 367 | pHalData->PHYRegDef.rf3wireOffset = rFPGA0_XA_LSSIParameter; /* LSSI Parameter */ | 367 | pHalData->PHYRegDef.rf3wireOffset = rFPGA0_XA_LSSIParameter; /* LSSI Parameter */ |
| 368 | 368 | ||
| 369 | /* RF parameter */ | 369 | /* RF parameter */ |
| @@ -66,28 +66,25 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat · 65 unmodified lines | |||
| 66 | 66 | ||
| 67 | if (pattrib->pkt_rpt_type == NORMAL_RX) { | 67 | if (pattrib->pkt_rpt_type == NORMAL_RX) { |
| 68 | pattrib->pkt_len = le32_to_cpu(prxstat->rxdw0) & 0x00003fff; | 68 | pattrib->pkt_len = le32_to_cpu(prxstat->rxdw0) & 0x00003fff; |
| 69 | pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1; | ||
| 69 | pattrib->drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) >> 16) & 0xf) * 8; | 70 | pattrib->drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) >> 16) & 0xf) * 8; |
| 70 | 71 | pattrib->encrypt = (u8)((le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7); | |
| 72 | pattrib->qos = (le32_to_cpu(prxstat->rxdw0) >> 23) & 0x1; | ||
| 73 | pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3; | ||
| 71 | pattrib->physt = (le32_to_cpu(prxstat->rxdw0) >> 26) & 0x1; | 74 | pattrib->physt = (le32_to_cpu(prxstat->rxdw0) >> 26) & 0x1; |
| 72 | |||
| 73 | pattrib->bdecrypted = (le32_to_cpu(prxstat->rxdw0) & BIT(27)) ? 0 : 1; | 75 | pattrib->bdecrypted = (le32_to_cpu(prxstat->rxdw0) & BIT(27)) ? 0 : 1; |
| 74 | pattrib->encrypt = (le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7; | ||
| 75 | 76 | ||
| 76 | pattrib->qos = (le32_to_cpu(prxstat->rxdw0) >> 23) & 0x1; | ||
| 77 | pattrib->priority = (le32_to_cpu(prxstat->rxdw1) >> 8) & 0xf; | 77 | pattrib->priority = (le32_to_cpu(prxstat->rxdw1) >> 8) & 0xf; |
| 78 | |||
| 79 | pattrib->amsdu = (le32_to_cpu(prxstat->rxdw1) >> 13) & 0x1; | 78 | pattrib->amsdu = (le32_to_cpu(prxstat->rxdw1) >> 13) & 0x1; |
| 79 | pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1; | ||
| 80 | pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1; | ||
| 80 | 81 | ||
| 81 | pattrib->seq_num = le32_to_cpu(prxstat->rxdw2) & 0x00000fff; | 82 | pattrib->seq_num = le32_to_cpu(prxstat->rxdw2) & 0x00000fff; |
| 82 | pattrib->frag_num = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf; | 83 | pattrib->frag_num = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf; |
| 83 | pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1; | ||
| 84 | pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1; | ||
| 85 | 84 | ||
| 86 | pattrib->mcs_rate = le32_to_cpu(prxstat->rxdw3) & 0x3f; | 85 | pattrib->mcs_rate = le32_to_cpu(prxstat->rxdw3) & 0x3f; |
| 87 | pattrib->rxht = (le32_to_cpu(prxstat->rxdw3) >> 6) & 0x1; | 86 | pattrib->rxht = (le32_to_cpu(prxstat->rxdw3) >> 6) & 0x1; |
| 88 | 87 | ||
| 89 | pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1; | ||
| 90 | pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3; | ||
| 91 | } else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */ | 88 | } else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */ |
| 92 | pattrib->pkt_len = TX_RPT1_PKT_LEN; | 89 | pattrib->pkt_len = TX_RPT1_PKT_LEN; |
| 93 | } else if (pattrib->pkt_rpt_type == TX_REPORT2) { | 90 | } else if (pattrib->pkt_rpt_type == TX_REPORT2) { |
| @@ -108,33 +105,34 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat · 14 unmodified lines | |||
| 108 | */ | 105 | */ |
| 109 | void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status) | 106 | void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status) |
| 110 | { | 107 | { |
| 108 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precvframe->rx_data; | ||
| 111 | struct adapter *padapter = precvframe->adapter; | 109 | struct adapter *padapter = precvframe->adapter; |
| 112 | struct rx_pkt_attrib *pattrib = &precvframe->attrib; | 110 | struct rx_pkt_attrib *pattrib = &precvframe->attrib; |
| 113 | struct hal_data_8188e *pHalData = &padapter->haldata; | 111 | struct hal_data_8188e *pHalData = &padapter->haldata; |
| 114 | struct phy_info *pPHYInfo = &pattrib->phy_info; | 112 | struct phy_info *pPHYInfo = &pattrib->phy_info; |
| 115 | u8 *wlanhdr = precvframe->rx_data; | 113 | u8 *wlanhdr = precvframe->rx_data; |
| 116 | __le16 fc = *(__le16 *)wlanhdr; | ||
| 117 | struct odm_per_pkt_info pkt_info; | 114 | struct odm_per_pkt_info pkt_info; |
| 118 | u8 *sa = NULL; | 115 | u8 *sa = NULL; |
| 119 | struct sta_priv *pstapriv; | 116 | struct sta_priv *pstapriv; |
| 120 | struct sta_info *psta; | 117 | struct sta_info *psta; |
| 121 | 118 | ||
| 122 | pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(fc)) && | 119 | pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(hdr->frame_control)) && |
| 123 | !pattrib->icv_err && !pattrib->crc_err && | 120 | !pattrib->icv_err && !pattrib->crc_err && |
| 124 | !memcmp(get_hdr_bssid(wlanhdr), | 121 | !memcmp(get_hdr_bssid(wlanhdr), |
| 125 | get_bssid(&padapter->mlmepriv), ETH_ALEN)); | 122 | get_bssid(&padapter->mlmepriv), ETH_ALEN)); |
| 126 | 123 | ||
| 127 | pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && | 124 | pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && |
| 128 | (!memcmp(get_da(wlanhdr), | 125 | ether_addr_equal(ieee80211_get_DA(hdr), |
| 129 | myid(&padapter->eeprompriv), ETH_ALEN)); | 126 | myid(&padapter->eeprompriv)); |
| 130 | 127 | ||
| 131 | pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); | 128 | pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && |
| 129 | ieee80211_is_beacon(hdr->frame_control); | ||
| 132 | if (pkt_info.bPacketBeacon) { | 130 | if (pkt_info.bPacketBeacon) { |
| 133 | if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE)) | 131 | if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE)) |
| 134 | sa = padapter->mlmepriv.cur_network.network.MacAddress; | 132 | sa = padapter->mlmepriv.cur_network.network.MacAddress; |
| 135 | /* to do Ad-hoc */ | 133 | /* to do Ad-hoc */ |
| 136 | } else { | 134 | } else { |
| 137 | sa = get_sa(wlanhdr); | 135 | sa = ieee80211_get_SA(hdr); |
| 138 | } | 136 | } |
| 139 | 137 | ||
| 140 | pstapriv = &padapter->stapriv; | 138 | pstapriv = &padapter->stapriv; |
| @@ -149,7 +149,6 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw) · 148 unmodified lines | |||
| 149 | 149 | ||
| 150 | static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt) | 150 | static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt) |
| 151 | { | 151 | { |
| 152 | int pull = 0; | ||
| 153 | uint qsel; | 152 | uint qsel; |
| 154 | u8 data_rate, pwr_status, offset; | 153 | u8 data_rate, pwr_status, offset; |
| 155 | struct adapter *adapt = pxmitframe->padapter; | 154 | struct adapter *adapt = pxmitframe->padapter; |
| @@ -295,7 +294,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag · 139 unmodified lines | |||
| 295 | ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id); | 294 | ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id); |
| 296 | 295 | ||
| 297 | rtl8188eu_cal_txdesc_chksum(ptxdesc); | 296 | rtl8188eu_cal_txdesc_chksum(ptxdesc); |
| 298 | return pull; | 297 | return 0; |
| 299 | } | 298 | } |
| 300 | 299 | ||
| 301 | /* for non-agg data frame or management frame */ | 300 | /* for non-agg data frame or management frame */ |
| @@ -92,7 +92,7 @@ · 91 unmodified lines | |||
| 92 | #define rFPGA0_AdDaClockEn 0x888 | 92 | #define rFPGA0_AdDaClockEn 0x888 |
| 93 | #define rFPGA0_AnalogParameter4 0x88c | 93 | #define rFPGA0_AnalogParameter4 0x88c |
| 94 | 94 | ||
| 95 | #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Tranceiver LSSI Readback */ | 95 | #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Transceiver LSSI Readback */ |
| 96 | #define rFPGA0_XB_LSSIReadBack 0x8a4 | 96 | #define rFPGA0_XB_LSSIReadBack 0x8a4 |
| 97 | #define rFPGA0_XC_LSSIReadBack 0x8a8 | 97 | #define rFPGA0_XC_LSSIReadBack 0x8a8 |
| 98 | #define rFPGA0_XD_LSSIReadBack 0x8ac | 98 | #define rFPGA0_XD_LSSIReadBack 0x8ac |
| @@ -167,7 +167,7 @@ · 68 unmodified lines | |||
| 167 | 167 | ||
| 168 | /* RxIQ DC offset, Rx digital filter, DC notch filter */ | 168 | /* RxIQ DC offset, Rx digital filter, DC notch filter */ |
| 169 | #define rOFDM0_XARxAFE 0xc10 | 169 | #define rOFDM0_XARxAFE 0xc10 |
| 170 | #define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imblance matrix */ | 170 | #define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imbalance matrix */ |
| 171 | #define rOFDM0_XBRxAFE 0xc18 | 171 | #define rOFDM0_XBRxAFE 0xc18 |
| 172 | #define rOFDM0_XBRxIQImbalance 0xc1c | 172 | #define rOFDM0_XBRxIQImbalance 0xc1c |
| 173 | #define rOFDM0_XCRxAFE 0xc20 | 173 | #define rOFDM0_XCRxAFE 0xc20 |
| @@ -167,7 +167,6 @@ struct adapter { · 166 unmodified lines | |||
| 167 | 167 | ||
| 168 | s32 bDriverStopped; | 168 | s32 bDriverStopped; |
| 169 | s32 bSurpriseRemoved; | 169 | s32 bSurpriseRemoved; |
| 170 | s32 bCardDisableWOHSM; | ||
| 171 | 170 | ||
| 172 | u8 hw_init_completed; | 171 | u8 hw_init_completed; |
| 173 | s8 signal_strength; | 172 | s8 signal_strength; |
| @@ -80,7 +80,6 @@ struct odm_rate_adapt { · 79 unmodified lines | |||
| 80 | #define HP_THERMAL_NUM 8 | 80 | #define HP_THERMAL_NUM 8 |
| 81 | 81 | ||
| 82 | #define AVG_THERMAL_NUM 8 | 82 | #define AVG_THERMAL_NUM 8 |
| 83 | #define IQK_Matrix_REG_NUM 8 | ||
| 84 | 83 | ||
| 85 | struct odm_phy_dbg_info { | 84 | struct odm_phy_dbg_info { |
| 86 | /* ODM Write,debug info */ | 85 | /* ODM Write,debug info */ |
| @@ -119,7 +118,8 @@ enum odm_ability_def { · 32 unmodified lines | |||
| 119 | ODM_BB_PWR_TRA = BIT(8), | 118 | ODM_BB_PWR_TRA = BIT(8), |
| 120 | }; | 119 | }; |
| 121 | 120 | ||
| 122 | # define ODM_ITRF_USB 0x2 | 121 | #define ODM_ITRF_USB 0x2 |
| 122 | #define ODM_CE 0x04 | ||
| 123 | 123 | ||
| 124 | /* ODM_CMNINFO_WM_MODE */ | 124 | /* ODM_CMNINFO_WM_MODE */ |
| 125 | enum odm_wireless_mode { | 125 | enum odm_wireless_mode { |
| @@ -163,11 +163,6 @@ struct odm_ra_info { · 37 unmodified lines | |||
| 163 | u8 PTSmoothFactor; | 163 | u8 PTSmoothFactor; |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| 166 | struct ijk_matrix_regs_set { | ||
| 167 | bool bIQKDone; | ||
| 168 | s32 Value[1][IQK_Matrix_REG_NUM]; | ||
| 169 | }; | ||
| 170 | |||
| 171 | struct odm_rf_cal { | 166 | struct odm_rf_cal { |
| 172 | /* for tx power tracking */ | 167 | /* for tx power tracking */ |
| 173 | u32 RegA24; /* for TempCCK */ | 168 | u32 RegA24; /* for TempCCK */ |
| @@ -205,7 +200,6 @@ struct odm_rf_cal { · 31 unmodified lines | |||
| 205 | 200 | ||
| 206 | u8 ThermalValue_HP[HP_THERMAL_NUM]; | 201 | u8 ThermalValue_HP[HP_THERMAL_NUM]; |
| 207 | u8 ThermalValue_HP_index; | 202 | u8 ThermalValue_HP_index; |
| 208 | struct ijk_matrix_regs_set IQKMatrixRegSetting; | ||
| 209 | 203 | ||
| 210 | u8 Delta_IQK; | 204 | u8 Delta_IQK; |
| 211 | u8 Delta_LCK; | 205 | u8 Delta_LCK; |
| @@ -11,6 +11,13 @@ · 10 unmodified lines | |||
| 11 | #define MAIN_ANT_CGCS_RX 0 | 11 | #define MAIN_ANT_CGCS_RX 0 |
| 12 | #define AUX_ANT_CGCS_RX 1 | 12 | #define AUX_ANT_CGCS_RX 1 |
| 13 | 13 | ||
| 14 | #define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \ | ||
| 15 | le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24)) | ||
| 16 | #define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \ | ||
| 17 | le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25)) | ||
| 18 | #define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \ | ||
| 19 | le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29)) | ||
| 20 | |||
| 14 | void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *pDM_Odm); | 21 | void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *pDM_Odm); |
| 15 | 22 | ||
| 16 | void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm); | 23 | void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm); |
| @@ -1,16 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ | ||
| 2 | /* Copyright(c) 2007 - 2011 Realtek Corporation. */ | ||
| 3 | |||
| 4 | #ifndef __ODM_TYPES_H__ | ||
| 5 | #define __ODM_TYPES_H__ | ||
| 6 | |||
| 7 | #define ODM_CE 0x04 /* BIT(2) */ | ||
| 8 | |||
| 9 | #define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \ | ||
| 10 | le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24)) | ||
| 11 | #define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \ | ||
| 12 | le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25)) | ||
| 13 | #define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \ | ||
| 14 | le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29)) | ||
| 15 | |||
| 16 | #endif /* __ODM_TYPES_H__ */ | ||
| @@ -43,10 +43,10 @@ int netdev_open(struct net_device *pnetdev); · 42 unmodified lines | |||
| 43 | int netdev_close(struct net_device *pnetdev); | 43 | int netdev_close(struct net_device *pnetdev); |
| 44 | 44 | ||
| 45 | u8 rtw_init_drv_sw(struct adapter *padapter); | 45 | u8 rtw_init_drv_sw(struct adapter *padapter); |
| 46 | u8 rtw_free_drv_sw(struct adapter *padapter); | 46 | void rtw_free_drv_sw(struct adapter *padapter); |
| 47 | u8 rtw_reset_drv_sw(struct adapter *padapter); | 47 | void rtw_reset_drv_sw(struct adapter *padapter); |
| 48 | 48 | ||
| 49 | u32 rtw_start_drv_threads(struct adapter *padapter); | 49 | int rtw_start_drv_threads(struct adapter *padapter); |
| 50 | void rtw_stop_drv_threads (struct adapter *padapter); | 50 | void rtw_stop_drv_threads (struct adapter *padapter); |
| 51 | void rtw_cancel_all_timer(struct adapter *padapter); | 51 | void rtw_cancel_all_timer(struct adapter *padapter); |
| 52 | 52 | ||
| @@ -53,7 +53,7 @@ static inline struct list_head *get_list_head(struct __queue *queue) · 52 unmodified lines | |||
| 53 | return (&(queue->queue)); | 53 | return (&(queue->queue)); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static inline void _set_timer(struct timer_list *ptimer,u32 delay_time) | 56 | static inline void _set_timer(struct timer_list *ptimer, u32 delay_time) |
| 57 | { | 57 | { |
| 58 | mod_timer(ptimer, jiffies + msecs_to_jiffies(delay_time)); | 58 | mod_timer(ptimer, jiffies + msecs_to_jiffies(delay_time)); |
| 59 | } | 59 | } |
| @@ -66,7 +66,7 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev) · 6 unmodified lines | |||
| 66 | netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3)); | 66 | netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3)); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | extern int RTW_STATUS_CODE(int error_code); | 69 | int RTW_STATUS_CODE(int error_code); |
| 70 | 70 | ||
| 71 | void *rtw_malloc2d(int h, int w, int size); | 71 | void *rtw_malloc2d(int h, int w, int size); |
| 72 | 72 | ||
| @@ -108,7 +108,7 @@ void rtw_free_netdev(struct net_device *netdev); · 35 unmodified lines | |||
| 108 | #define FUNC_ADPT_FMT "%s(%s)" | 108 | #define FUNC_ADPT_FMT "%s(%s)" |
| 109 | #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name | 109 | #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name |
| 110 | 110 | ||
| 111 | #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1) | 111 | #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1) |
| 112 | 112 | ||
| 113 | /* Macros for handling unaligned memory accesses */ | 113 | /* Macros for handling unaligned memory accesses */ |
| 114 | 114 | ||
| @@ -14,7 +14,6 @@ · 13 unmodified lines | |||
| 14 | #include "rtl8188e_xmit.h" | 14 | #include "rtl8188e_xmit.h" |
| 15 | #include "rtl8188e_cmd.h" | 15 | #include "rtl8188e_cmd.h" |
| 16 | #include "rtw_efuse.h" | 16 | #include "rtw_efuse.h" |
| 17 | #include "odm_types.h" | ||
| 18 | #include "odm.h" | 17 | #include "odm.h" |
| 19 | #include "odm_HWConfig.h" | 18 | #include "odm_HWConfig.h" |
| 20 | #include "odm_RegDefine11N.h" | 19 | #include "odm_RegDefine11N.h" |
| @@ -88,7 +87,7 @@ struct txpowerinfo24g { · 67 unmodified lines | |||
| 88 | /* 9bytes + 1byt + 5bytes and pre 1byte. */ | 87 | /* 9bytes + 1byt + 5bytes and pre 1byte. */ |
| 89 | /* For worst case: */ | 88 | /* For worst case: */ |
| 90 | /* | 2byte|----8bytes----|1byte|--7bytes--| 92D */ | 89 | /* | 2byte|----8bytes----|1byte|--7bytes--| 92D */ |
| 91 | /* PG data exclude header, dummy 7 bytes frome CP test and reserved 1byte. */ | 90 | /* PG data exclude header, dummy 7 bytes from CP test and reserved 1byte. */ |
| 92 | #define EFUSE_OOB_PROTECT_BYTES_88E 18 | 91 | #define EFUSE_OOB_PROTECT_BYTES_88E 18 |
| 93 | 92 | ||
| 94 | #define EFUSE_PROTECT_BYTES_BANK 16 | 93 | #define EFUSE_PROTECT_BYTES_BANK 16 |
| @@ -165,9 +164,9 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *hwinfo, · 70 unmodified lines | |||
| 165 | 164 | ||
| 166 | void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, | 165 | void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, |
| 167 | bool AutoLoadFail); | 166 | bool AutoLoadFail); |
| 168 | void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter,u8 *PROMContent, | 167 | void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, |
| 169 | bool AutoLoadFail); | 168 | bool AutoLoadFail); |
| 170 | void Hal_ReadThermalMeter_88E(struct adapter * dapter, u8 *PROMContent, | 169 | void Hal_ReadThermalMeter_88E(struct adapter *padapter, u8 *PROMContent, |
| 171 | bool AutoloadFail); | 170 | bool AutoloadFail); |
| 172 | void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo, | 171 | void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo, |
| 173 | bool AutoLoadFail); | 172 | bool AutoLoadFail); |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | |||
| 4 | #ifndef __RTL8188E_SPEC_H__ | 4 | #ifndef __RTL8188E_SPEC_H__ |
| 5 | #define __RTL8188E_SPEC_H__ | 5 | #define __RTL8188E_SPEC_H__ |
| 6 | 6 | ||
| 7 | /* 8192C Regsiter offset definition */ | 7 | /* 8192C Register offset definition */ |
| 8 | 8 | ||
| 9 | #define HAL_PS_TIMER_INT_DELAY 50 /* 50 microseconds */ | 9 | #define HAL_PS_TIMER_INT_DELAY 50 /* 50 microseconds */ |
| 10 | #define HAL_92C_NAV_UPPER_UNIT 128 /* micro-second */ | 10 | #define HAL_92C_NAV_UPPER_UNIT 128 /* micro-second */ |
| @@ -674,7 +674,7 @@ Current IOREG MAP · 663 unmodified lines | |||
| 674 | 674 | ||
| 675 | #define REG_USB_HRPWM 0xFE58 | 675 | #define REG_USB_HRPWM 0xFE58 |
| 676 | #define REG_USB_HCPWM 0xFE57 | 676 | #define REG_USB_HCPWM 0xFE57 |
| 677 | /* 8192C Regsiter Bit and Content definition */ | 677 | /* 8192C Register Bit and Content definition */ |
| 678 | /* 0x0000h ~ 0x00FFh System Configuration */ | 678 | /* 0x0000h ~ 0x00FFh System Configuration */ |
| 679 | 679 | ||
| 680 | /* 2 SYS_ISO_CTRL */ | 680 | /* 2 SYS_ISO_CTRL */ |
| @@ -900,12 +900,12 @@ Current IOREG MAP · 219 unmodified lines | |||
| 900 | #define HQSEL_HIQ BIT(5) | 900 | #define HQSEL_HIQ BIT(5) |
| 901 | 901 | ||
| 902 | /* For normal driver, 0x10C */ | 902 | /* For normal driver, 0x10C */ |
| 903 | #define _TXDMA_HIQ_MAP(x) (((x)&0x3) << 14) | 903 | #define _TXDMA_HIQ_MAP(x) (((x) & 0x3) << 14) |
| 904 | #define _TXDMA_MGQ_MAP(x) (((x)&0x3) << 12) | 904 | #define _TXDMA_MGQ_MAP(x) (((x) & 0x3) << 12) |
| 905 | #define _TXDMA_BKQ_MAP(x) (((x)&0x3) << 10) | 905 | #define _TXDMA_BKQ_MAP(x) (((x) & 0x3) << 10) |
| 906 | #define _TXDMA_BEQ_MAP(x) (((x)&0x3) << 8 ) | 906 | #define _TXDMA_BEQ_MAP(x) (((x) & 0x3) << 8) |
| 907 | #define _TXDMA_VIQ_MAP(x) (((x)&0x3) << 6 ) | 907 | #define _TXDMA_VIQ_MAP(x) (((x) & 0x3) << 6) |
| 908 | #define _TXDMA_VOQ_MAP(x) (((x)&0x3) << 4 ) | 908 | #define _TXDMA_VOQ_MAP(x) (((x) & 0x3) << 4) |
| 909 | 909 | ||
| 910 | #define QUEUE_LOW 1 | 910 | #define QUEUE_LOW 1 |
| 911 | #define QUEUE_NORMAL 2 | 911 | #define QUEUE_NORMAL 2 |
| @@ -1135,7 +1135,7 @@ Current IOREG MAP · 223 unmodified lines | |||
| 1135 | #define EEPROM_Default_CrystalCap_88E 0x20 | 1135 | #define EEPROM_Default_CrystalCap_88E 0x20 |
| 1136 | #define EEPROM_Default_ThermalMeter_88E 0x18 | 1136 | #define EEPROM_Default_ThermalMeter_88E 0x18 |
| 1137 | 1137 | ||
| 1138 | /* New EFUSE deafult value */ | 1138 | /* New EFUSE default value */ |
| 1139 | #define EEPROM_DEFAULT_24G_INDEX 0x2D | 1139 | #define EEPROM_DEFAULT_24G_INDEX 0x2D |
| 1140 | #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02 | 1140 | #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02 |
| 1141 | #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04 | 1141 | #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04 |
| @@ -26,7 +26,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta); · 25 unmodified lines | |||
| 26 | void sta_info_update(struct adapter *padapter, struct sta_info *psta); | 26 | void sta_info_update(struct adapter *padapter, struct sta_info *psta); |
| 27 | u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, | 27 | u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, |
| 28 | bool active, u16 reason); | 28 | bool active, u16 reason); |
| 29 | int rtw_sta_flush(struct adapter *padapter); | 29 | void rtw_sta_flush(struct adapter *padapter); |
| 30 | void start_ap_mode(struct adapter *padapter); | 30 | void start_ap_mode(struct adapter *padapter); |
| 31 | void stop_ap_mode(struct adapter *padapter); | 31 | void stop_ap_mode(struct adapter *padapter); |
| 32 | void update_bmc_sta(struct adapter *padapter); | 32 | void update_bmc_sta(struct adapter *padapter); |
| @@ -6,15 +6,10 @@ · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | #include "wlan_bssdef.h" | 7 | #include "wlan_bssdef.h" |
| 8 | #include "rtw_rf.h" | 8 | #include "rtw_rf.h" |
| 9 | #include "rtw_led.h" | ||
| 10 | |||
| 11 | #define C2H_MEM_SZ (16*1024) | ||
| 12 | 9 | ||
| 13 | #include "osdep_service.h" | 10 | #include "osdep_service.h" |
| 14 | #include "ieee80211.h" /* <ieee80211/ieee80211.h> */ | 11 | #include "ieee80211.h" /* <ieee80211/ieee80211.h> */ |
| 15 | 12 | ||
| 16 | #define FREE_CMDOBJ_SZ 128 | ||
| 17 | |||
| 18 | #define MAX_CMDSZ 1024 | 13 | #define MAX_CMDSZ 1024 |
| 19 | #define MAX_RSPSZ 512 | 14 | #define MAX_RSPSZ 512 |
| 20 | #define MAX_EVTSZ 1024 | 15 | #define MAX_EVTSZ 1024 |
| @@ -82,10 +77,10 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd); · 61 unmodified lines | |||
| 82 | 77 | ||
| 83 | int rtw_cmd_thread(void *context); | 78 | int rtw_cmd_thread(void *context); |
| 84 | 79 | ||
| 85 | u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); | 80 | int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); |
| 86 | void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); | 81 | void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); |
| 87 | 82 | ||
| 88 | u32 rtw_init_evt_priv(struct evt_priv *pevtpriv); | 83 | int rtw_init_evt_priv(struct evt_priv *pevtpriv); |
| 89 | void rtw_free_evt_priv(struct evt_priv *pevtpriv); | 84 | void rtw_free_evt_priv(struct evt_priv *pevtpriv); |
| 90 | void rtw_evt_notify_isr(struct evt_priv *pevtpriv); | 85 | void rtw_evt_notify_isr(struct evt_priv *pevtpriv); |
| 91 | u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType); | 86 | u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType); |
| @@ -445,8 +440,7 @@ struct getrfintfs_parm { · 353 unmodified lines | |||
| 445 | u8 rfintfs; | 440 | u8 rfintfs; |
| 446 | }; | 441 | }; |
| 447 | 442 | ||
| 448 | struct Tx_Beacon_param | 443 | struct Tx_Beacon_param { |
| 449 | { | ||
| 450 | struct wlan_bssid_ex network; | 444 | struct wlan_bssid_ex network; |
| 451 | }; | 445 | }; |
| 452 | 446 | ||
| @@ -455,7 +449,7 @@ struct Tx_Beacon_param · 2 unmodified lines | |||
| 455 | 449 | ||
| 456 | mac[0] == 0 | 450 | mac[0] == 0 |
| 457 | ==> CMD mode, return H2C_SUCCESS. | 451 | ==> CMD mode, return H2C_SUCCESS. |
| 458 | The following condition must be ture under CMD mode | 452 | The following condition must be true under CMD mode |
| 459 | mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0; | 453 | mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0; |
| 460 | s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7; | 454 | s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7; |
| 461 | s2 == (b1 << 8 | b0); | 455 | s2 == (b1 << 8 | b0); |
| @@ -508,7 +502,7 @@ struct drvextra_cmd_parm { · 46 unmodified lines | |||
| 508 | unsigned char *pbuf; | 502 | unsigned char *pbuf; |
| 509 | }; | 503 | }; |
| 510 | 504 | ||
| 511 | /*------------------- Below are used for RF/BB tunning ---------------------*/ | 505 | /*------------------- Below are used for RF/BB tuning ---------------------*/ |
| 512 | 506 | ||
| 513 | struct setantenna_parm { | 507 | struct setantenna_parm { |
| 514 | u8 tx_antset; | 508 | u8 tx_antset; |
| @@ -592,14 +586,14 @@ struct setratable_parm { · 77 unmodified lines | |||
| 592 | }; | 586 | }; |
| 593 | 587 | ||
| 594 | struct getratable_parm { | 588 | struct getratable_parm { |
| 595 | uint rsvd; | 589 | uint rsvd; |
| 596 | }; | 590 | }; |
| 597 | 591 | ||
| 598 | struct getratable_rsp { | 592 | struct getratable_rsp { |
| 599 | u8 ss_ForceUp[NumRates]; | 593 | u8 ss_ForceUp[NumRates]; |
| 600 | u8 ss_ULevel[NumRates]; | 594 | u8 ss_ULevel[NumRates]; |
| 601 | u8 ss_DLevel[NumRates]; | 595 | u8 ss_DLevel[NumRates]; |
| 602 | u8 count_judge[NumRates]; | 596 | u8 count_judge[NumRates]; |
| 603 | }; | 597 | }; |
| 604 | 598 | ||
| 605 | /* to get TX,RX retry count */ | 599 | /* to get TX,RX retry count */ |
| @@ -682,26 +676,22 @@ struct set_ch_parm { · 76 unmodified lines | |||
| 682 | }; | 676 | }; |
| 683 | 677 | ||
| 684 | /*H2C Handler index: 59 */ | 678 | /*H2C Handler index: 59 */ |
| 685 | struct SetChannelPlan_param | 679 | struct SetChannelPlan_param { |
| 686 | { | ||
| 687 | u8 channel_plan; | 680 | u8 channel_plan; |
| 688 | }; | 681 | }; |
| 689 | 682 | ||
| 690 | /*H2C Handler index: 60 */ | 683 | /*H2C Handler index: 60 */ |
| 691 | struct LedBlink_param | 684 | struct LedBlink_param { |
| 692 | { | ||
| 693 | struct LED_871x *pLed; | 685 | struct LED_871x *pLed; |
| 694 | }; | 686 | }; |
| 695 | 687 | ||
| 696 | /*H2C Handler index: 61 */ | 688 | /*H2C Handler index: 61 */ |
| 697 | struct SetChannelSwitch_param | 689 | struct SetChannelSwitch_param { |
| 698 | { | ||
| 699 | u8 new_ch_no; | 690 | u8 new_ch_no; |
| 700 | }; | 691 | }; |
| 701 | 692 | ||
| 702 | /*H2C Handler index: 62 */ | 693 | /*H2C Handler index: 62 */ |
| 703 | struct TDLSoption_param | 694 | struct TDLSoption_param { |
| 704 | { | ||
| 705 | u8 addr[ETH_ALEN]; | 695 | u8 addr[ETH_ALEN]; |
| 706 | u8 option; | 696 | u8 option; |
| 707 | }; | 697 | }; |
| @@ -730,31 +720,31 @@ Result: · 22 unmodified lines | |||
| 730 | #define H2C_CMD_OVERFLOW 0x06 | 720 | #define H2C_CMD_OVERFLOW 0x06 |
| 731 | #define H2C_RESERVED 0x07 | 721 | #define H2C_RESERVED 0x07 |
| 732 | 722 | ||
| 733 | u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num); | 723 | u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num); |
| 734 | u8 rtw_createbss_cmd(struct adapter *padapter); | 724 | u8 rtw_createbss_cmd(struct adapter *padapter); |
| 735 | u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key); | 725 | u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key); |
| 736 | u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue); | 726 | u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue); |
| 737 | u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork); | 727 | u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork); |
| 738 | u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue); | 728 | u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue); |
| 739 | u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); | 729 | u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); |
| 740 | u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); | 730 | int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); |
| 741 | u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); | 731 | u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); |
| 742 | 732 | ||
| 743 | u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset,u8 *pval); | 733 | u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval); |
| 744 | u8 rtw_setfwdig_cmd(struct adapter*padapter, u8 type); | 734 | u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type); |
| 745 | u8 rtw_setfwra_cmd(struct adapter*padapter, u8 type); | 735 | u8 rtw_setfwra_cmd(struct adapter *padapter, u8 type); |
| 746 | 736 | ||
| 747 | u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr); | 737 | u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr); |
| 748 | 738 | ||
| 749 | u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter); | 739 | u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter); |
| 750 | 740 | ||
| 751 | u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue); | 741 | u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue); |
| 752 | u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime); | 742 | u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 minRptTime); |
| 753 | 743 | ||
| 754 | u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue); | 744 | u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue); |
| 755 | u8 rtw_ps_cmd(struct adapter*padapter); | 745 | u8 rtw_ps_cmd(struct adapter *padapter); |
| 756 | 746 | ||
| 757 | u8 rtw_chk_hi_queue_cmd(struct adapter*padapter); | 747 | u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); |
| 758 | 748 | ||
| 759 | u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); | 749 | u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); |
| 760 | 750 | ||
| @@ -859,8 +849,7 @@ enum rtw_h2c_cmd { · 98 unmodified lines | |||
| 859 | #define _SetRFReg_CMD_ _Write_RFREG_CMD_ | 849 | #define _SetRFReg_CMD_ _Write_RFREG_CMD_ |
| 860 | 850 | ||
| 861 | #ifdef _RTW_CMD_C_ | 851 | #ifdef _RTW_CMD_C_ |
| 862 | static struct _cmd_callback rtw_cmd_callback[] = | 852 | static struct _cmd_callback rtw_cmd_callback[] = { |
| 863 | { | ||
| 864 | {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ | 853 | {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ |
| 865 | {GEN_CMD_CODE(_Write_MACREG), NULL}, | 854 | {GEN_CMD_CODE(_Write_MACREG), NULL}, |
| 866 | {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback}, | 855 | {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback}, |
| @@ -209,7 +209,7 @@ struct io_priv { · 208 unmodified lines | |||
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); | 211 | uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); |
| 212 | void sync_ioreq_enqueue(struct io_req *preq,struct io_queue *ioqueue); | 212 | void sync_ioreq_enqueue(struct io_req *preq, struct io_queue *ioqueue); |
| 213 | uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); | 213 | uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); |
| 214 | uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue); | 214 | uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue); |
| 215 | struct io_req *alloc_ioreq(struct io_queue *pio_q); | 215 | struct io_req *alloc_ioreq(struct io_queue *pio_q); |
| @@ -285,18 +285,4 @@ void bus_sync_io(struct io_queue *pio_q); · 69 unmodified lines | |||
| 285 | u32 _ioreq2rwmem(struct io_queue *pio_q); | 285 | u32 _ioreq2rwmem(struct io_queue *pio_q); |
| 286 | void dev_power_down(struct adapter *Adapter, u8 bpwrup); | 286 | void dev_power_down(struct adapter *Adapter, u8 bpwrup); |
| 287 | 287 | ||
| 288 | #define PlatformEFIOWrite1Byte(_a,_b,_c) \ | ||
| 289 | rtw_write8(_a,_b,_c) | ||
| 290 | #define PlatformEFIOWrite2Byte(_a,_b,_c) \ | ||
| 291 | rtw_write16(_a,_b,_c) | ||
| 292 | #define PlatformEFIOWrite4Byte(_a,_b,_c) \ | ||
| 293 | rtw_write32(_a,_b,_c) | ||
| 294 | |||
| 295 | #define PlatformEFIORead1Byte(_a,_b) \ | ||
| 296 | rtw_read8(_a,_b) | ||
| 297 | #define PlatformEFIORead2Byte(_a,_b) \ | ||
| 298 | rtw_read16(_a,_b) | ||
| 299 | #define PlatformEFIORead4Byte(_a,_b) \ | ||
| 300 | rtw_read32(_a,_b) | ||
| 301 | |||
| 302 | #endif /* _RTL8711_IO_H_ */ | 288 | #endif /* _RTL8711_IO_H_ */ |
| @@ -10,10 +10,10 @@ typedef u8 NDIS_802_11_PMKID_VALUE[16]; · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | u8 rtw_set_802_11_authentication_mode(struct adapter *adapt, | 11 | u8 rtw_set_802_11_authentication_mode(struct adapter *adapt, |
| 12 | enum ndis_802_11_auth_mode authmode); | 12 | enum ndis_802_11_auth_mode authmode); |
| 13 | u8 rtw_set_802_11_bssid(struct adapter*adapter, u8 *bssid); | 13 | u8 rtw_set_802_11_bssid(struct adapter *adapter, u8 *bssid); |
| 14 | u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep); | 14 | u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep); |
| 15 | u8 rtw_set_802_11_disassociate(struct adapter *adapter); | 15 | void rtw_set_802_11_disassociate(struct adapter *adapter); |
| 16 | u8 rtw_set_802_11_bssid_list_scan(struct adapter*adapter, | 16 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter, |
| 17 | struct ndis_802_11_ssid *pssid, | 17 | struct ndis_802_11_ssid *pssid, |
| 18 | int ssid_max_num); | 18 | int ssid_max_num); |
| 19 | u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter, | 19 | u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter, |
| @@ -33,8 +33,6 @@ enum LED_STATE_871x { · 32 unmodified lines | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | struct led_priv { | 35 | struct led_priv { |
| 36 | struct adapter *padapter; | ||
| 37 | |||
| 38 | bool bRegUseLed; | 36 | bool bRegUseLed; |
| 39 | 37 | ||
| 40 | enum LED_STATE_871x CurrLedState; /* Current LED state. */ | 38 | enum LED_STATE_871x CurrLedState; /* Current LED state. */ |
| @@ -47,7 +45,6 @@ struct led_priv { · 6 unmodified lines | |||
| 47 | 45 | ||
| 48 | u32 BlinkTimes; /* Number of times to toggle led state for blinking. */ | 46 | u32 BlinkTimes; /* Number of times to toggle led state for blinking. */ |
| 49 | 47 | ||
| 50 | bool bLedLinkBlinkInProgress; | ||
| 51 | bool bLedScanBlinkInProgress; | 48 | bool bLedScanBlinkInProgress; |
| 52 | struct delayed_work blink_work; | 49 | struct delayed_work blink_work; |
| 53 | }; | 50 | }; |
| @@ -101,17 +101,17 @@ struct rt_link_detect { · 100 unmodified lines | |||
| 101 | 101 | ||
| 102 | struct profile_info { | 102 | struct profile_info { |
| 103 | u8 ssidlen; | 103 | u8 ssidlen; |
| 104 | u8 ssid[ WLAN_SSID_MAXLEN ]; | 104 | u8 ssid[WLAN_SSID_MAXLEN]; |
| 105 | u8 peermac[ ETH_ALEN ]; | 105 | u8 peermac[ETH_ALEN]; |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | struct tx_invite_req_info { | 108 | struct tx_invite_req_info { |
| 109 | u8 token; | 109 | u8 token; |
| 110 | u8 benable; | 110 | u8 benable; |
| 111 | u8 go_ssid[ WLAN_SSID_MAXLEN ]; | 111 | u8 go_ssid[WLAN_SSID_MAXLEN]; |
| 112 | u8 ssidlen; | 112 | u8 ssidlen; |
| 113 | u8 go_bssid[ ETH_ALEN ]; | 113 | u8 go_bssid[ETH_ALEN]; |
| 114 | u8 peer_macaddr[ ETH_ALEN ]; | 114 | u8 peer_macaddr[ETH_ALEN]; |
| 115 | u8 operating_ch; /* This information will be set by using the | 115 | u8 operating_ch; /* This information will be set by using the |
| 116 | * p2p_set op_ch=x */ | 116 | * p2p_set op_ch=x */ |
| 117 | u8 peer_ch; /* The listen channel for peer P2P device */ | 117 | u8 peer_ch; /* The listen channel for peer P2P device */ |
| @@ -154,9 +154,9 @@ struct tx_nego_req_info { · 36 unmodified lines | |||
| 154 | }; | 154 | }; |
| 155 | 155 | ||
| 156 | struct group_id_info { | 156 | struct group_id_info { |
| 157 | u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of | 157 | u8 go_device_addr[ETH_ALEN]; /* The GO's device address of |
| 158 | * this P2P group */ | 158 | * this P2P group */ |
| 159 | u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */ | 159 | u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */ |
| 160 | }; | 160 | }; |
| 161 | 161 | ||
| 162 | struct scan_limit_info { | 162 | struct scan_limit_info { |
| @@ -443,11 +443,6 @@ static inline bool check_fwstate(struct mlme_priv *pmlmepriv, int state) · 280 unmodified lines | |||
| 443 | return false; | 443 | return false; |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | static inline int get_fwstate(struct mlme_priv *pmlmepriv) | ||
| 447 | { | ||
| 448 | return pmlmepriv->fw_state; | ||
| 449 | } | ||
| 450 | |||
| 451 | /* | 446 | /* |
| 452 | * No Limit on the calling context, | 447 | * No Limit on the calling context, |
| 453 | * therefore set it to be the critical section... | 448 | * therefore set it to be the critical section... |
| @@ -459,7 +454,7 @@ static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state) · 5 unmodified lines | |||
| 459 | { | 454 | { |
| 460 | pmlmepriv->fw_state |= state; | 455 | pmlmepriv->fw_state |= state; |
| 461 | /* FOR HW integration */ | 456 | /* FOR HW integration */ |
| 462 | if (_FW_UNDER_SURVEY==state) | 457 | if (_FW_UNDER_SURVEY == state) |
| 463 | pmlmepriv->bScanInProcess = true; | 458 | pmlmepriv->bScanInProcess = true; |
| 464 | } | 459 | } |
| 465 | 460 | ||
| @@ -467,7 +462,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state) · 1 unmodified line | |||
| 467 | { | 462 | { |
| 468 | pmlmepriv->fw_state &= ~state; | 463 | pmlmepriv->fw_state &= ~state; |
| 469 | /* FOR HW integration */ | 464 | /* FOR HW integration */ |
| 470 | if (_FW_UNDER_SURVEY==state) | 465 | if (_FW_UNDER_SURVEY == state) |
| 471 | pmlmepriv->bScanInProcess = false; | 466 | pmlmepriv->bScanInProcess = false; |
| 472 | } | 467 | } |
| 473 | 468 | ||
| @@ -528,7 +523,7 @@ void rtw_indicate_scan_done(struct adapter *padapter); · 54 unmodified lines | |||
| 528 | int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, | 523 | int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, |
| 529 | uint in_len); | 524 | uint in_len); |
| 530 | int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, | 525 | int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, |
| 531 | uint in_len, uint initial_out_len); | 526 | uint in_len, uint initial_out_len); |
| 532 | void rtw_init_registrypriv_dev_network(struct adapter *adapter); | 527 | void rtw_init_registrypriv_dev_network(struct adapter *adapter); |
| 533 | 528 | ||
| 534 | void rtw_update_registrypriv_dev_network(struct adapter *adapter); | 529 | void rtw_update_registrypriv_dev_network(struct adapter *adapter); |
| @@ -544,10 +539,8 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv); · 9 unmodified lines | |||
| 544 | 539 | ||
| 545 | void _rtw_free_network(struct mlme_priv *pmlmepriv, | 540 | void _rtw_free_network(struct mlme_priv *pmlmepriv, |
| 546 | struct wlan_network *pnetwork, u8 isfreeall); | 541 | struct wlan_network *pnetwork, u8 isfreeall); |
| 547 | void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, | ||
| 548 | struct wlan_network *pnetwork); | ||
| 549 | 542 | ||
| 550 | struct wlan_network* _rtw_find_network(struct __queue *scanned_queue, u8 *addr); | 543 | struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr); |
| 551 | 544 | ||
| 552 | void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall); | 545 | void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall); |
| 553 | 546 | ||
| @@ -184,7 +184,7 @@ enum SCAN_STATE { · 183 unmodified lines | |||
| 184 | SCAN_STATE_MAX, | 184 | SCAN_STATE_MAX, |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | typedef unsigned int (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame); | 187 | typedef void (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame); |
| 188 | 188 | ||
| 189 | struct ss_res { | 189 | struct ss_res { |
| 190 | int state; | 190 | int state; |
| @@ -285,7 +285,6 @@ struct mlme_ext_info { · 94 unmodified lines | |||
| 285 | u8 bwmode_updated; | 285 | u8 bwmode_updated; |
| 286 | u8 hidden_ssid_mode; | 286 | u8 hidden_ssid_mode; |
| 287 | 287 | ||
| 288 | struct ADDBA_request ADDBA_req; | ||
| 289 | struct WMM_para_element WMM_param; | 288 | struct WMM_para_element WMM_param; |
| 290 | struct HT_caps_element HT_caps; | 289 | struct HT_caps_element HT_caps; |
| 291 | struct HT_info_element HT_info; | 290 | struct HT_info_element HT_info; |
| @@ -388,7 +387,7 @@ struct mlme_ext_priv { · 96 unmodified lines | |||
| 388 | void init_mlme_ext_priv(struct adapter *adapter); | 387 | void init_mlme_ext_priv(struct adapter *adapter); |
| 389 | int init_hw_mlme_ext(struct adapter *padapter); | 388 | int init_hw_mlme_ext(struct adapter *padapter); |
| 390 | void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); | 389 | void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); |
| 391 | extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); | 390 | struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); |
| 392 | 391 | ||
| 393 | unsigned char networktype_to_raid(unsigned char network_type); | 392 | unsigned char networktype_to_raid(unsigned char network_type); |
| 394 | u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len); | 393 | u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len); |
| @@ -432,9 +431,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, · 37 unmodified lines | |||
| 432 | u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork); | 431 | u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork); |
| 433 | u16 get_beacon_interval(struct wlan_bssid_ex *bss); | 432 | u16 get_beacon_interval(struct wlan_bssid_ex *bss); |
| 434 | 433 | ||
| 435 | int is_client_associated_to_ap(struct adapter *padapter); | 434 | bool r8188eu_is_client_associated_to_ap(struct adapter *padapter); |
| 436 | int is_client_associated_to_ibss(struct adapter *padapter); | 435 | bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter); |
| 437 | int is_IBSS_empty(struct adapter *padapter); | 436 | bool r8188eu_is_ibss_empty(struct adapter *padapter); |
| 438 | 437 | ||
| 439 | unsigned char check_assoc_AP(u8 *pframe, uint len); | 438 | unsigned char check_assoc_AP(u8 *pframe, uint len); |
| 440 | 439 | ||
| @@ -448,8 +447,7 @@ void HTOnAssocRsp(struct adapter *padapter); · 7 unmodified lines | |||
| 448 | void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE); | 447 | void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE); |
| 449 | void VCS_update(struct adapter *padapter, struct sta_info *psta); | 448 | void VCS_update(struct adapter *padapter, struct sta_info *psta); |
| 450 | 449 | ||
| 451 | void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len, | 450 | void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta); |
| 452 | struct sta_info *psta); | ||
| 453 | int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len); | 451 | int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len); |
| 454 | void update_IOT_info(struct adapter *padapter); | 452 | void update_IOT_info(struct adapter *padapter); |
| 455 | void update_capinfo(struct adapter *adapter, u16 updatecap); | 453 | void update_capinfo(struct adapter *adapter, u16 updatecap); |
| @@ -479,11 +477,11 @@ void report_survey_event(struct adapter *padapter, struct recv_frame *precv_fram · 23 unmodified lines | |||
| 479 | void report_surveydone_event(struct adapter *padapter); | 477 | void report_surveydone_event(struct adapter *padapter); |
| 480 | void report_del_sta_event(struct adapter *padapter, | 478 | void report_del_sta_event(struct adapter *padapter, |
| 481 | unsigned char *addr, unsigned short reason); | 479 | unsigned char *addr, unsigned short reason); |
| 482 | void report_add_sta_event(struct adapter *padapter, unsigned char* addr, | 480 | void report_add_sta_event(struct adapter *padapter, unsigned char *addr, |
| 483 | int cam_idx); | 481 | int cam_idx); |
| 484 | 482 | ||
| 485 | void beacon_timing_control(struct adapter *padapter); | 483 | void beacon_timing_control(struct adapter *padapter); |
| 486 | extern u8 set_tx_beacon_cmd(struct adapter*padapter); | 484 | u8 set_tx_beacon_cmd(struct adapter *padapter); |
| 487 | unsigned int setup_beacon_frame(struct adapter *padapter, | 485 | unsigned int setup_beacon_frame(struct adapter *padapter, |
| 488 | unsigned char *beacon_frame); | 486 | unsigned char *beacon_frame); |
| 489 | void update_mgnt_tx_rate(struct adapter *padapter, u8 rate); | 487 | void update_mgnt_tx_rate(struct adapter *padapter, u8 rate); |
| @@ -499,10 +497,10 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da); · 9 unmodified lines | |||
| 499 | void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid, | 497 | void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid, |
| 500 | u8 ussidlen, u8 *pdev_raddr); | 498 | u8 ussidlen, u8 *pdev_raddr); |
| 501 | void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr); | 499 | void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr); |
| 502 | void issue_probereq_p2p(struct adapter *padapter, u8 *da); | 500 | void issue_probereq_p2p(struct adapter *padapter); |
| 503 | void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, | 501 | void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, |
| 504 | u8 dialogToken, u8 success); | 502 | u8 dialogToken, u8 success); |
| 505 | void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr); | 503 | void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr); |
| 506 | void issue_beacon(struct adapter *padapter, int timeout_ms); | 504 | void issue_beacon(struct adapter *padapter, int timeout_ms); |
| 507 | void issue_probersp(struct adapter *padapter, unsigned char *da, | 505 | void issue_probersp(struct adapter *padapter, unsigned char *da, |
| 508 | u8 is_valid_p2p_probereq); | 506 | u8 is_valid_p2p_probereq); |
| @@ -513,8 +511,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, · 4 unmodified lines | |||
| 513 | unsigned short status); | 511 | unsigned short status); |
| 514 | void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, | 512 | void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, |
| 515 | u8 *da); | 513 | u8 *da); |
| 516 | s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, | 514 | void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); |
| 517 | u8* da, int try_cnt, int wait_ms); | ||
| 518 | int issue_nulldata(struct adapter *padapter, unsigned char *da, | 515 | int issue_nulldata(struct adapter *padapter, unsigned char *da, |
| 519 | unsigned int power_mode, int try_cnt, int wait_ms); | 516 | unsigned int power_mode, int try_cnt, int wait_ms); |
| 520 | int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, | 517 | int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, |
| @@ -523,7 +520,8 @@ int issue_deauth(struct adapter *padapter, unsigned char *da, · 2 unmodified lines | |||
| 523 | unsigned short reason); | 520 | unsigned short reason); |
| 524 | int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, | 521 | int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, |
| 525 | int try_cnt, int wait_ms); | 522 | int try_cnt, int wait_ms); |
| 526 | void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status); | 523 | void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, |
| 524 | u16 status, struct ieee80211_mgmt *mgmt_req); | ||
| 527 | unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr); | 525 | unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr); |
| 528 | unsigned int send_beacon(struct adapter *padapter); | 526 | unsigned int send_beacon(struct adapter *padapter); |
| 529 | bool get_beacon_valid_bit(struct adapter *adapter); | 527 | bool get_beacon_valid_bit(struct adapter *adapter); |
| @@ -536,34 +534,6 @@ void start_clnt_auth(struct adapter *padapter); · 6 unmodified lines | |||
| 536 | void start_clnt_join(struct adapter *padapter); | 534 | void start_clnt_join(struct adapter *padapter); |
| 537 | void start_create_ibss(struct adapter *padapter); | 535 | void start_create_ibss(struct adapter *padapter); |
| 538 | 536 | ||
| 539 | unsigned int OnAssocReq(struct adapter *padapter, | ||
| 540 | struct recv_frame *precv_frame); | ||
| 541 | unsigned int OnAssocRsp(struct adapter *padapter, | ||
| 542 | struct recv_frame *precv_frame); | ||
| 543 | unsigned int OnProbeReq(struct adapter *padapter, | ||
| 544 | struct recv_frame *precv_frame); | ||
| 545 | unsigned int OnProbeRsp(struct adapter *padapter, | ||
| 546 | struct recv_frame *precv_frame); | ||
| 547 | unsigned int OnBeacon(struct adapter *padapter, | ||
| 548 | struct recv_frame *precv_frame); | ||
| 549 | unsigned int OnDisassoc(struct adapter *padapter, | ||
| 550 | struct recv_frame *precv_frame); | ||
| 551 | unsigned int OnAuth(struct adapter *padapter, | ||
| 552 | struct recv_frame *precv_frame); | ||
| 553 | unsigned int OnAuthClient(struct adapter *padapter, | ||
| 554 | struct recv_frame *precv_frame); | ||
| 555 | unsigned int OnDeAuth(struct adapter *padapter, | ||
| 556 | struct recv_frame *precv_frame); | ||
| 557 | unsigned int OnAction(struct adapter *padapter, | ||
| 558 | struct recv_frame *precv_frame); | ||
| 559 | |||
| 560 | unsigned int OnAction_back(struct adapter *padapter, | ||
| 561 | struct recv_frame *precv_frame); | ||
| 562 | unsigned int on_action_public(struct adapter *padapter, | ||
| 563 | struct recv_frame *precv_frame); | ||
| 564 | unsigned int OnAction_p2p(struct adapter *padapter, | ||
| 565 | struct recv_frame *precv_frame); | ||
| 566 | |||
| 567 | void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res); | 537 | void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res); |
| 568 | void mlmeext_sta_del_event_callback(struct adapter *padapter); | 538 | void mlmeext_sta_del_event_callback(struct adapter *padapter); |
| 569 | void mlmeext_sta_add_event_callback(struct adapter *padapter, | 539 | void mlmeext_sta_add_event_callback(struct adapter *padapter, |
| @@ -729,7 +699,7 @@ enum rtw_c2h_event { · 159 unmodified lines | |||
| 729 | GEN_EVT_CODE(_Survey), /*8*/ | 699 | GEN_EVT_CODE(_Survey), /*8*/ |
| 730 | GEN_EVT_CODE(_SurveyDone), /*9*/ | 700 | GEN_EVT_CODE(_SurveyDone), /*9*/ |
| 731 | 701 | ||
| 732 | GEN_EVT_CODE(_JoinBss) , /*10*/ | 702 | GEN_EVT_CODE(_JoinBss), /*10*/ |
| 733 | GEN_EVT_CODE(_AddSTA), | 703 | GEN_EVT_CODE(_AddSTA), |
| 734 | GEN_EVT_CODE(_DelSTA), | 704 | GEN_EVT_CODE(_DelSTA), |
| 735 | GEN_EVT_CODE(_AtimDone), | 705 | GEN_EVT_CODE(_AtimDone), |
| @@ -92,7 +92,7 @@ struct rx_pkt_attrib { · 91 unmodified lines | |||
| 92 | u8 privacy; /* in frame_ctrl field */ | 92 | u8 privacy; /* in frame_ctrl field */ |
| 93 | u8 bdecrypted; | 93 | u8 bdecrypted; |
| 94 | u8 encrypt; /* when 0 indicate no encrypt. when non-zero, | 94 | u8 encrypt; /* when 0 indicate no encrypt. when non-zero, |
| 95 | * indicate the encrypt algorith */ | 95 | * indicate the encrypt algorithm */ |
| 96 | u8 iv_len; | 96 | u8 iv_len; |
| 97 | u8 icv_len; | 97 | u8 icv_len; |
| 98 | u8 crc_err; | 98 | u8 crc_err; |
| @@ -175,7 +175,7 @@ struct recv_priv { · 76 unmodified lines | |||
| 175 | u8 *precv_buf; /* 4 alignment */ | 175 | u8 *precv_buf; /* 4 alignment */ |
| 176 | struct __queue free_recv_buf_queue; | 176 | struct __queue free_recv_buf_queue; |
| 177 | u32 free_recv_buf_queue_cnt; | 177 | u32 free_recv_buf_queue_cnt; |
| 178 | /* For display the phy informatiom */ | 178 | /* For display the phy information */ |
| 179 | u8 is_signal_dbg; /* for debug */ | 179 | u8 is_signal_dbg; /* for debug */ |
| 180 | u8 signal_strength_dbg; /* for debug */ | 180 | u8 signal_strength_dbg; /* for debug */ |
| 181 | s8 rssi; | 181 | s8 rssi; |
| @@ -116,7 +116,7 @@ struct pkt_attrib { · 115 unmodified lines | |||
| 116 | u32 last_txcmdsz; | 116 | u32 last_txcmdsz; |
| 117 | u8 nr_frags; | 117 | u8 nr_frags; |
| 118 | u8 encrypt; /* when 0 indicate no encrypt. when non-zero, | 118 | u8 encrypt; /* when 0 indicate no encrypt. when non-zero, |
| 119 | * indicate the encrypt algorith */ | 119 | * indicate the encrypt algorithm */ |
| 120 | u8 iv_len; | 120 | u8 iv_len; |
| 121 | u8 icv_len; | 121 | u8 icv_len; |
| 122 | u8 iv[18]; | 122 | u8 iv[18]; |
| @@ -351,7 +351,7 @@ s32 rtw_txframes_pending(struct adapter *padapter); · 228 unmodified lines | |||
| 351 | s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, | 351 | s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, |
| 352 | struct pkt_attrib *pattrib); | 352 | struct pkt_attrib *pattrib); |
| 353 | void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry); | 353 | void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry); |
| 354 | s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); | 354 | int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); |
| 355 | void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); | 355 | void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); |
| 356 | int rtw_alloc_hwxmits(struct adapter *padapter); | 356 | int rtw_alloc_hwxmits(struct adapter *padapter); |
| 357 | void rtw_free_hwxmits(struct adapter *padapter); | 357 | void rtw_free_hwxmits(struct adapter *padapter); |
| @@ -295,19 +295,19 @@ static inline u32 wifi_mac_hash(u8 *mac) · 294 unmodified lines | |||
| 295 | return x; | 295 | return x; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | extern u32 _rtw_init_sta_priv(struct sta_priv *pstapriv); | 298 | int _rtw_init_sta_priv(struct sta_priv *pstapriv); |
| 299 | extern void _rtw_free_sta_priv(struct sta_priv *pstapriv); | 299 | void _rtw_free_sta_priv(struct sta_priv *pstapriv); |
| 300 | 300 | ||
| 301 | #define stainfo_offset_valid(offset) (offset < NUM_STA && offset >= 0) | 301 | #define stainfo_offset_valid(offset) (offset < NUM_STA && offset >= 0) |
| 302 | int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta); | 302 | int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta); |
| 303 | struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int off); | 303 | struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int off); |
| 304 | 304 | ||
| 305 | extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr); | 305 | struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr); |
| 306 | extern u32 rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta); | 306 | void rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta); |
| 307 | extern void rtw_free_all_stainfo(struct adapter *adapt); | 307 | void rtw_free_all_stainfo(struct adapter *adapt); |
| 308 | extern struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr); | 308 | struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr); |
| 309 | extern u32 rtw_init_bcmc_stainfo(struct adapter *adapt); | 309 | u32 rtw_init_bcmc_stainfo(struct adapter *adapt); |
| 310 | extern struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter); | 310 | struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter); |
| 311 | extern u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr); | 311 | u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr); |
| 312 | 312 | ||
| 313 | #endif /* _STA_INFO_H_ */ | 313 | #endif /* _STA_INFO_H_ */ |
| @@ -140,7 +140,6 @@ enum WIFI_REG_DOMAIN { · 139 unmodified lines | |||
| 140 | #define _PWRMGT_ BIT(12) | 140 | #define _PWRMGT_ BIT(12) |
| 141 | #define _MORE_DATA_ BIT(13) | 141 | #define _MORE_DATA_ BIT(13) |
| 142 | #define _PRIVACY_ BIT(14) | 142 | #define _PRIVACY_ BIT(14) |
| 143 | #define _ORDER_ BIT(15) | ||
| 144 | 143 | ||
| 145 | #define SetToDs(pbuf) \ | 144 | #define SetToDs(pbuf) \ |
| 146 | *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_) | 145 | *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_) |
| @@ -171,9 +170,6 @@ enum WIFI_REG_DOMAIN { · 24 unmodified lines | |||
| 171 | #define SetPrivacy(pbuf) \ | 170 | #define SetPrivacy(pbuf) \ |
| 172 | *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_) | 171 | *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_) |
| 173 | 172 | ||
| 174 | #define GetPrivacy(pbuf) \ | ||
| 175 | (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0) | ||
| 176 | |||
| 177 | #define GetFrameType(pbuf) \ | 173 | #define GetFrameType(pbuf) \ |
| 178 | (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2))) | 174 | (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2))) |
| 179 | 175 | ||
| @@ -187,17 +183,6 @@ enum WIFI_REG_DOMAIN { · 7 unmodified lines | |||
| 187 | *(__le16 *)(pbuf) |= cpu_to_le16(type); \ | 183 | *(__le16 *)(pbuf) |= cpu_to_le16(type); \ |
| 188 | } while (0) | 184 | } while (0) |
| 189 | 185 | ||
| 190 | #define GetTupleCache(pbuf) \ | ||
| 191 | (cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22))) | ||
| 192 | |||
| 193 | #define SetFragNum(pbuf, num) \ | ||
| 194 | do { \ | ||
| 195 | *(unsigned short *)((size_t)(pbuf) + 22) = \ | ||
| 196 | ((*(unsigned short *)((size_t)(pbuf) + 22)) & \ | ||
| 197 | le16_to_cpu(~(0x000f))) | \ | ||
| 198 | cpu_to_le16(0x0f & (num)); \ | ||
| 199 | } while (0) | ||
| 200 | |||
| 201 | #define SetSeqNum(pbuf, num) \ | 186 | #define SetSeqNum(pbuf, num) \ |
| 202 | do { \ | 187 | do { \ |
| 203 | *(__le16 *)((size_t)(pbuf) + 22) = \ | 188 | *(__le16 *)((size_t)(pbuf) + 22) = \ |
| @@ -221,13 +206,6 @@ enum WIFI_REG_DOMAIN { · 17 unmodified lines | |||
| 221 | 206 | ||
| 222 | #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1) | 207 | #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1) |
| 223 | 208 | ||
| 224 | #define SetAMsdu(pbuf, amsdu) \ | ||
| 225 | *(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7) | ||
| 226 | |||
| 227 | #define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + \ | ||
| 228 | (((GetToDs(pbuf)<<1) | GetFrDs(pbuf)) == 3 ? \ | ||
| 229 | 30 : 24))) & 0x000f) | ||
| 230 | |||
| 231 | #define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4)) | 209 | #define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4)) |
| 232 | 210 | ||
| 233 | #define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10)) | 211 | #define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10)) |
| @@ -236,33 +214,6 @@ enum WIFI_REG_DOMAIN { · 2 unmodified lines | |||
| 236 | 214 | ||
| 237 | #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) | 215 | #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) |
| 238 | 216 | ||
| 239 | static inline bool IS_MCAST(unsigned char *da) | ||
| 240 | { | ||
| 241 | return (*da) & 0x01; | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline unsigned char *get_da(unsigned char *pframe) | ||
| 245 | { | ||
| 246 | unsigned char *da; | ||
| 247 | unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); | ||
| 248 | |||
| 249 | switch (to_fr_ds) { | ||
| 250 | case 0x00: /* ToDs=0, FromDs=0 */ | ||
| 251 | da = GetAddr1Ptr(pframe); | ||
| 252 | break; | ||
| 253 | case 0x01: /* ToDs=0, FromDs=1 */ | ||
| 254 | da = GetAddr1Ptr(pframe); | ||
| 255 | break; | ||
| 256 | case 0x02: /* ToDs=1, FromDs=0 */ | ||
| 257 | da = GetAddr3Ptr(pframe); | ||
| 258 | break; | ||
| 259 | default: /* ToDs=1, FromDs=1 */ | ||
| 260 | da = GetAddr3Ptr(pframe); | ||
| 261 | break; | ||
| 262 | } | ||
| 263 | return da; | ||
| 264 | } | ||
| 265 | |||
| 266 | static inline unsigned char *get_sa(unsigned char *pframe) | 217 | static inline unsigned char *get_sa(unsigned char *pframe) |
| 267 | { | 218 | { |
| 268 | unsigned char *sa; | 219 | unsigned char *sa; |
| @@ -415,14 +366,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe) · 146 unmodified lines | |||
| 415 | Below is the definition for 802.11n | 366 | Below is the definition for 802.11n |
| 416 | ------------------------------------------------------------------------------*/ | 367 | ------------------------------------------------------------------------------*/ |
| 417 | 368 | ||
| 418 | #define SetOrderBit(pbuf) \ | ||
| 419 | do { \ | ||
| 420 | *(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ | ||
| 421 | } while (0) | ||
| 422 | |||
| 423 | #define GetOrderBit(pbuf) \ | ||
| 424 | (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) | ||
| 425 | |||
| 426 | /** | 369 | /** |
| 427 | * struct rtw_ieee80211_bar - HT Block Ack Request | 370 | * struct rtw_ieee80211_bar - HT Block Ack Request |
| 428 | * | 371 | * |
| @@ -484,14 +427,6 @@ struct WMM_para_element { · 55 unmodified lines | |||
| 484 | struct AC_param ac_param[4]; | 427 | struct AC_param ac_param[4]; |
| 485 | } __packed; | 428 | } __packed; |
| 486 | 429 | ||
| 487 | struct ADDBA_request { | ||
| 488 | unsigned char action_code; | ||
| 489 | unsigned char dialog_token; | ||
| 490 | __le16 BA_para_set; | ||
| 491 | __le16 BA_timeout_value; | ||
| 492 | __le16 BA_starting_seqctrl; | ||
| 493 | } __packed; | ||
| 494 | |||
| 495 | #define MAX_AMPDU_FACTOR_64K 3 | 430 | #define MAX_AMPDU_FACTOR_64K 3 |
| 496 | 431 | ||
| 497 | /* Spatial Multiplexing Power Save Modes */ | 432 | /* Spatial Multiplexing Power Save Modes */ |
| @@ -701,7 +636,7 @@ struct ADDBA_request { · 203 unmodified lines | |||
| 701 | 636 | ||
| 702 | #define P2P_WILDCARD_SSID_LEN 7 | 637 | #define P2P_WILDCARD_SSID_LEN 7 |
| 703 | 638 | ||
| 704 | /* default value, used when: (1)p2p disabed or (2)p2p enabled | 639 | /* default value, used when: (1)p2p disabled or (2)p2p enabled |
| 705 | * but only do 1 scan phase */ | 640 | * but only do 1 scan phase */ |
| 706 | #define P2P_FINDPHASE_EX_NONE 0 | 641 | #define P2P_FINDPHASE_EX_NONE 0 |
| 707 | /* used when p2p enabled and want to do 1 scan phase and | 642 | /* used when p2p enabled and want to do 1 scan phase and |
| @@ -766,11 +701,11 @@ enum P2P_STATE { · 58 unmodified lines | |||
| 766 | P2P_STATE_TX_PROVISION_DIS_REQ = 6, | 701 | P2P_STATE_TX_PROVISION_DIS_REQ = 6, |
| 767 | P2P_STATE_RX_PROVISION_DIS_RSP = 7, | 702 | P2P_STATE_RX_PROVISION_DIS_RSP = 7, |
| 768 | P2P_STATE_RX_PROVISION_DIS_REQ = 8, | 703 | P2P_STATE_RX_PROVISION_DIS_REQ = 8, |
| 769 | /* Doing the group owner negoitation handshake */ | 704 | /* Doing the group owner negotiation handshake */ |
| 770 | P2P_STATE_GONEGO_ING = 9, | 705 | P2P_STATE_GONEGO_ING = 9, |
| 771 | /* finish the group negoitation handshake with success */ | 706 | /* finish the group negotiation handshake with success */ |
| 772 | P2P_STATE_GONEGO_OK = 10, | 707 | P2P_STATE_GONEGO_OK = 10, |
| 773 | /* finish the group negoitation handshake with failure */ | 708 | /* finish the group negotiation handshake with failure */ |
| 774 | P2P_STATE_GONEGO_FAIL = 11, | 709 | P2P_STATE_GONEGO_FAIL = 11, |
| 775 | /* receiving the P2P Inviation request and match with the profile. */ | 710 | /* receiving the P2P Inviation request and match with the profile. */ |
| 776 | P2P_STATE_RECV_INVITE_REQ_MATCH = 12, | 711 | P2P_STATE_RECV_INVITE_REQ_MATCH = 12, |
| @@ -790,9 +725,9 @@ enum P2P_STATE { · 13 unmodified lines | |||
| 790 | P2P_STATE_RECV_INVITE_REQ_JOIN = 19, | 725 | P2P_STATE_RECV_INVITE_REQ_JOIN = 19, |
| 791 | /* recveing the P2P Inviation response with failure */ | 726 | /* recveing the P2P Inviation response with failure */ |
| 792 | P2P_STATE_RX_INVITE_RESP_FAIL = 20, | 727 | P2P_STATE_RX_INVITE_RESP_FAIL = 20, |
| 793 | /* receiving p2p negoitation response with information is not available */ | 728 | /* receiving p2p negotiation response with information is not available */ |
| 794 | P2P_STATE_RX_INFOR_NOREADY = 21, | 729 | P2P_STATE_RX_INFOR_NOREADY = 21, |
| 795 | /* sending p2p negoitation response with information is not available */ | 730 | /* sending p2p negotiation response with information is not available */ |
| 796 | P2P_STATE_TX_INFOR_NOREADY = 22, | 731 | P2P_STATE_TX_INFOR_NOREADY = 22, |
| 797 | }; | 732 | }; |
| 798 | 733 | ||
| @@ -17,14 +17,6 @@ struct ndis_802_11_ssid { · 16 unmodified lines | |||
| 17 | u8 Ssid[32]; | 17 | u8 Ssid[32]; |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | enum NDIS_802_11_NETWORK_TYPE { | ||
| 21 | Ndis802_11FH, | ||
| 22 | Ndis802_11DS, | ||
| 23 | Ndis802_11OFDM5, | ||
| 24 | Ndis802_11OFDM24, | ||
| 25 | Ndis802_11NetworkTypeMax /* dummy upper bound */ | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct ndis_802_11_config_fh { | 20 | struct ndis_802_11_config_fh { |
| 29 | u32 Length; /* Length of structure */ | 21 | u32 Length; /* Length of structure */ |
| 30 | u32 HopPattern; /* As defined by 802.11, MSB set */ | 22 | u32 HopPattern; /* As defined by 802.11, MSB set */ |
| @@ -185,20 +177,6 @@ struct ndis_802_11_status_ind { · 154 unmodified lines | |||
| 185 | /* MIC check time, 60 seconds. */ | 177 | /* MIC check time, 60 seconds. */ |
| 186 | #define MIC_CHECK_TIME 60000000 | 178 | #define MIC_CHECK_TIME 60000000 |
| 187 | 179 | ||
| 188 | struct ndis_802_11_auth_evt { | ||
| 189 | struct ndis_802_11_status_ind Status; | ||
| 190 | struct ndis_802_11_auth_req Request[1]; | ||
| 191 | }; | ||
| 192 | |||
| 193 | struct ndis_802_11_test { | ||
| 194 | u32 Length; | ||
| 195 | u32 Type; | ||
| 196 | union { | ||
| 197 | struct ndis_802_11_auth_evt AuthenticationEvent; | ||
| 198 | NDIS_802_11_RSSI RssiTrigger; | ||
| 199 | } tt; | ||
| 200 | }; | ||
| 201 | |||
| 202 | #ifndef Ndis802_11APMode | 180 | #ifndef Ndis802_11APMode |
| 203 | #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) | 181 | #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) |
| 204 | #endif | 182 | #endif |
| @@ -233,7 +211,6 @@ struct wlan_bssid_ex { · 28 unmodified lines | |||
| 233 | struct ndis_802_11_ssid Ssid; | 211 | struct ndis_802_11_ssid Ssid; |
| 234 | u32 Privacy; | 212 | u32 Privacy; |
| 235 | NDIS_802_11_RSSI Rssi;/* in dBM,raw data ,get from PHY) */ | 213 | NDIS_802_11_RSSI Rssi;/* in dBM,raw data ,get from PHY) */ |
| 236 | enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; | ||
| 237 | struct ndis_802_11_config Configuration; | 214 | struct ndis_802_11_config Configuration; |
| 238 | enum ndis_802_11_network_infra InfrastructureMode; | 215 | enum ndis_802_11_network_infra InfrastructureMode; |
| 239 | unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; | 216 | unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; |
| @@ -288,34 +265,6 @@ enum UAPSD_MAX_SP { · 48 unmodified lines | |||
| 288 | #define NUM_PRE_AUTH_KEY 16 | 265 | #define NUM_PRE_AUTH_KEY 16 |
| 289 | #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY | 266 | #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY |
| 290 | 267 | ||
| 291 | /* | ||
| 292 | * WPA2 | ||
| 293 | */ | ||
| 294 | |||
| 295 | struct pmkid_candidate { | ||
| 296 | unsigned char BSSID[ETH_ALEN]; | ||
| 297 | u32 Flags; | ||
| 298 | }; | ||
| 299 | |||
| 300 | struct ndis_802_11_pmkid_list { | ||
| 301 | u32 Version; /* Version of the structure */ | ||
| 302 | u32 NumCandidates; /* No. of pmkid candidates */ | ||
| 303 | struct pmkid_candidate CandidateList[1]; | ||
| 304 | }; | ||
| 305 | |||
| 306 | struct ndis_802_11_auth_encrypt { | ||
| 307 | enum ndis_802_11_auth_mode AuthModeSupported; | ||
| 308 | enum ndis_802_11_wep_status EncryptStatusSupported; | ||
| 309 | }; | ||
| 310 | |||
| 311 | struct ndis_802_11_cap { | ||
| 312 | u32 Length; | ||
| 313 | u32 Version; | ||
| 314 | u32 NoOfPMKIDs; | ||
| 315 | u32 NoOfAuthEncryptPairsSupported; | ||
| 316 | struct ndis_802_11_auth_encrypt AuthenticationEncryptionSupported[1]; | ||
| 317 | }; | ||
| 318 | |||
| 319 | u8 key_2char2num(u8 hch, u8 lch); | 268 | u8 key_2char2num(u8 hch, u8 lch); |
| 320 | u8 key_char2num(u8 ch); | 269 | u8 key_char2num(u8 ch); |
| 321 | u8 str_2char2num(u8 hch, u8 lch); | 270 | u8 str_2char2num(u8 hch, u8 lch); |
| @@ -1011,7 +1011,6 @@ static int rtw_wx_set_mlme(struct net_device *dev, · 1010 unmodified lines | |||
| 1011 | struct iw_request_info *info, | 1011 | struct iw_request_info *info, |
| 1012 | union iwreq_data *wrqu, char *extra) | 1012 | union iwreq_data *wrqu, char *extra) |
| 1013 | { | 1013 | { |
| 1014 | int ret = 0; | ||
| 1015 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); | 1014 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); |
| 1016 | struct iw_mlme *mlme = (struct iw_mlme *)extra; | 1015 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
| 1017 | 1016 | ||
| @@ -1020,17 +1019,15 @@ static int rtw_wx_set_mlme(struct net_device *dev, · 2 unmodified lines | |||
| 1020 | 1019 | ||
| 1021 | switch (mlme->cmd) { | 1020 | switch (mlme->cmd) { |
| 1022 | case IW_MLME_DEAUTH: | 1021 | case IW_MLME_DEAUTH: |
| 1023 | if (!rtw_set_802_11_disassociate(padapter)) | 1022 | rtw_set_802_11_disassociate(padapter); |
| 1024 | ret = -1; | ||
| 1025 | break; | 1023 | break; |
| 1026 | case IW_MLME_DISASSOC: | 1024 | case IW_MLME_DISASSOC: |
| 1027 | if (!rtw_set_802_11_disassociate(padapter)) | 1025 | rtw_set_802_11_disassociate(padapter); |
| 1028 | ret = -1; | ||
| 1029 | break; | 1026 | break; |
| 1030 | default: | 1027 | default: |
| 1031 | return -EOPNOTSUPP; | 1028 | return -EOPNOTSUPP; |
| 1032 | } | 1029 | } |
| 1033 | return ret; | 1030 | return 0; |
| 1034 | } | 1031 | } |
| 1035 | 1032 | ||
| 1036 | static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, | 1033 | static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, |
| @@ -1340,7 +1337,7 @@ static int rtw_wx_set_rate(struct net_device *dev, · 303 unmodified lines | |||
| 1340 | struct iw_request_info *a, | 1337 | struct iw_request_info *a, |
| 1341 | union iwreq_data *wrqu, char *extra) | 1338 | union iwreq_data *wrqu, char *extra) |
| 1342 | { | 1339 | { |
| 1343 | int i, ret = 0; | 1340 | int i; |
| 1344 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); | 1341 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); |
| 1345 | u8 datarates[NumRates]; | 1342 | u8 datarates[NumRates]; |
| 1346 | u32 target_rate = wrqu->bitrate.value; | 1343 | u32 target_rate = wrqu->bitrate.value; |
| @@ -1408,10 +1405,7 @@ set_rate: · 61 unmodified lines | |||
| 1408 | } | 1405 | } |
| 1409 | } | 1406 | } |
| 1410 | 1407 | ||
| 1411 | if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS) | 1408 | return rtw_setdatarate_cmd(padapter, datarates); |
| 1412 | ret = -1; | ||
| 1413 | |||
| 1414 | return ret; | ||
| 1415 | } | 1409 | } |
| 1416 | 1410 | ||
| 1417 | static int rtw_wx_get_rate(struct net_device *dev, | 1411 | static int rtw_wx_get_rate(struct net_device *dev, |
| @@ -2647,7 +2641,7 @@ static int rtw_p2p_connect(struct net_device *dev, · 1229 unmodified lines | |||
| 2647 | u32 peer_channel = 0; | 2641 | u32 peer_channel = 0; |
| 2648 | 2642 | ||
| 2649 | /* Commented by Albert 20110304 */ | 2643 | /* Commented by Albert 20110304 */ |
| 2650 | /* The input data contains two informations. */ | 2644 | /* The input data contains two information. */ |
| 2651 | /* 1. First information is the MAC address which wants to formate with */ | 2645 | /* 1. First information is the MAC address which wants to formate with */ |
| 2652 | /* 2. Second information is the WPS PINCode or "pbc" string for push button method */ | 2646 | /* 2. Second information is the WPS PINCode or "pbc" string for push button method */ |
| 2653 | /* Format: 00:E0:4C:00:00:05 */ | 2647 | /* Format: 00:E0:4C:00:00:05 */ |
| @@ -2721,7 +2715,7 @@ static void rtw_p2p_invite_req(struct net_device *dev, · 67 unmodified lines | |||
| 2721 | uint p2pielen = 0, attr_contentlen = 0; | 2715 | uint p2pielen = 0, attr_contentlen = 0; |
| 2722 | struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info; | 2716 | struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info; |
| 2723 | 2717 | ||
| 2724 | /* The input data contains two informations. */ | 2718 | /* The input data contains two information items. */ |
| 2725 | /* 1. First information is the P2P device address which you want to send to. */ | 2719 | /* 1. First information is the P2P device address which you want to send to. */ |
| 2726 | /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */ | 2720 | /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */ |
| 2727 | /* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */ | 2721 | /* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */ |
| @@ -2845,7 +2839,7 @@ static void rtw_p2p_prov_disc(struct net_device *dev, · 117 unmodified lines | |||
| 2845 | u8 *p2pie; | 2839 | u8 *p2pie; |
| 2846 | uint p2pielen = 0, attr_contentlen = 0; | 2840 | uint p2pielen = 0, attr_contentlen = 0; |
| 2847 | 2841 | ||
| 2848 | /* The input data contains two informations. */ | 2842 | /* The input data contains two information items. */ |
| 2849 | /* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */ | 2843 | /* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */ |
| 2850 | /* 2. Second information is the WPS configuration method which wants to discovery */ | 2844 | /* 2. Second information is the WPS configuration method which wants to discovery */ |
| 2851 | /* Format: 00:E0:4C:00:00:05_display */ | 2845 | /* Format: 00:E0:4C:00:00:05_display */ |
| @@ -2979,8 +2973,6 @@ static int rtw_p2p_set(struct net_device *dev, · 127 unmodified lines | |||
| 2979 | struct iw_request_info *info, | 2973 | struct iw_request_info *info, |
| 2980 | union iwreq_data *wrqu, char *extra) | 2974 | union iwreq_data *wrqu, char *extra) |
| 2981 | { | 2975 | { |
| 2982 | int ret = 0; | ||
| 2983 | |||
| 2984 | if (!memcmp(extra, "enable =", 7)) { | 2976 | if (!memcmp(extra, "enable =", 7)) { |
| 2985 | rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); | 2977 | rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); |
| 2986 | } else if (!memcmp(extra, "setDN =", 6)) { | 2978 | } else if (!memcmp(extra, "setDN =", 6)) { |
| @@ -3027,7 +3019,7 @@ static int rtw_p2p_set(struct net_device *dev, · 40 unmodified lines | |||
| 3027 | rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); | 3019 | rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); |
| 3028 | } | 3020 | } |
| 3029 | 3021 | ||
| 3030 | return ret; | 3022 | return 0; |
| 3031 | } | 3023 | } |
| 3032 | 3024 | ||
| 3033 | static int rtw_p2p_get2(struct net_device *dev, | 3025 | static int rtw_p2p_get2(struct net_device *dev, |
| @@ -3568,7 +3560,7 @@ static int rtw_wx_set_priv(struct net_device *dev, · 534 unmodified lines | |||
| 3568 | 3560 | ||
| 3569 | if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && | 3561 | if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && |
| 3570 | (!memcmp(&probereq_wpsie[2], wps_oui, 4))) { | 3562 | (!memcmp(&probereq_wpsie[2], wps_oui, 4))) { |
| 3571 | cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; | 3563 | cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN); |
| 3572 | 3564 | ||
| 3573 | pmlmepriv->wps_probe_req_ie_len = 0; | 3565 | pmlmepriv->wps_probe_req_ie_len = 0; |
| 3574 | kfree(pmlmepriv->wps_probe_req_ie); | 3566 | kfree(pmlmepriv->wps_probe_req_ie); |
| @@ -363,18 +363,16 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter) · 362 unmodified lines | |||
| 363 | return pnetdev; | 363 | return pnetdev; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | u32 rtw_start_drv_threads(struct adapter *padapter) | 366 | int rtw_start_drv_threads(struct adapter *padapter) |
| 367 | { | 367 | { |
| 368 | u32 _status = _SUCCESS; | ||
| 369 | |||
| 370 | padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD"); | 368 | padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD"); |
| 371 | if (IS_ERR(padapter->cmdThread)) | 369 | if (IS_ERR(padapter->cmdThread)) |
| 372 | _status = _FAIL; | 370 | return PTR_ERR(padapter->cmdThread); |
| 373 | else | ||
| 374 | /* wait for rtw_cmd_thread() to start running */ | ||
| 375 | wait_for_completion(&padapter->cmdpriv.start_cmd_thread); | ||
| 376 | 371 | ||
| 377 | return _status; | 372 | /* wait for rtw_cmd_thread() to start running */ |
| 373 | wait_for_completion(&padapter->cmdpriv.start_cmd_thread); | ||
| 374 | |||
| 375 | return 0; | ||
| 378 | } | 376 | } |
| 379 | 377 | ||
| 380 | void rtw_stop_drv_threads(struct adapter *padapter) | 378 | void rtw_stop_drv_threads(struct adapter *padapter) |
| @@ -407,7 +405,7 @@ static void rtw_init_default_value(struct adapter *padapter) · 26 unmodified lines | |||
| 407 | pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */ | 405 | pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */ |
| 408 | 406 | ||
| 409 | /* security_priv */ | 407 | /* security_priv */ |
| 410 | psecuritypriv->binstallGrpkey = _FAIL; | 408 | psecuritypriv->binstallGrpkey = false; |
| 411 | psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; | 409 | psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; |
| 412 | psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt; | 410 | psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt; |
| 413 | psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */ | 411 | psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */ |
| @@ -433,7 +431,7 @@ static void rtw_init_default_value(struct adapter *padapter) · 19 unmodified lines | |||
| 433 | padapter->bShowGetP2PState = 1; | 431 | padapter->bShowGetP2PState = 1; |
| 434 | } | 432 | } |
| 435 | 433 | ||
| 436 | u8 rtw_reset_drv_sw(struct adapter *padapter) | 434 | void rtw_reset_drv_sw(struct adapter *padapter) |
| 437 | { | 435 | { |
| 438 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 436 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 439 | 437 | ||
| @@ -455,25 +453,23 @@ u8 rtw_reset_drv_sw(struct adapter *padapter) · 15 unmodified lines | |||
| 455 | padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE; | 453 | padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE; |
| 456 | 454 | ||
| 457 | rtw_set_signal_stat_timer(&padapter->recvpriv); | 455 | rtw_set_signal_stat_timer(&padapter->recvpriv); |
| 458 | |||
| 459 | return _SUCCESS; | ||
| 460 | } | 456 | } |
| 461 | 457 | ||
| 462 | u8 rtw_init_drv_sw(struct adapter *padapter) | 458 | u8 rtw_init_drv_sw(struct adapter *padapter) |
| 463 | { | 459 | { |
| 464 | if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) { | 460 | if (rtw_init_cmd_priv(&padapter->cmdpriv)) { |
| 465 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_cmd_priv failed\n"); | 461 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_cmd_priv failed\n"); |
| 466 | return _FAIL; | 462 | return _FAIL; |
| 467 | } | 463 | } |
| 468 | 464 | ||
| 469 | padapter->cmdpriv.padapter = padapter; | 465 | padapter->cmdpriv.padapter = padapter; |
| 470 | 466 | ||
| 471 | if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) { | 467 | if (rtw_init_evt_priv(&padapter->evtpriv)) { |
| 472 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_evt_priv failed\n"); | 468 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_evt_priv failed\n"); |
| 473 | goto free_cmd_priv; | 469 | goto free_cmd_priv; |
| 474 | } | 470 | } |
| 475 | 471 | ||
| 476 | if (rtw_init_mlme_priv(padapter) == _FAIL) { | 472 | if (rtw_init_mlme_priv(padapter)) { |
| 477 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_mlme_priv failed\n"); | 473 | dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_mlme_priv failed\n"); |
| 478 | goto free_evt_priv; | 474 | goto free_evt_priv; |
| 479 | } | 475 | } |
| @@ -484,7 +480,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) · 4 unmodified lines | |||
| 484 | 480 | ||
| 485 | init_mlme_ext_priv(padapter); | 481 | init_mlme_ext_priv(padapter); |
| 486 | 482 | ||
| 487 | if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) { | 483 | if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter)) { |
| 488 | dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n"); | 484 | dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n"); |
| 489 | goto free_mlme_ext; | 485 | goto free_mlme_ext; |
| 490 | } | 486 | } |
| @@ -494,7 +490,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) · 3 unmodified lines | |||
| 494 | goto free_xmit_priv; | 490 | goto free_xmit_priv; |
| 495 | } | 491 | } |
| 496 | 492 | ||
| 497 | if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) { | 493 | if (_rtw_init_sta_priv(&padapter->stapriv)) { |
| 498 | dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_sta_priv failed\n"); | 494 | dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_sta_priv failed\n"); |
| 499 | goto free_recv_priv; | 495 | goto free_recv_priv; |
| 500 | } | 496 | } |
| @@ -550,7 +546,7 @@ void rtw_cancel_all_timer(struct adapter *padapter) · 49 unmodified lines | |||
| 550 | _cancel_timer_ex(&padapter->recvpriv.signal_stat_timer); | 546 | _cancel_timer_ex(&padapter->recvpriv.signal_stat_timer); |
| 551 | } | 547 | } |
| 552 | 548 | ||
| 553 | u8 rtw_free_drv_sw(struct adapter *padapter) | 549 | void rtw_free_drv_sw(struct adapter *padapter) |
| 554 | { | 550 | { |
| 555 | /* we can call rtw_p2p_enable here, but: */ | 551 | /* we can call rtw_p2p_enable here, but: */ |
| 556 | /* 1. rtw_p2p_enable may have IO operation */ | 552 | /* 1. rtw_p2p_enable may have IO operation */ |
| @@ -587,8 +583,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter) · 30 unmodified lines | |||
| 587 | /* clear pbuddystruct adapter to avoid access wrong pointer. */ | 583 | /* clear pbuddystruct adapter to avoid access wrong pointer. */ |
| 588 | if (padapter->pbuddy_adapter) | 584 | if (padapter->pbuddy_adapter) |
| 589 | padapter->pbuddy_adapter->pbuddy_adapter = NULL; | 585 | padapter->pbuddy_adapter->pbuddy_adapter = NULL; |
| 590 | |||
| 591 | return _SUCCESS; | ||
| 592 | } | 586 | } |
| 593 | 587 | ||
| 594 | void netdev_br_init(struct net_device *netdev) | 588 | void netdev_br_init(struct net_device *netdev) |
| @@ -624,7 +618,6 @@ static int _netdev_open(struct net_device *pnetdev) · 29 unmodified lines | |||
| 624 | if (!padapter->bup) { | 618 | if (!padapter->bup) { |
| 625 | padapter->bDriverStopped = false; | 619 | padapter->bDriverStopped = false; |
| 626 | padapter->bSurpriseRemoved = false; | 620 | padapter->bSurpriseRemoved = false; |
| 627 | padapter->bCardDisableWOHSM = false; | ||
| 628 | 621 | ||
| 629 | status = rtw_hal_init(padapter); | 622 | status = rtw_hal_init(padapter); |
| 630 | if (status == _FAIL) | 623 | if (status == _FAIL) |
| @@ -632,8 +625,7 @@ static int _netdev_open(struct net_device *pnetdev) · 1 unmodified line | |||
| 632 | 625 | ||
| 633 | netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr); | 626 | netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr); |
| 634 | 627 | ||
| 635 | status = rtw_start_drv_threads(padapter); | 628 | if (rtw_start_drv_threads(padapter)) { |
| 636 | if (status == _FAIL) { | ||
| 637 | pr_info("Initialize driver software resource Failed!\n"); | 629 | pr_info("Initialize driver software resource Failed!\n"); |
| 638 | goto netdev_open_error; | 630 | goto netdev_open_error; |
| 639 | } | 631 | } |
| @@ -690,7 +682,6 @@ static int ips_netdrv_open(struct adapter *padapter) · 50 unmodified lines | |||
| 690 | 682 | ||
| 691 | padapter->bDriverStopped = false; | 683 | padapter->bDriverStopped = false; |
| 692 | padapter->bSurpriseRemoved = false; | 684 | padapter->bSurpriseRemoved = false; |
| 693 | padapter->bCardDisableWOHSM = false; | ||
| 694 | 685 | ||
| 695 | status = rtw_hal_init(padapter); | 686 | status = rtw_hal_init(padapter); |
| 696 | if (status == _FAIL) | 687 | if (status == _FAIL) |
| @@ -722,13 +713,11 @@ int rtw_ips_pwr_up(struct adapter *padapter) · 25 unmodified lines | |||
| 722 | 713 | ||
| 723 | void rtw_ips_pwr_down(struct adapter *padapter) | 714 | void rtw_ips_pwr_down(struct adapter *padapter) |
| 724 | { | 715 | { |
| 725 | padapter->bCardDisableWOHSM = true; | ||
| 726 | padapter->net_closed = true; | 716 | padapter->net_closed = true; |
| 727 | 717 | ||
| 728 | rtw_led_control(padapter, LED_CTL_POWER_OFF); | 718 | rtw_led_control(padapter, LED_CTL_POWER_OFF); |
| 729 | 719 | ||
| 730 | rtw_ips_dev_unload(padapter); | 720 | rtw_ips_dev_unload(padapter); |
| 731 | padapter->bCardDisableWOHSM = false; | ||
| 732 | } | 721 | } |
| 733 | 722 | ||
| 734 | static void rtw_fifo_cleanup(struct adapter *adapter) | 723 | static void rtw_fifo_cleanup(struct adapter *adapter) |
| @@ -1,2 +1,18 @@ | |||
| 1 | * merge into drivers/net/wireless/rtllib/rtl8192e | 1 | To-do list: |
| 2 | |||
| 3 | * merge into drivers/net/wireless/realtek/rtlwifi/rtl8192* | ||
| 2 | * clean up function naming | 4 | * clean up function naming |
| 5 | * Correct the coding style according to Linux guidelines; please read the document | ||
| 6 | at https://www.kernel.org/doc/html/latest/process/coding-style.html. | ||
| 7 | * Remove unnecessary debugging/printing macros; for those that are still needed | ||
| 8 | use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). | ||
| 9 | * Remove dead code such as unusued functions, variables, fields, etc.. | ||
| 10 | * Use in-kernel API and remove unnecessary wrappers where possible. | ||
| 11 | * Fix bugs due to code that sleeps in atomic context. | ||
| 12 | * Remove the HAL layer and migrate its functionality into the relevant parts of | ||
| 13 | the driver. | ||
| 14 | * Switch to use LIB80211. | ||
| 15 | * Switch to use MAC80211. | ||
| 16 | * Switch to use CFG80211. | ||
| 17 | * Improve the error handling of various functions, particularly those that use | ||
| 18 | existing kernel APIs. | ||
| @@ -154,21 +154,6 @@ struct tx_fwinfo_8190pci { · 153 unmodified lines | |||
| 154 | 154 | ||
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | struct log_int_8190 { | ||
| 158 | u32 nIMR_COMDOK; | ||
| 159 | u32 nIMR_MGNTDOK; | ||
| 160 | u32 nIMR_HIGH; | ||
| 161 | u32 nIMR_VODOK; | ||
| 162 | u32 nIMR_VIDOK; | ||
| 163 | u32 nIMR_BEDOK; | ||
| 164 | u32 nIMR_BKDOK; | ||
| 165 | u32 nIMR_ROK; | ||
| 166 | u32 nIMR_RCOK; | ||
| 167 | u32 nIMR_TBDOK; | ||
| 168 | u32 nIMR_BDOK; | ||
| 169 | u32 nIMR_RXFOVW; | ||
| 170 | }; | ||
| 171 | |||
| 172 | struct phy_ofdm_rx_status_rxsc_sgien_exintfflag { | 157 | struct phy_ofdm_rx_status_rxsc_sgien_exintfflag { |
| 173 | u8 reserved:4; | 158 | u8 reserved:4; |
| 174 | u8 rxsc:2; | 159 | u8 rxsc:2; |
| @@ -224,8 +224,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) · 223 unmodified lines | |||
| 224 | u8 acm = pAciAifsn->f.acm; | 224 | u8 acm = pAciAifsn->f.acm; |
| 225 | u8 AcmCtrl = rtl92e_readb(dev, AcmHwCtrl); | 225 | u8 AcmCtrl = rtl92e_readb(dev, AcmHwCtrl); |
| 226 | 226 | ||
| 227 | AcmCtrl = AcmCtrl | ((priv->AcmMethod == 2) ? 0x0 : 0x1); | ||
| 228 | |||
| 229 | if (acm) { | 227 | if (acm) { |
| 230 | switch (eACI) { | 228 | switch (eACI) { |
| 231 | case AC0_BE: | 229 | case AC0_BE: |
| @@ -474,10 +472,10 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) · 242 unmodified lines | |||
| 474 | 472 | ||
| 475 | priv->rf_chip = RF_8256; | 473 | priv->rf_chip = RF_8256; |
| 476 | 474 | ||
| 477 | if (priv->RegChannelPlan == 0xf) | 475 | if (priv->reg_chnl_plan == 0xf) |
| 478 | priv->ChannelPlan = priv->eeprom_ChannelPlan; | 476 | priv->ChannelPlan = priv->eeprom_ChannelPlan; |
| 479 | else | 477 | else |
| 480 | priv->ChannelPlan = priv->RegChannelPlan; | 478 | priv->ChannelPlan = priv->reg_chnl_plan; |
| 481 | 479 | ||
| 482 | if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304) | 480 | if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304) |
| 483 | priv->CustomerID = RT_CID_DLINK; | 481 | priv->CustomerID = RT_CID_DLINK; |
| @@ -503,7 +501,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) · 19 unmodified lines | |||
| 503 | priv->ChannelPlan = 0x0; | 501 | priv->ChannelPlan = 0x0; |
| 504 | break; | 502 | break; |
| 505 | case EEPROM_CID_Nettronix: | 503 | case EEPROM_CID_Nettronix: |
| 506 | priv->ScanDelay = 100; | ||
| 507 | priv->CustomerID = RT_CID_Nettronix; | 504 | priv->CustomerID = RT_CID_Nettronix; |
| 508 | break; | 505 | break; |
| 509 | case EEPROM_CID_Pronet: | 506 | case EEPROM_CID_Pronet: |
| @@ -618,15 +615,12 @@ bool rtl92e_start_adapter(struct net_device *dev) · 108 unmodified lines | |||
| 618 | start: | 615 | start: |
| 619 | rtl92e_reset_desc_ring(dev); | 616 | rtl92e_reset_desc_ring(dev); |
| 620 | priv->Rf_Mode = RF_OP_By_SW_3wire; | 617 | priv->Rf_Mode = RF_OP_By_SW_3wire; |
| 621 | if (priv->ResetProgress == RESET_TYPE_NORESET) { | 618 | if (priv->rst_progress == RESET_TYPE_NORESET) { |
| 622 | rtl92e_writeb(dev, ANAPAR, 0x37); | 619 | rtl92e_writeb(dev, ANAPAR, 0x37); |
| 623 | mdelay(500); | 620 | mdelay(500); |
| 624 | } | 621 | } |
| 625 | priv->pFirmware->status = FW_STATUS_0_INIT; | 622 | priv->pFirmware->status = FW_STATUS_0_INIT; |
| 626 | 623 | ||
| 627 | if (priv->RegRfOff) | ||
| 628 | priv->rtllib->rf_power_state = rf_off; | ||
| 629 | |||
| 630 | ulRegRead = rtl92e_readl(dev, CPU_GEN); | 624 | ulRegRead = rtl92e_readl(dev, CPU_GEN); |
| 631 | if (priv->pFirmware->status == FW_STATUS_0_INIT) | 625 | if (priv->pFirmware->status == FW_STATUS_0_INIT) |
| 632 | ulRegRead |= CPU_GEN_SYSTEM_RESET; | 626 | ulRegRead |= CPU_GEN_SYSTEM_RESET; |
| @@ -654,7 +648,7 @@ start: · 21 unmodified lines | |||
| 654 | } | 648 | } |
| 655 | 649 | ||
| 656 | priv->LoopbackMode = RTL819X_NO_LOOPBACK; | 650 | priv->LoopbackMode = RTL819X_NO_LOOPBACK; |
| 657 | if (priv->ResetProgress == RESET_TYPE_NORESET) { | 651 | if (priv->rst_progress == RESET_TYPE_NORESET) { |
| 658 | ulRegRead = rtl92e_readl(dev, CPU_GEN); | 652 | ulRegRead = rtl92e_readl(dev, CPU_GEN); |
| 659 | if (priv->LoopbackMode == RTL819X_NO_LOOPBACK) | 653 | if (priv->LoopbackMode == RTL819X_NO_LOOPBACK) |
| 660 | ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | | 654 | ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | |
| @@ -703,7 +697,7 @@ start: · 42 unmodified lines | |||
| 703 | 697 | ||
| 704 | rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); | 698 | rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); |
| 705 | 699 | ||
| 706 | if (priv->ResetProgress == RESET_TYPE_NORESET) | 700 | if (priv->rst_progress == RESET_TYPE_NORESET) |
| 707 | rtl92e_set_wireless_mode(dev, priv->rtllib->mode); | 701 | rtl92e_set_wireless_mode(dev, priv->rtllib->mode); |
| 708 | rtl92e_cam_reset(dev); | 702 | rtl92e_cam_reset(dev); |
| 709 | { | 703 | { |
| @@ -743,7 +737,7 @@ start: · 33 unmodified lines | |||
| 743 | } | 737 | } |
| 744 | } | 738 | } |
| 745 | 739 | ||
| 746 | if (priv->ResetProgress == RESET_TYPE_NORESET) { | 740 | if (priv->rst_progress == RESET_TYPE_NORESET) { |
| 747 | rtStatus = rtl92e_config_phy(dev); | 741 | rtStatus = rtl92e_config_phy(dev); |
| 748 | if (!rtStatus) { | 742 | if (!rtStatus) { |
| 749 | netdev_info(dev, "RF Config failed\n"); | 743 | netdev_info(dev, "RF Config failed\n"); |
| @@ -756,9 +750,7 @@ start: · 6 unmodified lines | |||
| 756 | 750 | ||
| 757 | rtl92e_writeb(dev, 0x87, 0x0); | 751 | rtl92e_writeb(dev, 0x87, 0x0); |
| 758 | 752 | ||
| 759 | if (priv->RegRfOff) { | 753 | if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) { |
| 760 | rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW); | ||
| 761 | } else if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) { | ||
| 762 | rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); | 754 | rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); |
| 763 | } else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) { | 755 | } else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) { |
| 764 | rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); | 756 | rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); |
| @@ -772,7 +764,7 @@ start: · 7 unmodified lines | |||
| 772 | else | 764 | else |
| 773 | priv->Rf_Mode = RF_OP_By_SW_3wire; | 765 | priv->Rf_Mode = RF_OP_By_SW_3wire; |
| 774 | 766 | ||
| 775 | if (priv->ResetProgress == RESET_TYPE_NORESET) { | 767 | if (priv->rst_progress == RESET_TYPE_NORESET) { |
| 776 | rtl92e_dm_init_txpower_tracking(dev); | 768 | rtl92e_dm_init_txpower_tracking(dev); |
| 777 | 769 | ||
| 778 | if (priv->IC_Cut >= IC_VersionCut_D) { | 770 | if (priv->IC_Cut >= IC_VersionCut_D) { |
| @@ -801,7 +793,7 @@ start: · 22 unmodified lines | |||
| 801 | } | 793 | } |
| 802 | priv->CCKPresentAttentuation_40Mdefault = 0; | 794 | priv->CCKPresentAttentuation_40Mdefault = 0; |
| 803 | priv->CCKPresentAttentuation_difference = 0; | 795 | priv->CCKPresentAttentuation_difference = 0; |
| 804 | priv->CCKPresentAttentuation = | 796 | priv->cck_present_attn = |
| 805 | priv->CCKPresentAttentuation_20Mdefault; | 797 | priv->CCKPresentAttentuation_20Mdefault; |
| 806 | priv->btxpower_tracking = false; | 798 | priv->btxpower_tracking = false; |
| 807 | } | 799 | } |
| @@ -865,7 +857,7 @@ void rtl92e_link_change(struct net_device *dev) · 57 unmodified lines | |||
| 865 | 857 | ||
| 866 | reg = rtl92e_readl(dev, RCR); | 858 | reg = rtl92e_readl(dev, RCR); |
| 867 | if (priv->rtllib->state == RTLLIB_LINKED) { | 859 | if (priv->rtllib->state == RTLLIB_LINKED) { |
| 868 | if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn) | 860 | if (ieee->intel_promiscuous_md_info.promiscuous_on) |
| 869 | ; | 861 | ; |
| 870 | else | 862 | else |
| 871 | priv->ReceiveConfig = reg |= RCR_CBSSID; | 863 | priv->ReceiveConfig = reg |= RCR_CBSSID; |
| @@ -1112,9 +1104,8 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, · 240 unmodified lines | |||
| 1112 | if (cb_desc->bHwSec) { | 1104 | if (cb_desc->bHwSec) { |
| 1113 | static u8 tmp; | 1105 | static u8 tmp; |
| 1114 | 1106 | ||
| 1115 | if (!tmp) { | 1107 | if (!tmp) |
| 1116 | tmp = 1; | 1108 | tmp = 1; |
| 1117 | } | ||
| 1118 | switch (priv->rtllib->pairwise_key_type) { | 1109 | switch (priv->rtllib->pairwise_key_type) { |
| 1119 | case KEY_TYPE_WEP40: | 1110 | case KEY_TYPE_WEP40: |
| 1120 | case KEY_TYPE_WEP104: | 1111 | case KEY_TYPE_WEP104: |
| @@ -1143,8 +1134,8 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, · 22 unmodified lines | |||
| 1143 | cb_desc->priority); | 1134 | cb_desc->priority); |
| 1144 | pdesc->TxFWInfoSize = sizeof(struct tx_fwinfo_8190pci); | 1135 | pdesc->TxFWInfoSize = sizeof(struct tx_fwinfo_8190pci); |
| 1145 | 1136 | ||
| 1146 | pdesc->DISFB = cb_desc->bTxDisableRateFallBack; | 1137 | pdesc->DISFB = cb_desc->tx_dis_rate_fallback; |
| 1147 | pdesc->USERATE = cb_desc->bTxUseDriverAssingedRate; | 1138 | pdesc->USERATE = cb_desc->tx_use_drv_assinged_rate; |
| 1148 | 1139 | ||
| 1149 | pdesc->FirstSeg = 1; | 1140 | pdesc->FirstSeg = 1; |
| 1150 | pdesc->LastSeg = 1; | 1141 | pdesc->LastSeg = 1; |
| @@ -1935,7 +1926,7 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset) · 784 unmodified lines | |||
| 1935 | if (!reset) { | 1926 | if (!reset) { |
| 1936 | mdelay(150); | 1927 | mdelay(150); |
| 1937 | 1928 | ||
| 1938 | priv->bHwRfOffAction = 2; | 1929 | priv->hw_rf_off_action = 2; |
| 1939 | 1930 | ||
| 1940 | if (!priv->rtllib->bSupportRemoteWakeUp) { | 1931 | if (!priv->rtllib->bSupportRemoteWakeUp) { |
| 1941 | rtl92e_set_rf_off(dev); | 1932 | rtl92e_set_rf_off(dev); |
| @@ -1955,8 +1946,6 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset) · 13 unmodified lines | |||
| 1955 | 1946 | ||
| 1956 | for (i = 0; i < MAX_QUEUE_SIZE; i++) | 1947 | for (i = 0; i < MAX_QUEUE_SIZE; i++) |
| 1957 | skb_queue_purge(&priv->rtllib->skb_waitQ[i]); | 1948 | skb_queue_purge(&priv->rtllib->skb_waitQ[i]); |
| 1958 | for (i = 0; i < MAX_QUEUE_SIZE; i++) | ||
| 1959 | skb_queue_purge(&priv->rtllib->skb_aggQ[i]); | ||
| 1960 | 1949 | ||
| 1961 | skb_queue_purge(&priv->skb_queue); | 1950 | skb_queue_purge(&priv->skb_queue); |
| 1962 | } | 1951 | } |
| @@ -1965,7 +1954,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 2 unmodified lines | |||
| 1965 | { | 1954 | { |
| 1966 | struct r8192_priv *priv = rtllib_priv(dev); | 1955 | struct r8192_priv *priv = rtllib_priv(dev); |
| 1967 | struct rtllib_device *ieee = priv->rtllib; | 1956 | struct rtllib_device *ieee = priv->rtllib; |
| 1968 | u8 *pMcsRate = ieee->dot11HTOperationalRateSet; | 1957 | u8 *pMcsRate = ieee->dot11ht_oper_rate_set; |
| 1969 | u32 ratr_value = 0; | 1958 | u32 ratr_value = 0; |
| 1970 | u16 rate_config = 0; | 1959 | u16 rate_config = 0; |
| 1971 | u8 rate_index = 0; | 1960 | u8 rate_index = 0; |
| @@ -1985,7 +1974,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 13 unmodified lines | |||
| 1985 | break; | 1974 | break; |
| 1986 | case IEEE_N_24G: | 1975 | case IEEE_N_24G: |
| 1987 | case IEEE_N_5G: | 1976 | case IEEE_N_5G: |
| 1988 | if (ieee->pHTInfo->peer_mimo_ps == 0) { | 1977 | if (ieee->ht_info->peer_mimo_ps == 0) { |
| 1989 | ratr_value &= 0x0007F007; | 1978 | ratr_value &= 0x0007F007; |
| 1990 | } else { | 1979 | } else { |
| 1991 | if (priv->rf_type == RF_1T2R) | 1980 | if (priv->rf_type == RF_1T2R) |
| @@ -1998,11 +1987,11 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 6 unmodified lines | |||
| 1998 | break; | 1987 | break; |
| 1999 | } | 1988 | } |
| 2000 | ratr_value &= 0x0FFFFFFF; | 1989 | ratr_value &= 0x0FFFFFFF; |
| 2001 | if (ieee->pHTInfo->cur_tx_bw40mhz && | 1990 | if (ieee->ht_info->cur_tx_bw40mhz && |
| 2002 | ieee->pHTInfo->bCurShortGI40MHz) | 1991 | ieee->ht_info->bCurShortGI40MHz) |
| 2003 | ratr_value |= 0x80000000; | 1992 | ratr_value |= 0x80000000; |
| 2004 | else if (!ieee->pHTInfo->cur_tx_bw40mhz && | 1993 | else if (!ieee->ht_info->cur_tx_bw40mhz && |
| 2005 | ieee->pHTInfo->bCurShortGI20MHz) | 1994 | ieee->ht_info->bCurShortGI20MHz) |
| 2006 | ratr_value |= 0x80000000; | 1995 | ratr_value |= 0x80000000; |
| 2007 | rtl92e_writel(dev, RATR0+rate_index*4, ratr_value); | 1996 | rtl92e_writel(dev, RATR0+rate_index*4, ratr_value); |
| 2008 | rtl92e_writeb(dev, UFWP, 1); | 1997 | rtl92e_writeb(dev, UFWP, 1); |
| @@ -2136,7 +2125,7 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) · 127 unmodified lines | |||
| 2136 | 2125 | ||
| 2137 | SlotIndex = (priv->SilentResetRxSlotIndex++)%SilentResetRxSoltNum; | 2126 | SlotIndex = (priv->SilentResetRxSlotIndex++)%SilentResetRxSoltNum; |
| 2138 | 2127 | ||
| 2139 | if (priv->RxCounter == RegRxCounter) { | 2128 | if (priv->rx_ctr == RegRxCounter) { |
| 2140 | priv->SilentResetRxStuckEvent[SlotIndex] = 1; | 2129 | priv->SilentResetRxStuckEvent[SlotIndex] = 1; |
| 2141 | 2130 | ||
| 2142 | for (i = 0; i < SilentResetRxSoltNum; i++) | 2131 | for (i = 0; i < SilentResetRxSoltNum; i++) |
| @@ -2154,7 +2143,7 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) · 11 unmodified lines | |||
| 2154 | priv->SilentResetRxStuckEvent[SlotIndex] = 0; | 2143 | priv->SilentResetRxStuckEvent[SlotIndex] = 0; |
| 2155 | } | 2144 | } |
| 2156 | 2145 | ||
| 2157 | priv->RxCounter = RegRxCounter; | 2146 | priv->rx_ctr = RegRxCounter; |
| 2158 | 2147 | ||
| 2159 | return bStuck; | 2148 | return bStuck; |
| 2160 | } | 2149 | } |
| @@ -522,9 +522,8 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev) · 521 unmodified lines | |||
| 522 | rtStatus = rtl92e_check_bb_and_rf(dev, | 522 | rtStatus = rtl92e_check_bb_and_rf(dev, |
| 523 | (enum hw90_block)eCheckItem, | 523 | (enum hw90_block)eCheckItem, |
| 524 | (enum rf90_radio_path)0); | 524 | (enum rf90_radio_path)0); |
| 525 | if (!rtStatus) { | 525 | if (!rtStatus) |
| 526 | return rtStatus; | 526 | return rtStatus; |
| 527 | } | ||
| 528 | } | 527 | } |
| 529 | rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); | 528 | rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); |
| 530 | _rtl92e_phy_config_bb(dev, BaseBand_Config_PHY_REG); | 529 | _rtl92e_phy_config_bb(dev, BaseBand_Config_PHY_REG); |
| @@ -1009,16 +1008,16 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev) · 478 unmodified lines | |||
| 1009 | 1008 | ||
| 1010 | switch (priv->CurrentChannelBW) { | 1009 | switch (priv->CurrentChannelBW) { |
| 1011 | case HT_CHANNEL_WIDTH_20: | 1010 | case HT_CHANNEL_WIDTH_20: |
| 1012 | priv->CCKPresentAttentuation = | 1011 | priv->cck_present_attn = |
| 1013 | priv->CCKPresentAttentuation_20Mdefault + | 1012 | priv->CCKPresentAttentuation_20Mdefault + |
| 1014 | priv->CCKPresentAttentuation_difference; | 1013 | priv->CCKPresentAttentuation_difference; |
| 1015 | 1014 | ||
| 1016 | if (priv->CCKPresentAttentuation > | 1015 | if (priv->cck_present_attn > |
| 1017 | (CCKTxBBGainTableLength-1)) | 1016 | (CCKTxBBGainTableLength-1)) |
| 1018 | priv->CCKPresentAttentuation = | 1017 | priv->cck_present_attn = |
| 1019 | CCKTxBBGainTableLength-1; | 1018 | CCKTxBBGainTableLength-1; |
| 1020 | if (priv->CCKPresentAttentuation < 0) | 1019 | if (priv->cck_present_attn < 0) |
| 1021 | priv->CCKPresentAttentuation = 0; | 1020 | priv->cck_present_attn = 0; |
| 1022 | 1021 | ||
| 1023 | if (priv->rtllib->current_network.channel == 14 && | 1022 | if (priv->rtllib->current_network.channel == 14 && |
| 1024 | !priv->bcck_in_ch14) { | 1023 | !priv->bcck_in_ch14) { |
| @@ -1034,16 +1033,16 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev) · 9 unmodified lines | |||
| 1034 | break; | 1033 | break; |
| 1035 | 1034 | ||
| 1036 | case HT_CHANNEL_WIDTH_20_40: | 1035 | case HT_CHANNEL_WIDTH_20_40: |
| 1037 | priv->CCKPresentAttentuation = | 1036 | priv->cck_present_attn = |
| 1038 | priv->CCKPresentAttentuation_40Mdefault + | 1037 | priv->CCKPresentAttentuation_40Mdefault + |
| 1039 | priv->CCKPresentAttentuation_difference; | 1038 | priv->CCKPresentAttentuation_difference; |
| 1040 | 1039 | ||
| 1041 | if (priv->CCKPresentAttentuation > | 1040 | if (priv->cck_present_attn > |
| 1042 | (CCKTxBBGainTableLength - 1)) | 1041 | (CCKTxBBGainTableLength - 1)) |
| 1043 | priv->CCKPresentAttentuation = | 1042 | priv->cck_present_attn = |
| 1044 | CCKTxBBGainTableLength-1; | 1043 | CCKTxBBGainTableLength-1; |
| 1045 | if (priv->CCKPresentAttentuation < 0) | 1044 | if (priv->cck_present_attn < 0) |
| 1046 | priv->CCKPresentAttentuation = 0; | 1045 | priv->cck_present_attn = 0; |
| 1047 | 1046 | ||
| 1048 | if (priv->rtllib->current_network.channel == 14 && | 1047 | if (priv->rtllib->current_network.channel == 14 && |
| 1049 | !priv->bcck_in_ch14) { | 1048 | !priv->bcck_in_ch14) { |
| @@ -1304,8 +1303,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 254 unmodified lines | |||
| 1304 | enum rt_rf_power_state rf_power_state) | 1303 | enum rt_rf_power_state rf_power_state) |
| 1305 | { | 1304 | { |
| 1306 | struct r8192_priv *priv = rtllib_priv(dev); | 1305 | struct r8192_priv *priv = rtllib_priv(dev); |
| 1307 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 1306 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 1308 | (&(priv->rtllib->PowerSaveControl)); | 1307 | (&priv->rtllib->pwr_save_ctrl); |
| 1309 | bool bResult = true; | 1308 | bool bResult = true; |
| 1310 | u8 i = 0, QueueID = 0; | 1309 | u8 i = 0, QueueID = 0; |
| 1311 | struct rtl8192_tx_ring *ring = NULL; | 1310 | struct rtl8192_tx_ring *ring = NULL; |
| @@ -1319,13 +1318,12 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 7 unmodified lines | |||
| 1319 | switch (rf_power_state) { | 1318 | switch (rf_power_state) { |
| 1320 | case rf_on: | 1319 | case rf_on: |
| 1321 | if ((priv->rtllib->rf_power_state == rf_off) && | 1320 | if ((priv->rtllib->rf_power_state == rf_off) && |
| 1322 | RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) { | 1321 | RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) { |
| 1323 | bool rtstatus; | 1322 | bool rtstatus; |
| 1324 | u32 InitilizeCount = 3; | 1323 | u32 InitilizeCount = 3; |
| 1325 | 1324 | ||
| 1326 | do { | 1325 | do { |
| 1327 | InitilizeCount--; | 1326 | InitilizeCount--; |
| 1328 | priv->RegRfOff = false; | ||
| 1329 | rtstatus = rtl92e_enable_nic(dev); | 1327 | rtstatus = rtl92e_enable_nic(dev); |
| 1330 | } while (!rtstatus && (InitilizeCount > 0)); | 1328 | } while (!rtstatus && (InitilizeCount > 0)); |
| 1331 | 1329 | ||
| @@ -1337,14 +1335,14 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 5 unmodified lines | |||
| 1337 | return false; | 1335 | return false; |
| 1338 | } | 1336 | } |
| 1339 | 1337 | ||
| 1340 | RT_CLEAR_PS_LEVEL(pPSC, | 1338 | RT_CLEAR_PS_LEVEL(psc, |
| 1341 | RT_RF_OFF_LEVL_HALT_NIC); | 1339 | RT_RF_OFF_LEVL_HALT_NIC); |
| 1342 | } else { | 1340 | } else { |
| 1343 | rtl92e_writeb(dev, ANAPAR, 0x37); | 1341 | rtl92e_writeb(dev, ANAPAR, 0x37); |
| 1344 | mdelay(1); | 1342 | mdelay(1); |
| 1345 | rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, | 1343 | rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, |
| 1346 | 0x4, 0x1); | 1344 | 0x4, 0x1); |
| 1347 | priv->bHwRfOffAction = 0; | 1345 | priv->hw_rf_off_action = 0; |
| 1348 | 1346 | ||
| 1349 | rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, | 1347 | rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, |
| 1350 | BIT4, 0x1); | 1348 | BIT4, 0x1); |
| @@ -1379,9 +1377,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 28 unmodified lines | |||
| 1379 | i++; | 1377 | i++; |
| 1380 | } | 1378 | } |
| 1381 | 1379 | ||
| 1382 | if (i >= MAX_DOZE_WAITING_TIMES_9x) { | 1380 | if (i >= MAX_DOZE_WAITING_TIMES_9x) |
| 1383 | break; | 1381 | break; |
| 1384 | } | ||
| 1385 | } | 1382 | } |
| 1386 | rtl92e_set_rf_off(dev); | 1383 | rtl92e_set_rf_off(dev); |
| 1387 | break; | 1384 | break; |
| @@ -1398,16 +1395,15 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 10 unmodified lines | |||
| 1398 | i++; | 1395 | i++; |
| 1399 | } | 1396 | } |
| 1400 | 1397 | ||
| 1401 | if (i >= MAX_DOZE_WAITING_TIMES_9x) { | 1398 | if (i >= MAX_DOZE_WAITING_TIMES_9x) |
| 1402 | break; | 1399 | break; |
| 1403 | } | ||
| 1404 | } | 1400 | } |
| 1405 | 1401 | ||
| 1406 | if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && | 1402 | if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && |
| 1407 | !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) { | 1403 | !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) { |
| 1408 | rtl92e_disable_nic(dev); | 1404 | rtl92e_disable_nic(dev); |
| 1409 | RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); | 1405 | RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); |
| 1410 | } else if (!(pPSC->RegRfPsLevel & | 1406 | } else if (!(psc->RegRfPsLevel & |
| 1411 | RT_RF_OFF_LEVL_HALT_NIC)) { | 1407 | RT_RF_OFF_LEVL_HALT_NIC)) { |
| 1412 | rtl92e_set_rf_off(dev); | 1408 | rtl92e_set_rf_off(dev); |
| 1413 | } | 1409 | } |
| @@ -1454,7 +1450,7 @@ bool rtl92e_set_rf_power_state(struct net_device *dev, · 40 unmodified lines | |||
| 1454 | bool bResult = false; | 1450 | bool bResult = false; |
| 1455 | 1451 | ||
| 1456 | if (rf_power_state == priv->rtllib->rf_power_state && | 1452 | if (rf_power_state == priv->rtllib->rf_power_state && |
| 1457 | priv->bHwRfOffAction == 0) { | 1453 | priv->hw_rf_off_action == 0) { |
| 1458 | return bResult; | 1454 | return bResult; |
| 1459 | } | 1455 | } |
| 1460 | 1456 | ||
| @@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev) · 16 unmodified lines | |||
| 17 | { | 17 | { |
| 18 | u32 ulcommand = 0; | 18 | u32 ulcommand = 0; |
| 19 | 19 | ||
| 20 | ulcommand |= BIT31|BIT30; | 20 | ulcommand |= BIT31 | BIT30; |
| 21 | rtl92e_writel(dev, RWCAM, ulcommand); | 21 | rtl92e_writel(dev, RWCAM, ulcommand); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -40,9 +40,8 @@ void rtl92e_enable_hw_security_config(struct net_device *dev) · 16 unmodified lines | |||
| 40 | SECR_value |= SCR_TxUseDK; | 40 | SECR_value |= SCR_TxUseDK; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | |||
| 44 | ieee->hwsec_active = 1; | 43 | ieee->hwsec_active = 1; |
| 45 | if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) { | 44 | if ((ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) { |
| 46 | ieee->hwsec_active = 0; | 45 | ieee->hwsec_active = 0; |
| 47 | SECR_value &= ~SCR_RxDecEnable; | 46 | SECR_value &= ~SCR_RxDecEnable; |
| 48 | } | 47 | } |
| @@ -81,17 +80,15 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, · 32 unmodified lines | |||
| 81 | enum rt_rf_power_state rt_state; | 80 | enum rt_rf_power_state rt_state; |
| 82 | 81 | ||
| 83 | rt_state = priv->rtllib->rf_power_state; | 82 | rt_state = priv->rtllib->rf_power_state; |
| 84 | if (priv->rtllib->PowerSaveControl.bInactivePs) { | 83 | if (rt_state == rf_off) { |
| 85 | if (rt_state == rf_off) { | 84 | if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { |
| 86 | if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { | 85 | netdev_warn(dev, "%s(): RF is OFF.\n", |
| 87 | netdev_warn(dev, "%s(): RF is OFF.\n", | 86 | __func__); |
| 88 | __func__); | 87 | return; |
| 89 | return; | ||
| 90 | } | ||
| 91 | mutex_lock(&priv->rtllib->ips_mutex); | ||
| 92 | rtl92e_ips_leave(dev); | ||
| 93 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 94 | } | 88 | } |
| 89 | mutex_lock(&priv->rtllib->ips_mutex); | ||
| 90 | rtl92e_ips_leave(dev); | ||
| 91 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 95 | } | 92 | } |
| 96 | priv->rtllib->is_set_key = true; | 93 | priv->rtllib->is_set_key = true; |
| 97 | if (EntryNo >= TOTAL_CAM_ENTRY) { | 94 | if (EntryNo >= TOTAL_CAM_ENTRY) { |
| @@ -100,33 +97,33 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, · 2 unmodified lines | |||
| 100 | } | 97 | } |
| 101 | 98 | ||
| 102 | if (DefaultKey) | 99 | if (DefaultKey) |
| 103 | usConfig |= BIT15 | (KeyType<<2); | 100 | usConfig |= BIT15 | (KeyType << 2); |
| 104 | else | 101 | else |
| 105 | usConfig |= BIT15 | (KeyType<<2) | KeyIndex; | 102 | usConfig |= BIT15 | (KeyType << 2) | KeyIndex; |
| 106 | 103 | ||
| 107 | 104 | ||
| 108 | for (i = 0; i < CAM_CONTENT_COUNT; i++) { | 105 | for (i = 0; i < CAM_CONTENT_COUNT; i++) { |
| 109 | TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; | 106 | TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; |
| 110 | TargetCommand |= BIT31|BIT16; | 107 | TargetCommand |= BIT31 | BIT16; |
| 111 | 108 | ||
| 112 | if (i == 0) { | 109 | if (i == 0) { |
| 113 | TargetContent = (u32)(*(MacAddr+0)) << 16 | | 110 | TargetContent = (u32)(*(MacAddr + 0)) << 16 | |
| 114 | (u32)(*(MacAddr+1)) << 24 | | 111 | (u32)(*(MacAddr + 1)) << 24 | |
| 115 | (u32)usConfig; | 112 | (u32)usConfig; |
| 116 | 113 | ||
| 117 | rtl92e_writel(dev, WCAMI, TargetContent); | 114 | rtl92e_writel(dev, WCAMI, TargetContent); |
| 118 | rtl92e_writel(dev, RWCAM, TargetCommand); | 115 | rtl92e_writel(dev, RWCAM, TargetCommand); |
| 119 | } else if (i == 1) { | 116 | } else if (i == 1) { |
| 120 | TargetContent = (u32)(*(MacAddr+2)) | | 117 | TargetContent = (u32)(*(MacAddr + 2)) | |
| 121 | (u32)(*(MacAddr+3)) << 8 | | 118 | (u32)(*(MacAddr + 3)) << 8 | |
| 122 | (u32)(*(MacAddr+4)) << 16 | | 119 | (u32)(*(MacAddr + 4)) << 16 | |
| 123 | (u32)(*(MacAddr+5)) << 24; | 120 | (u32)(*(MacAddr + 5)) << 24; |
| 124 | rtl92e_writel(dev, WCAMI, TargetContent); | 121 | rtl92e_writel(dev, WCAMI, TargetContent); |
| 125 | rtl92e_writel(dev, RWCAM, TargetCommand); | 122 | rtl92e_writel(dev, RWCAM, TargetCommand); |
| 126 | } else { | 123 | } else { |
| 127 | if (KeyContent != NULL) { | 124 | if (KeyContent != NULL) { |
| 128 | rtl92e_writel(dev, WCAMI, | 125 | rtl92e_writel(dev, WCAMI, |
| 129 | (u32)(*(KeyContent+i-2))); | 126 | (u32)(*(KeyContent + i - 2))); |
| 130 | rtl92e_writel(dev, RWCAM, TargetCommand); | 127 | rtl92e_writel(dev, RWCAM, TargetCommand); |
| 131 | udelay(100); | 128 | udelay(100); |
| 132 | } | 129 | } |
| @@ -307,7 +307,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap) · 306 unmodified lines | |||
| 307 | u8 cur_slot_time = priv->slot_time; | 307 | u8 cur_slot_time = priv->slot_time; |
| 308 | 308 | ||
| 309 | if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) && | 309 | if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) && |
| 310 | (!priv->rtllib->pHTInfo->current_rt2rt_long_slot_time)) { | 310 | (!priv->rtllib->ht_info->current_rt2rt_long_slot_time)) { |
| 311 | if (cur_slot_time != SHORT_SLOT_TIME) { | 311 | if (cur_slot_time != SHORT_SLOT_TIME) { |
| 312 | slot_time_val = SHORT_SLOT_TIME; | 312 | slot_time_val = SHORT_SLOT_TIME; |
| 313 | priv->rtllib->SetHwRegHandler(dev, | 313 | priv->rtllib->SetHwRegHandler(dev, |
| @@ -339,10 +339,10 @@ static void _rtl92e_update_beacon(void *data) · 25 unmodified lines | |||
| 339 | struct rtllib_device *ieee = priv->rtllib; | 339 | struct rtllib_device *ieee = priv->rtllib; |
| 340 | struct rtllib_network *net = &ieee->current_network; | 340 | struct rtllib_network *net = &ieee->current_network; |
| 341 | 341 | ||
| 342 | if (ieee->pHTInfo->bCurrentHTSupport) | 342 | if (ieee->ht_info->bCurrentHTSupport) |
| 343 | HT_update_self_and_peer_setting(ieee, net); | 343 | HT_update_self_and_peer_setting(ieee, net); |
| 344 | ieee->pHTInfo->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; | 344 | ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; |
| 345 | ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; | 345 | ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; |
| 346 | _rtl92e_update_cap(dev, net->capability); | 346 | _rtl92e_update_cap(dev, net->capability); |
| 347 | } | 347 | } |
| 348 | 348 | ||
| @@ -494,8 +494,8 @@ static void _rtl92e_prepare_beacon(struct tasklet_struct *t) · 145 unmodified lines | |||
| 494 | tcb_desc->queue_index = BEACON_QUEUE; | 494 | tcb_desc->queue_index = BEACON_QUEUE; |
| 495 | tcb_desc->data_rate = 2; | 495 | tcb_desc->data_rate = 2; |
| 496 | tcb_desc->RATRIndex = 7; | 496 | tcb_desc->RATRIndex = 7; |
| 497 | tcb_desc->bTxDisableRateFallBack = 1; | 497 | tcb_desc->tx_dis_rate_fallback = 1; |
| 498 | tcb_desc->bTxUseDriverAssingedRate = 1; | 498 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 499 | skb_push(pnewskb, priv->rtllib->tx_headroom); | 499 | skb_push(pnewskb, priv->rtllib->tx_headroom); |
| 500 | 500 | ||
| 501 | pdesc = &ring->desc[0]; | 501 | pdesc = &ring->desc[0]; |
| @@ -607,13 +607,13 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv) · 105 unmodified lines | |||
| 607 | 607 | ||
| 608 | if (ieee->mode == WIRELESS_MODE_N_24G || | 608 | if (ieee->mode == WIRELESS_MODE_N_24G || |
| 609 | ieee->mode == WIRELESS_MODE_N_5G) { | 609 | ieee->mode == WIRELESS_MODE_N_5G) { |
| 610 | memcpy(ieee->Regdot11HTOperationalRateSet, | 610 | memcpy(ieee->reg_dot11ht_oper_rate_set, |
| 611 | ieee->RegHTSuppRateSet, 16); | 611 | ieee->reg_ht_supp_rate_set, 16); |
| 612 | memcpy(ieee->Regdot11TxHTOperationalRateSet, | 612 | memcpy(ieee->reg_dot11tx_ht_oper_rate_set, |
| 613 | ieee->RegHTSuppRateSet, 16); | 613 | ieee->reg_ht_supp_rate_set, 16); |
| 614 | 614 | ||
| 615 | } else { | 615 | } else { |
| 616 | memset(ieee->Regdot11HTOperationalRateSet, 0, 16); | 616 | memset(ieee->reg_dot11ht_oper_rate_set, 0, 16); |
| 617 | } | 617 | } |
| 618 | } | 618 | } |
| 619 | 619 | ||
| @@ -642,19 +642,19 @@ static u8 _rtl92e_get_supported_wireless_mode(struct net_device *dev) · 22 unmodified lines | |||
| 642 | void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) | 642 | void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) |
| 643 | { | 643 | { |
| 644 | struct r8192_priv *priv = rtllib_priv(dev); | 644 | struct r8192_priv *priv = rtllib_priv(dev); |
| 645 | u8 bSupportMode = _rtl92e_get_supported_wireless_mode(dev); | 645 | u8 support_mode = _rtl92e_get_supported_wireless_mode(dev); |
| 646 | 646 | ||
| 647 | if ((wireless_mode == WIRELESS_MODE_AUTO) || | 647 | if ((wireless_mode == WIRELESS_MODE_AUTO) || |
| 648 | ((wireless_mode & bSupportMode) == 0)) { | 648 | ((wireless_mode & support_mode) == 0)) { |
| 649 | if (bSupportMode & WIRELESS_MODE_N_24G) { | 649 | if (support_mode & WIRELESS_MODE_N_24G) { |
| 650 | wireless_mode = WIRELESS_MODE_N_24G; | 650 | wireless_mode = WIRELESS_MODE_N_24G; |
| 651 | } else if (bSupportMode & WIRELESS_MODE_N_5G) { | 651 | } else if (support_mode & WIRELESS_MODE_N_5G) { |
| 652 | wireless_mode = WIRELESS_MODE_N_5G; | 652 | wireless_mode = WIRELESS_MODE_N_5G; |
| 653 | } else if ((bSupportMode & WIRELESS_MODE_A)) { | 653 | } else if ((support_mode & WIRELESS_MODE_A)) { |
| 654 | wireless_mode = WIRELESS_MODE_A; | 654 | wireless_mode = WIRELESS_MODE_A; |
| 655 | } else if ((bSupportMode & WIRELESS_MODE_G)) { | 655 | } else if ((support_mode & WIRELESS_MODE_G)) { |
| 656 | wireless_mode = WIRELESS_MODE_G; | 656 | wireless_mode = WIRELESS_MODE_G; |
| 657 | } else if ((bSupportMode & WIRELESS_MODE_B)) { | 657 | } else if ((support_mode & WIRELESS_MODE_B)) { |
| 658 | wireless_mode = WIRELESS_MODE_B; | 658 | wireless_mode = WIRELESS_MODE_B; |
| 659 | } else { | 659 | } else { |
| 660 | netdev_info(dev, | 660 | netdev_info(dev, |
| @@ -672,9 +672,9 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) · 11 unmodified lines | |||
| 672 | 672 | ||
| 673 | if ((wireless_mode == WIRELESS_MODE_N_24G) || | 673 | if ((wireless_mode == WIRELESS_MODE_N_24G) || |
| 674 | (wireless_mode == WIRELESS_MODE_N_5G)) { | 674 | (wireless_mode == WIRELESS_MODE_N_5G)) { |
| 675 | priv->rtllib->pHTInfo->bEnableHT = 1; | 675 | priv->rtllib->ht_info->enable_ht = 1; |
| 676 | } else { | 676 | } else { |
| 677 | priv->rtllib->pHTInfo->bEnableHT = 0; | 677 | priv->rtllib->ht_info->enable_ht = 0; |
| 678 | } | 678 | } |
| 679 | _rtl92e_refresh_support_rate(priv); | 679 | _rtl92e_refresh_support_rate(priv); |
| 680 | } | 680 | } |
| @@ -682,11 +682,10 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) · 1 unmodified line | |||
| 682 | static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) | 682 | static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) |
| 683 | { | 683 | { |
| 684 | struct r8192_priv *priv = rtllib_priv(dev); | 684 | struct r8192_priv *priv = rtllib_priv(dev); |
| 685 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 685 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 686 | (&priv->rtllib->PowerSaveControl); | 686 | (&priv->rtllib->pwr_save_ctrl); |
| 687 | bool init_status; | 687 | bool init_status; |
| 688 | 688 | ||
| 689 | priv->bDriverIsGoingToUnload = false; | ||
| 690 | priv->bdisable_nic = false; | 689 | priv->bdisable_nic = false; |
| 691 | 690 | ||
| 692 | priv->up = 1; | 691 | priv->up = 1; |
| @@ -701,7 +700,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) · 8 unmodified lines | |||
| 701 | return -1; | 700 | return -1; |
| 702 | } | 701 | } |
| 703 | 702 | ||
| 704 | RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); | 703 | RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); |
| 705 | priv->bfirst_init = false; | 704 | priv->bfirst_init = false; |
| 706 | 705 | ||
| 707 | if (priv->polling_timer_on == 0) | 706 | if (priv->polling_timer_on == 0) |
| @@ -724,7 +723,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 16 unmodified lines | |||
| 724 | { | 723 | { |
| 725 | struct r8192_priv *priv = rtllib_priv(dev); | 724 | struct r8192_priv *priv = rtllib_priv(dev); |
| 726 | unsigned long flags = 0; | 725 | unsigned long flags = 0; |
| 727 | u8 RFInProgressTimeOut = 0; | 726 | u8 rf_in_progress_timeout = 0; |
| 728 | 727 | ||
| 729 | if (priv->up == 0) | 728 | if (priv->up == 0) |
| 730 | return -1; | 729 | return -1; |
| @@ -735,7 +734,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 4 unmodified lines | |||
| 735 | if (priv->rtllib->state == RTLLIB_LINKED) | 734 | if (priv->rtllib->state == RTLLIB_LINKED) |
| 736 | rtl92e_leisure_ps_leave(dev); | 735 | rtl92e_leisure_ps_leave(dev); |
| 737 | 736 | ||
| 738 | priv->bDriverIsGoingToUnload = true; | ||
| 739 | priv->up = 0; | 737 | priv->up = 0; |
| 740 | priv->rtllib->ieee_up = 0; | 738 | priv->rtllib->ieee_up = 0; |
| 741 | priv->bfirst_after_down = true; | 739 | priv->bfirst_after_down = true; |
| @@ -757,12 +755,12 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 15 unmodified lines | |||
| 757 | spin_lock_irqsave(&priv->rf_ps_lock, flags); | 755 | spin_lock_irqsave(&priv->rf_ps_lock, flags); |
| 758 | while (priv->rf_change_in_progress) { | 756 | while (priv->rf_change_in_progress) { |
| 759 | spin_unlock_irqrestore(&priv->rf_ps_lock, flags); | 757 | spin_unlock_irqrestore(&priv->rf_ps_lock, flags); |
| 760 | if (RFInProgressTimeOut > 100) { | 758 | if (rf_in_progress_timeout > 100) { |
| 761 | spin_lock_irqsave(&priv->rf_ps_lock, flags); | 759 | spin_lock_irqsave(&priv->rf_ps_lock, flags); |
| 762 | break; | 760 | break; |
| 763 | } | 761 | } |
| 764 | mdelay(1); | 762 | mdelay(1); |
| 765 | RFInProgressTimeOut++; | 763 | rf_in_progress_timeout++; |
| 766 | spin_lock_irqsave(&priv->rf_ps_lock, flags); | 764 | spin_lock_irqsave(&priv->rf_ps_lock, flags); |
| 767 | } | 765 | } |
| 768 | priv->rf_change_in_progress = true; | 766 | priv->rf_change_in_progress = true; |
| @@ -821,10 +819,10 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) · 52 unmodified lines | |||
| 821 | static void _rtl92e_init_priv_constant(struct net_device *dev) | 819 | static void _rtl92e_init_priv_constant(struct net_device *dev) |
| 822 | { | 820 | { |
| 823 | struct r8192_priv *priv = rtllib_priv(dev); | 821 | struct r8192_priv *priv = rtllib_priv(dev); |
| 824 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 822 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 825 | &priv->rtllib->PowerSaveControl; | 823 | &priv->rtllib->pwr_save_ctrl; |
| 826 | 824 | ||
| 827 | pPSC->RegMaxLPSAwakeIntvl = 5; | 825 | psc->reg_max_lps_awake_intvl = 5; |
| 828 | } | 826 | } |
| 829 | 827 | ||
| 830 | static void _rtl92e_init_priv_variable(struct net_device *dev) | 828 | static void _rtl92e_init_priv_variable(struct net_device *dev) |
| @@ -832,15 +830,12 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 1 unmodified line | |||
| 832 | struct r8192_priv *priv = rtllib_priv(dev); | 830 | struct r8192_priv *priv = rtllib_priv(dev); |
| 833 | u8 i; | 831 | u8 i; |
| 834 | 832 | ||
| 835 | priv->AcmMethod = eAcmWay2_SW; | ||
| 836 | priv->dot11_current_preamble_mode = PREAMBLE_AUTO; | 833 | priv->dot11_current_preamble_mode = PREAMBLE_AUTO; |
| 837 | priv->rtllib->status = 0; | 834 | priv->rtllib->status = 0; |
| 838 | priv->polling_timer_on = 0; | 835 | priv->polling_timer_on = 0; |
| 839 | priv->up_first_time = 1; | 836 | priv->up_first_time = 1; |
| 840 | priv->blinked_ingpio = false; | 837 | priv->blinked_ingpio = false; |
| 841 | priv->bDriverIsGoingToUnload = false; | ||
| 842 | priv->being_init_adapter = false; | 838 | priv->being_init_adapter = false; |
| 843 | priv->initialized_at_probe = false; | ||
| 844 | priv->bdisable_nic = false; | 839 | priv->bdisable_nic = false; |
| 845 | priv->bfirst_init = false; | 840 | priv->bfirst_init = false; |
| 846 | priv->txringcount = 64; | 841 | priv->txringcount = 64; |
| @@ -848,12 +843,12 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 1 unmodified line | |||
| 848 | priv->rxringcount = MAX_RX_COUNT; | 843 | priv->rxringcount = MAX_RX_COUNT; |
| 849 | priv->irq_enabled = 0; | 844 | priv->irq_enabled = 0; |
| 850 | priv->chan = 1; | 845 | priv->chan = 1; |
| 851 | priv->RegChannelPlan = 0xf; | 846 | priv->reg_chnl_plan = 0xf; |
| 852 | priv->rtllib->mode = WIRELESS_MODE_AUTO; | 847 | priv->rtllib->mode = WIRELESS_MODE_AUTO; |
| 853 | priv->rtllib->iw_mode = IW_MODE_INFRA; | 848 | priv->rtllib->iw_mode = IW_MODE_INFRA; |
| 854 | priv->rtllib->bNetPromiscuousMode = false; | 849 | priv->rtllib->net_promiscuous_md = false; |
| 855 | priv->rtllib->IntelPromiscuousModeInfo.bPromiscuousOn = false; | 850 | priv->rtllib->intel_promiscuous_md_info.promiscuous_on = false; |
| 856 | priv->rtllib->IntelPromiscuousModeInfo.bFilterSourceStationFrame = | 851 | priv->rtllib->intel_promiscuous_md_info.fltr_src_sta_frame = |
| 857 | false; | 852 | false; |
| 858 | priv->rtllib->ieee_up = 0; | 853 | priv->rtllib->ieee_up = 0; |
| 859 | priv->retry_rts = DEFAULT_RETRY_RTS; | 854 | priv->retry_rts = DEFAULT_RETRY_RTS; |
| @@ -864,32 +859,21 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 4 unmodified lines | |||
| 864 | priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0; | 859 | priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0; |
| 865 | priv->bcck_in_ch14 = false; | 860 | priv->bcck_in_ch14 = false; |
| 866 | priv->bfsync_processing = false; | 861 | priv->bfsync_processing = false; |
| 867 | priv->CCKPresentAttentuation = 0; | 862 | priv->cck_present_attn = 0; |
| 868 | priv->rfa_txpowertrackingindex = 0; | 863 | priv->rfa_txpowertrackingindex = 0; |
| 869 | priv->rfc_txpowertrackingindex = 0; | 864 | priv->rfc_txpowertrackingindex = 0; |
| 870 | priv->CckPwEnl = 6; | 865 | priv->CckPwEnl = 6; |
| 871 | priv->ScanDelay = 50; | 866 | priv->rst_progress = RESET_TYPE_NORESET; |
| 872 | priv->ResetProgress = RESET_TYPE_NORESET; | ||
| 873 | priv->bForcedSilentReset = false; | ||
| 874 | priv->bDisableNormalResetCheck = false; | ||
| 875 | priv->force_reset = false; | 867 | priv->force_reset = false; |
| 876 | memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32); | 868 | memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32); |
| 877 | 869 | priv->rx_ctr = 0; | |
| 878 | memset(&priv->InterruptLog, 0, sizeof(struct log_int_8190)); | ||
| 879 | priv->RxCounter = 0; | ||
| 880 | priv->rtllib->wx_set_enc = 0; | 870 | priv->rtllib->wx_set_enc = 0; |
| 881 | priv->hw_radio_off = false; | 871 | priv->hw_radio_off = false; |
| 882 | priv->RegRfOff = false; | ||
| 883 | priv->isRFOff = false; | ||
| 884 | priv->bInPowerSaveMode = false; | ||
| 885 | priv->rtllib->rf_off_reason = 0; | 872 | priv->rtllib->rf_off_reason = 0; |
| 886 | priv->rf_change_in_progress = false; | 873 | priv->rf_change_in_progress = false; |
| 887 | priv->bHwRfOffAction = 0; | 874 | priv->hw_rf_off_action = 0; |
| 888 | priv->SetRFPowerStateInProgress = false; | 875 | priv->SetRFPowerStateInProgress = false; |
| 889 | priv->rtllib->PowerSaveControl.bInactivePs = true; | 876 | priv->rtllib->pwr_save_ctrl.bLeisurePs = true; |
| 890 | priv->rtllib->PowerSaveControl.bIPSModeBackup = false; | ||
| 891 | priv->rtllib->PowerSaveControl.bLeisurePs = true; | ||
| 892 | priv->rtllib->PowerSaveControl.bFwCtrlLPS = false; | ||
| 893 | priv->rtllib->LPSDelayCnt = 0; | 877 | priv->rtllib->LPSDelayCnt = 0; |
| 894 | priv->rtllib->sta_sleep = LPS_IS_WAKE; | 878 | priv->rtllib->sta_sleep = LPS_IS_WAKE; |
| 895 | priv->rtllib->rf_power_state = rf_on; | 879 | priv->rtllib->rf_power_state = rf_on; |
| @@ -916,8 +900,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 20 unmodified lines | |||
| 916 | 900 | ||
| 917 | for (i = 0; i < MAX_QUEUE_SIZE; i++) | 901 | for (i = 0; i < MAX_QUEUE_SIZE; i++) |
| 918 | skb_queue_head_init(&priv->rtllib->skb_waitQ[i]); | 902 | skb_queue_head_init(&priv->rtllib->skb_waitQ[i]); |
| 919 | for (i = 0; i < MAX_QUEUE_SIZE; i++) | ||
| 920 | skb_queue_head_init(&priv->rtllib->skb_aggQ[i]); | ||
| 921 | } | 903 | } |
| 922 | 904 | ||
| 923 | static void _rtl92e_init_priv_lock(struct r8192_priv *priv) | 905 | static void _rtl92e_init_priv_lock(struct r8192_priv *priv) |
| @@ -1147,8 +1129,8 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) · 223 unmodified lines | |||
| 1147 | struct rtllib_device *ieee = priv->rtllib; | 1129 | struct rtllib_device *ieee = priv->rtllib; |
| 1148 | unsigned long flag; | 1130 | unsigned long flag; |
| 1149 | 1131 | ||
| 1150 | if (priv->ResetProgress == RESET_TYPE_NORESET) { | 1132 | if (priv->rst_progress == RESET_TYPE_NORESET) { |
| 1151 | priv->ResetProgress = RESET_TYPE_SILENT; | 1133 | priv->rst_progress = RESET_TYPE_SILENT; |
| 1152 | 1134 | ||
| 1153 | spin_lock_irqsave(&priv->rf_ps_lock, flag); | 1135 | spin_lock_irqsave(&priv->rf_ps_lock, flag); |
| 1154 | if (priv->rf_change_in_progress) { | 1136 | if (priv->rf_change_in_progress) { |
| @@ -1245,10 +1227,8 @@ RESET_START: · 90 unmodified lines | |||
| 1245 | rtl92e_cam_restore(dev); | 1227 | rtl92e_cam_restore(dev); |
| 1246 | rtl92e_dm_restore_state(dev); | 1228 | rtl92e_dm_restore_state(dev); |
| 1247 | END: | 1229 | END: |
| 1248 | priv->ResetProgress = RESET_TYPE_NORESET; | 1230 | priv->rst_progress = RESET_TYPE_NORESET; |
| 1249 | priv->reset_count++; | 1231 | priv->reset_count++; |
| 1250 | |||
| 1251 | priv->bForcedSilentReset = false; | ||
| 1252 | priv->bResetInProgress = false; | 1232 | priv->bResetInProgress = false; |
| 1253 | 1233 | ||
| 1254 | rtl92e_writeb(dev, UFWP, 1); | 1234 | rtl92e_writeb(dev, UFWP, 1); |
| @@ -1264,15 +1244,15 @@ static void _rtl92e_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum, · 9 unmodified lines | |||
| 1264 | *TotalRxBcnNum = 0; | 1244 | *TotalRxBcnNum = 0; |
| 1265 | *TotalRxDataNum = 0; | 1245 | *TotalRxDataNum = 0; |
| 1266 | 1246 | ||
| 1267 | SlotIndex = (priv->rtllib->LinkDetectInfo.SlotIndex++) % | 1247 | SlotIndex = (priv->rtllib->link_detect_info.SlotIndex++) % |
| 1268 | (priv->rtllib->LinkDetectInfo.SlotNum); | 1248 | (priv->rtllib->link_detect_info.SlotNum); |
| 1269 | priv->rtllib->LinkDetectInfo.RxBcnNum[SlotIndex] = | 1249 | priv->rtllib->link_detect_info.RxBcnNum[SlotIndex] = |
| 1270 | priv->rtllib->LinkDetectInfo.NumRecvBcnInPeriod; | 1250 | priv->rtllib->link_detect_info.NumRecvBcnInPeriod; |
| 1271 | priv->rtllib->LinkDetectInfo.RxDataNum[SlotIndex] = | 1251 | priv->rtllib->link_detect_info.RxDataNum[SlotIndex] = |
| 1272 | priv->rtllib->LinkDetectInfo.NumRecvDataInPeriod; | 1252 | priv->rtllib->link_detect_info.NumRecvDataInPeriod; |
| 1273 | for (i = 0; i < priv->rtllib->LinkDetectInfo.SlotNum; i++) { | 1253 | for (i = 0; i < priv->rtllib->link_detect_info.SlotNum; i++) { |
| 1274 | *TotalRxBcnNum += priv->rtllib->LinkDetectInfo.RxBcnNum[i]; | 1254 | *TotalRxBcnNum += priv->rtllib->link_detect_info.RxBcnNum[i]; |
| 1275 | *TotalRxDataNum += priv->rtllib->LinkDetectInfo.RxDataNum[i]; | 1255 | *TotalRxDataNum += priv->rtllib->link_detect_info.RxDataNum[i]; |
| 1276 | } | 1256 | } |
| 1277 | } | 1257 | } |
| 1278 | 1258 | ||
| @@ -1285,8 +1265,8 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 6 unmodified lines | |||
| 1285 | enum reset_type ResetType = RESET_TYPE_NORESET; | 1265 | enum reset_type ResetType = RESET_TYPE_NORESET; |
| 1286 | static u8 check_reset_cnt; | 1266 | static u8 check_reset_cnt; |
| 1287 | unsigned long flags; | 1267 | unsigned long flags; |
| 1288 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 1268 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 1289 | (&priv->rtllib->PowerSaveControl); | 1269 | (&priv->rtllib->pwr_save_ctrl); |
| 1290 | bool bBusyTraffic = false; | 1270 | bool bBusyTraffic = false; |
| 1291 | bool bHigherBusyTraffic = false; | 1271 | bool bHigherBusyTraffic = false; |
| 1292 | bool bHigherBusyRxTraffic = false; | 1272 | bool bHigherBusyRxTraffic = false; |
| @@ -1309,31 +1289,31 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 16 unmodified lines | |||
| 1309 | RTLLIB_NOLINK) && | 1289 | RTLLIB_NOLINK) && |
| 1310 | (ieee->rf_power_state == rf_on) && !ieee->is_set_key && | 1290 | (ieee->rf_power_state == rf_on) && !ieee->is_set_key && |
| 1311 | (!ieee->proto_stoppping) && !ieee->wx_set_enc) { | 1291 | (!ieee->proto_stoppping) && !ieee->wx_set_enc) { |
| 1312 | if ((ieee->PowerSaveControl.ReturnPoint == | 1292 | if ((ieee->pwr_save_ctrl.ReturnPoint == |
| 1313 | IPS_CALLBACK_NONE) && | 1293 | IPS_CALLBACK_NONE) && |
| 1314 | (!ieee->bNetPromiscuousMode)) { | 1294 | (!ieee->net_promiscuous_md)) { |
| 1315 | rtl92e_ips_enter(dev); | 1295 | rtl92e_ips_enter(dev); |
| 1316 | } | 1296 | } |
| 1317 | } | 1297 | } |
| 1318 | } | 1298 | } |
| 1319 | if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode == | 1299 | if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode == |
| 1320 | IW_MODE_INFRA) && (!ieee->bNetPromiscuousMode)) { | 1300 | IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) { |
| 1321 | if (ieee->LinkDetectInfo.NumRxOkInPeriod > 100 || | 1301 | if (ieee->link_detect_info.NumRxOkInPeriod > 100 || |
| 1322 | ieee->LinkDetectInfo.NumTxOkInPeriod > 100) | 1302 | ieee->link_detect_info.NumTxOkInPeriod > 100) |
| 1323 | bBusyTraffic = true; | 1303 | bBusyTraffic = true; |
| 1324 | 1304 | ||
| 1325 | if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 || | 1305 | if (ieee->link_detect_info.NumRxOkInPeriod > 4000 || |
| 1326 | ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) { | 1306 | ieee->link_detect_info.NumTxOkInPeriod > 4000) { |
| 1327 | bHigherBusyTraffic = true; | 1307 | bHigherBusyTraffic = true; |
| 1328 | if (ieee->LinkDetectInfo.NumRxOkInPeriod > 5000) | 1308 | if (ieee->link_detect_info.NumRxOkInPeriod > 5000) |
| 1329 | bHigherBusyRxTraffic = true; | 1309 | bHigherBusyRxTraffic = true; |
| 1330 | else | 1310 | else |
| 1331 | bHigherBusyRxTraffic = false; | 1311 | bHigherBusyRxTraffic = false; |
| 1332 | } | 1312 | } |
| 1333 | 1313 | ||
| 1334 | if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod + | 1314 | if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + |
| 1335 | ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) || | 1315 | ieee->link_detect_info.NumTxOkInPeriod) > 8) || |
| 1336 | (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) | 1316 | (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) |
| 1337 | bEnterPS = false; | 1317 | bEnterPS = false; |
| 1338 | else | 1318 | else |
| 1339 | bEnterPS = true; | 1319 | bEnterPS = true; |
| @@ -1350,13 +1330,13 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 10 unmodified lines | |||
| 1350 | rtl92e_leisure_ps_leave(dev); | 1330 | rtl92e_leisure_ps_leave(dev); |
| 1351 | } | 1331 | } |
| 1352 | 1332 | ||
| 1353 | ieee->LinkDetectInfo.NumRxOkInPeriod = 0; | 1333 | ieee->link_detect_info.NumRxOkInPeriod = 0; |
| 1354 | ieee->LinkDetectInfo.NumTxOkInPeriod = 0; | 1334 | ieee->link_detect_info.NumTxOkInPeriod = 0; |
| 1355 | ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0; | 1335 | ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; |
| 1356 | ieee->LinkDetectInfo.bBusyTraffic = bBusyTraffic; | 1336 | ieee->link_detect_info.bBusyTraffic = bBusyTraffic; |
| 1357 | 1337 | ||
| 1358 | ieee->LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic; | 1338 | ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic; |
| 1359 | ieee->LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic; | 1339 | ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic; |
| 1360 | 1340 | ||
| 1361 | if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { | 1341 | if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { |
| 1362 | u32 TotalRxBcnNum = 0; | 1342 | u32 TotalRxBcnNum = 0; |
| @@ -1397,28 +1377,26 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 34 unmodified lines | |||
| 1397 | 1377 | ||
| 1398 | priv->check_roaming_cnt = 0; | 1378 | priv->check_roaming_cnt = 0; |
| 1399 | } | 1379 | } |
| 1400 | ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; | 1380 | ieee->link_detect_info.NumRecvBcnInPeriod = 0; |
| 1401 | ieee->LinkDetectInfo.NumRecvDataInPeriod = 0; | 1381 | ieee->link_detect_info.NumRecvDataInPeriod = 0; |
| 1402 | } | 1382 | } |
| 1403 | 1383 | ||
| 1404 | spin_lock_irqsave(&priv->tx_lock, flags); | 1384 | spin_lock_irqsave(&priv->tx_lock, flags); |
| 1405 | if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) && | 1385 | if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) && |
| 1406 | (!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) { | 1386 | (!priv->rf_change_in_progress) && (!psc->bSwRfProcessing)) { |
| 1407 | ResetType = _rtl92e_if_check_reset(dev); | 1387 | ResetType = _rtl92e_if_check_reset(dev); |
| 1408 | check_reset_cnt = 3; | 1388 | check_reset_cnt = 3; |
| 1409 | } | 1389 | } |
| 1410 | spin_unlock_irqrestore(&priv->tx_lock, flags); | 1390 | spin_unlock_irqrestore(&priv->tx_lock, flags); |
| 1411 | 1391 | ||
| 1412 | if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) { | 1392 | if (ResetType == RESET_TYPE_NORMAL) { |
| 1413 | priv->ResetProgress = RESET_TYPE_NORMAL; | 1393 | priv->rst_progress = RESET_TYPE_NORMAL; |
| 1414 | return; | 1394 | return; |
| 1415 | } | 1395 | } |
| 1416 | 1396 | ||
| 1417 | if (((priv->force_reset) || (!priv->bDisableNormalResetCheck && | 1397 | if ((priv->force_reset || ResetType == RESET_TYPE_SILENT)) |
| 1418 | ResetType == RESET_TYPE_SILENT))) | ||
| 1419 | _rtl92e_if_silent_reset(dev); | 1398 | _rtl92e_if_silent_reset(dev); |
| 1420 | priv->force_reset = false; | 1399 | priv->force_reset = false; |
| 1421 | priv->bForcedSilentReset = false; | ||
| 1422 | priv->bResetInProgress = false; | 1400 | priv->bResetInProgress = false; |
| 1423 | } | 1401 | } |
| 1424 | 1402 | ||
| @@ -1554,8 +1532,8 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) · 129 unmodified lines | |||
| 1554 | } | 1532 | } |
| 1555 | 1533 | ||
| 1556 | tcb_desc->RATRIndex = 7; | 1534 | tcb_desc->RATRIndex = 7; |
| 1557 | tcb_desc->bTxDisableRateFallBack = 1; | 1535 | tcb_desc->tx_dis_rate_fallback = 1; |
| 1558 | tcb_desc->bTxUseDriverAssingedRate = 1; | 1536 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 1559 | tcb_desc->bTxEnableFwCalcDur = 1; | 1537 | tcb_desc->bTxEnableFwCalcDur = 1; |
| 1560 | skb_push(skb, priv->rtllib->tx_headroom); | 1538 | skb_push(skb, priv->rtllib->tx_headroom); |
| 1561 | ret = _rtl92e_tx(dev, skb); | 1539 | ret = _rtl92e_tx(dev, skb); |
| @@ -2205,7 +2183,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev) · 643 unmodified lines | |||
| 2205 | 2183 | ||
| 2206 | if (inta & IMR_ROK) { | 2184 | if (inta & IMR_ROK) { |
| 2207 | priv->stats.rxint++; | 2185 | priv->stats.rxint++; |
| 2208 | priv->InterruptLog.nIMR_ROK++; | ||
| 2209 | tasklet_schedule(&priv->irq_rx_tasklet); | 2186 | tasklet_schedule(&priv->irq_rx_tasklet); |
| 2210 | } | 2187 | } |
| 2211 | 2188 | ||
| @@ -2229,25 +2206,25 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev) · 17 unmodified lines | |||
| 2229 | 2206 | ||
| 2230 | if (inta & IMR_BKDOK) { | 2207 | if (inta & IMR_BKDOK) { |
| 2231 | priv->stats.txbkokint++; | 2208 | priv->stats.txbkokint++; |
| 2232 | priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; | 2209 | priv->rtllib->link_detect_info.NumTxOkInPeriod++; |
| 2233 | _rtl92e_tx_isr(dev, BK_QUEUE); | 2210 | _rtl92e_tx_isr(dev, BK_QUEUE); |
| 2234 | } | 2211 | } |
| 2235 | 2212 | ||
| 2236 | if (inta & IMR_BEDOK) { | 2213 | if (inta & IMR_BEDOK) { |
| 2237 | priv->stats.txbeokint++; | 2214 | priv->stats.txbeokint++; |
| 2238 | priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; | 2215 | priv->rtllib->link_detect_info.NumTxOkInPeriod++; |
| 2239 | _rtl92e_tx_isr(dev, BE_QUEUE); | 2216 | _rtl92e_tx_isr(dev, BE_QUEUE); |
| 2240 | } | 2217 | } |
| 2241 | 2218 | ||
| 2242 | if (inta & IMR_VIDOK) { | 2219 | if (inta & IMR_VIDOK) { |
| 2243 | priv->stats.txviokint++; | 2220 | priv->stats.txviokint++; |
| 2244 | priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; | 2221 | priv->rtllib->link_detect_info.NumTxOkInPeriod++; |
| 2245 | _rtl92e_tx_isr(dev, VI_QUEUE); | 2222 | _rtl92e_tx_isr(dev, VI_QUEUE); |
| 2246 | } | 2223 | } |
| 2247 | 2224 | ||
| 2248 | if (inta & IMR_VODOK) { | 2225 | if (inta & IMR_VODOK) { |
| 2249 | priv->stats.txvookint++; | 2226 | priv->stats.txvookint++; |
| 2250 | priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; | 2227 | priv->rtllib->link_detect_info.NumTxOkInPeriod++; |
| 2251 | _rtl92e_tx_isr(dev, VO_QUEUE); | 2228 | _rtl92e_tx_isr(dev, VO_QUEUE); |
| 2252 | } | 2229 | } |
| 2253 | 2230 | ||
| @@ -2437,8 +2414,8 @@ bool rtl92e_enable_nic(struct net_device *dev) · 183 unmodified lines | |||
| 2437 | { | 2414 | { |
| 2438 | bool init_status = true; | 2415 | bool init_status = true; |
| 2439 | struct r8192_priv *priv = rtllib_priv(dev); | 2416 | struct r8192_priv *priv = rtllib_priv(dev); |
| 2440 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 2417 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 2441 | (&priv->rtllib->PowerSaveControl); | 2418 | (&priv->rtllib->pwr_save_ctrl); |
| 2442 | 2419 | ||
| 2443 | if (!priv->up) { | 2420 | if (!priv->up) { |
| 2444 | netdev_warn(dev, "%s(): Driver is already down!\n", __func__); | 2421 | netdev_warn(dev, "%s(): Driver is already down!\n", __func__); |
| @@ -2453,7 +2430,7 @@ bool rtl92e_enable_nic(struct net_device *dev) · 8 unmodified lines | |||
| 2453 | priv->bdisable_nic = false; | 2430 | priv->bdisable_nic = false; |
| 2454 | return false; | 2431 | return false; |
| 2455 | } | 2432 | } |
| 2456 | RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); | 2433 | RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); |
| 2457 | priv->bfirst_init = false; | 2434 | priv->bfirst_init = false; |
| 2458 | 2435 | ||
| 2459 | rtl92e_irq_enable(dev); | 2436 | rtl92e_irq_enable(dev); |
| @@ -234,15 +234,6 @@ struct rt_stats { · 233 unmodified lines | |||
| 234 | u32 CurrentShowTxate; | 234 | u32 CurrentShowTxate; |
| 235 | }; | 235 | }; |
| 236 | 236 | ||
| 237 | struct channel_access_setting { | ||
| 238 | u16 SIFS_Timer; | ||
| 239 | u16 DIFS_Timer; | ||
| 240 | u16 SlotTimeTimer; | ||
| 241 | u16 EIFS_Timer; | ||
| 242 | u16 CWminIndex; | ||
| 243 | u16 CWmaxIndex; | ||
| 244 | }; | ||
| 245 | |||
| 246 | struct init_gain { | 237 | struct init_gain { |
| 247 | u8 xaagccore1; | 238 | u8 xaagccore1; |
| 248 | u8 xbagccore1; | 239 | u8 xbagccore1; |
| @@ -309,9 +300,7 @@ struct r8192_priv { · 60 unmodified lines | |||
| 309 | 300 | ||
| 310 | bool bfirst_init; | 301 | bool bfirst_init; |
| 311 | bool bfirst_after_down; | 302 | bool bfirst_after_down; |
| 312 | bool initialized_at_probe; | ||
| 313 | bool being_init_adapter; | 303 | bool being_init_adapter; |
| 314 | bool bDriverIsGoingToUnload; | ||
| 315 | 304 | ||
| 316 | int irq; | 305 | int irq; |
| 317 | short irq_enabled; | 306 | short irq_enabled; |
| @@ -323,16 +312,11 @@ struct r8192_priv { · 5 unmodified lines | |||
| 323 | struct delayed_work txpower_tracking_wq; | 312 | struct delayed_work txpower_tracking_wq; |
| 324 | struct delayed_work rfpath_check_wq; | 313 | struct delayed_work rfpath_check_wq; |
| 325 | struct delayed_work gpio_change_rf_wq; | 314 | struct delayed_work gpio_change_rf_wq; |
| 326 | |||
| 327 | struct channel_access_setting ChannelAccessSetting; | ||
| 328 | |||
| 329 | struct rtl819x_ops *ops; | 315 | struct rtl819x_ops *ops; |
| 330 | struct rtllib_device *rtllib; | 316 | struct rtllib_device *rtllib; |
| 331 | 317 | ||
| 332 | struct work_struct reset_wq; | 318 | struct work_struct reset_wq; |
| 333 | 319 | ||
| 334 | struct log_int_8190 InterruptLog; | ||
| 335 | |||
| 336 | enum rt_customer_id CustomerID; | 320 | enum rt_customer_id CustomerID; |
| 337 | 321 | ||
| 338 | 322 | ||
| @@ -341,8 +325,6 @@ struct r8192_priv { · 2 unmodified lines | |||
| 341 | struct bb_reg_definition PHYRegDef[4]; | 325 | struct bb_reg_definition PHYRegDef[4]; |
| 342 | struct rate_adaptive rate_adaptive; | 326 | struct rate_adaptive rate_adaptive; |
| 343 | 327 | ||
| 344 | enum acm_method AcmMethod; | ||
| 345 | |||
| 346 | struct rt_firmware *pFirmware; | 328 | struct rt_firmware *pFirmware; |
| 347 | enum rtl819x_loopback LoopbackMode; | 329 | enum rtl819x_loopback LoopbackMode; |
| 348 | 330 | ||
| @@ -410,8 +392,6 @@ struct r8192_priv { · 61 unmodified lines | |||
| 410 | short chan; | 392 | short chan; |
| 411 | short sens; | 393 | short sens; |
| 412 | short max_sens; | 394 | short max_sens; |
| 413 | |||
| 414 | u8 ScanDelay; | ||
| 415 | bool ps_force; | 395 | bool ps_force; |
| 416 | 396 | ||
| 417 | u32 irq_mask[2]; | 397 | u32 irq_mask[2]; |
| @@ -470,13 +450,9 @@ struct r8192_priv { · 52 unmodified lines | |||
| 470 | 450 | ||
| 471 | bool bTXPowerDataReadFromEEPORM; | 451 | bool bTXPowerDataReadFromEEPORM; |
| 472 | 452 | ||
| 473 | u16 RegChannelPlan; | 453 | u16 reg_chnl_plan; |
| 474 | u16 ChannelPlan; | 454 | u16 ChannelPlan; |
| 475 | 455 | u8 hw_rf_off_action; | |
| 476 | bool RegRfOff; | ||
| 477 | bool isRFOff; | ||
| 478 | bool bInPowerSaveMode; | ||
| 479 | u8 bHwRfOffAction; | ||
| 480 | 456 | ||
| 481 | bool rf_change_in_progress; | 457 | bool rf_change_in_progress; |
| 482 | bool SetRFPowerStateInProgress; | 458 | bool SetRFPowerStateInProgress; |
| @@ -490,7 +466,7 @@ struct r8192_priv { · 7 unmodified lines | |||
| 490 | u8 CCKPresentAttentuation_20Mdefault; | 466 | u8 CCKPresentAttentuation_20Mdefault; |
| 491 | u8 CCKPresentAttentuation_40Mdefault; | 467 | u8 CCKPresentAttentuation_40Mdefault; |
| 492 | s8 CCKPresentAttentuation_difference; | 468 | s8 CCKPresentAttentuation_difference; |
| 493 | s8 CCKPresentAttentuation; | 469 | s8 cck_present_attn; |
| 494 | long undecorated_smoothed_pwdb; | 470 | long undecorated_smoothed_pwdb; |
| 495 | 471 | ||
| 496 | u32 MCSTxPowerLevelOriginalOffset[6]; | 472 | u32 MCSTxPowerLevelOriginalOffset[6]; |
| @@ -543,11 +519,9 @@ struct r8192_priv { · 46 unmodified lines | |||
| 543 | 519 | ||
| 544 | u32 reset_count; | 520 | u32 reset_count; |
| 545 | 521 | ||
| 546 | enum reset_type ResetProgress; | 522 | enum reset_type rst_progress; |
| 547 | bool bForcedSilentReset; | ||
| 548 | bool bDisableNormalResetCheck; | ||
| 549 | u16 TxCounter; | 523 | u16 TxCounter; |
| 550 | u16 RxCounter; | 524 | u16 rx_ctr; |
| 551 | bool bResetInProgress; | 525 | bool bResetInProgress; |
| 552 | bool force_reset; | 526 | bool force_reset; |
| 553 | bool force_lps; | 527 | bool force_lps; |
| @@ -267,10 +267,8 @@ static void _rtl92e_dm_check_ac_dc_power(struct net_device *dev) · 266 unmodified lines | |||
| 267 | "PATH=/usr/bin:/bin", | 267 | "PATH=/usr/bin:/bin", |
| 268 | NULL}; | 268 | NULL}; |
| 269 | 269 | ||
| 270 | if (priv->ResetProgress == RESET_TYPE_SILENT) { | 270 | if (priv->rst_progress == RESET_TYPE_SILENT) |
| 271 | return; | 271 | return; |
| 272 | } | ||
| 273 | |||
| 274 | if (priv->rtllib->state != RTLLIB_LINKED) | 272 | if (priv->rtllib->state != RTLLIB_LINKED) |
| 275 | return; | 273 | return; |
| 276 | call_usermodehelper(ac_dc_script, argv, envp, UMH_WAIT_PROC); | 274 | call_usermodehelper(ac_dc_script, argv, envp, UMH_WAIT_PROC); |
| @@ -323,16 +321,15 @@ void rtl92e_init_adaptive_rate(struct net_device *dev) · 46 unmodified lines | |||
| 323 | static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) | 321 | static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) |
| 324 | { | 322 | { |
| 325 | struct r8192_priv *priv = rtllib_priv(dev); | 323 | struct r8192_priv *priv = rtllib_priv(dev); |
| 326 | struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; | 324 | struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; |
| 327 | struct rate_adaptive *pra = &priv->rate_adaptive; | 325 | struct rate_adaptive *pra = &priv->rate_adaptive; |
| 328 | u32 currentRATR, targetRATR = 0; | 326 | u32 currentRATR, targetRATR = 0; |
| 329 | u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; | 327 | u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; |
| 330 | bool bshort_gi_enabled = false; | 328 | bool bshort_gi_enabled = false; |
| 331 | static u8 ping_rssi_state; | 329 | static u8 ping_rssi_state; |
| 332 | 330 | ||
| 333 | if (!priv->up) { | 331 | if (!priv->up) |
| 334 | return; | 332 | return; |
| 335 | } | ||
| 336 | 333 | ||
| 337 | if (pra->rate_adaptive_disabled) | 334 | if (pra->rate_adaptive_disabled) |
| 338 | return; | 335 | return; |
| @@ -343,10 +340,10 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) · 4 unmodified lines | |||
| 343 | 340 | ||
| 344 | if (priv->rtllib->state == RTLLIB_LINKED) { | 341 | if (priv->rtllib->state == RTLLIB_LINKED) { |
| 345 | 342 | ||
| 346 | bshort_gi_enabled = (pHTInfo->cur_tx_bw40mhz && | 343 | bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && |
| 347 | pHTInfo->bCurShortGI40MHz) || | 344 | ht_info->bCurShortGI40MHz) || |
| 348 | (!pHTInfo->cur_tx_bw40mhz && | 345 | (!ht_info->cur_tx_bw40mhz && |
| 349 | pHTInfo->bCurShortGI20MHz); | 346 | ht_info->bCurShortGI20MHz); |
| 350 | 347 | ||
| 351 | pra->upper_rssi_threshold_ratr = | 348 | pra->upper_rssi_threshold_ratr = |
| 352 | (pra->upper_rssi_threshold_ratr & (~BIT31)) | | 349 | (pra->upper_rssi_threshold_ratr & (~BIT31)) | |
| @@ -631,9 +628,9 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) · 278 unmodified lines | |||
| 631 | 628 | ||
| 632 | for (j = 0; j <= 30; j++) { | 629 | for (j = 0; j <= 30; j++) { |
| 633 | 630 | ||
| 634 | tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING; | 631 | tx_cmd.op = TXCMD_SET_TX_PWR_TRACKING; |
| 635 | tx_cmd.Length = 4; | 632 | tx_cmd.length = 4; |
| 636 | tx_cmd.Value = Value; | 633 | tx_cmd.value = Value; |
| 637 | rtl92e_send_cmd_pkt(dev, DESC_PACKET_TYPE_NORMAL, (u8 *)&tx_cmd, | 634 | rtl92e_send_cmd_pkt(dev, DESC_PACKET_TYPE_NORMAL, (u8 *)&tx_cmd, |
| 638 | sizeof(struct dcmd_txcmd)); | 635 | sizeof(struct dcmd_txcmd)); |
| 639 | mdelay(1); | 636 | mdelay(1); |
| @@ -719,21 +716,21 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) · 79 unmodified lines | |||
| 719 | } | 716 | } |
| 720 | 717 | ||
| 721 | if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) | 718 | if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) |
| 722 | priv->CCKPresentAttentuation = | 719 | priv->cck_present_attn = |
| 723 | priv->CCKPresentAttentuation_20Mdefault + | 720 | priv->CCKPresentAttentuation_20Mdefault + |
| 724 | priv->CCKPresentAttentuation_difference; | 721 | priv->CCKPresentAttentuation_difference; |
| 725 | else | 722 | else |
| 726 | priv->CCKPresentAttentuation = | 723 | priv->cck_present_attn = |
| 727 | priv->CCKPresentAttentuation_40Mdefault + | 724 | priv->CCKPresentAttentuation_40Mdefault + |
| 728 | priv->CCKPresentAttentuation_difference; | 725 | priv->CCKPresentAttentuation_difference; |
| 729 | 726 | ||
| 730 | if (priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1)) | 727 | if (priv->cck_present_attn > (CCKTxBBGainTableLength-1)) |
| 731 | priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1; | 728 | priv->cck_present_attn = CCKTxBBGainTableLength-1; |
| 732 | if (priv->CCKPresentAttentuation < 0) | 729 | if (priv->cck_present_attn < 0) |
| 733 | priv->CCKPresentAttentuation = 0; | 730 | priv->cck_present_attn = 0; |
| 734 | 731 | ||
| 735 | if (priv->CCKPresentAttentuation > -1 && | 732 | if (priv->cck_present_attn > -1 && |
| 736 | priv->CCKPresentAttentuation < CCKTxBBGainTableLength) { | 733 | priv->cck_present_attn < CCKTxBBGainTableLength) { |
| 737 | if (priv->rtllib->current_network.channel == 14 && | 734 | if (priv->rtllib->current_network.channel == 14 && |
| 738 | !priv->bcck_in_ch14) { | 735 | !priv->bcck_in_ch14) { |
| 739 | priv->bcck_in_ch14 = true; | 736 | priv->bcck_in_ch14 = true; |
| @@ -777,9 +774,8 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) · 37 unmodified lines | |||
| 777 | tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, | 774 | tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, |
| 778 | bMaskDWord); | 775 | bMaskDWord); |
| 779 | for (i = 0; i < OFDM_Table_Length; i++) { | 776 | for (i = 0; i < OFDM_Table_Length; i++) { |
| 780 | if (tmpRegA == OFDMSwingTable[i]) { | 777 | if (tmpRegA == OFDMSwingTable[i]) |
| 781 | priv->OFDM_index[0] = i; | 778 | priv->OFDM_index[0] = i; |
| 782 | } | ||
| 783 | } | 779 | } |
| 784 | 780 | ||
| 785 | TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); | 781 | TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); |
| @@ -967,7 +963,7 @@ static void _rtl92e_dm_cck_tx_power_adjust_tssi(struct net_device *dev, · 181 unmodified lines | |||
| 967 | { | 963 | { |
| 968 | u32 TempVal; | 964 | u32 TempVal; |
| 969 | struct r8192_priv *priv = rtllib_priv(dev); | 965 | struct r8192_priv *priv = rtllib_priv(dev); |
| 970 | u8 attenuation = priv->CCKPresentAttentuation; | 966 | u8 attenuation = priv->cck_present_attn; |
| 971 | 967 | ||
| 972 | TempVal = 0; | 968 | TempVal = 0; |
| 973 | if (!bInCH14) { | 969 | if (!bInCH14) { |
| @@ -1066,9 +1062,8 @@ void rtl92e_dm_restore_state(struct net_device *dev) · 92 unmodified lines | |||
| 1066 | u32 reg_ratr = priv->rate_adaptive.last_ratr; | 1062 | u32 reg_ratr = priv->rate_adaptive.last_ratr; |
| 1067 | u32 ratr_value; | 1063 | u32 ratr_value; |
| 1068 | 1064 | ||
| 1069 | if (!priv->up) { | 1065 | if (!priv->up) |
| 1070 | return; | 1066 | return; |
| 1071 | } | ||
| 1072 | 1067 | ||
| 1073 | if (priv->rate_adaptive.rate_adaptive_disabled) | 1068 | if (priv->rate_adaptive.rate_adaptive_disabled) |
| 1074 | return; | 1069 | return; |
| @@ -1143,8 +1138,8 @@ static void _rtl92e_dm_dig_init(struct net_device *dev) · 68 unmodified lines | |||
| 1143 | 1138 | ||
| 1144 | dm_digtable.dig_state = DM_STA_DIG_MAX; | 1139 | dm_digtable.dig_state = DM_STA_DIG_MAX; |
| 1145 | dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; | 1140 | dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; |
| 1146 | dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT; | 1141 | dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; |
| 1147 | dm_digtable.PreSTAConnectState = DIG_STA_DISCONNECT; | 1142 | dm_digtable.pre_sta_connect_state = DIG_STA_DISCONNECT; |
| 1148 | 1143 | ||
| 1149 | dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW; | 1144 | dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW; |
| 1150 | dm_digtable.rssi_high_thresh = DM_DIG_THRESH_HIGH; | 1145 | dm_digtable.rssi_high_thresh = DM_DIG_THRESH_HIGH; |
| @@ -1212,9 +1207,9 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) · 61 unmodified lines | |||
| 1212 | } | 1207 | } |
| 1213 | 1208 | ||
| 1214 | if (priv->rtllib->state == RTLLIB_LINKED) | 1209 | if (priv->rtllib->state == RTLLIB_LINKED) |
| 1215 | dm_digtable.CurSTAConnectState = DIG_STA_CONNECT; | 1210 | dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT; |
| 1216 | else | 1211 | else |
| 1217 | dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT; | 1212 | dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; |
| 1218 | 1213 | ||
| 1219 | 1214 | ||
| 1220 | dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; | 1215 | dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; |
| @@ -1223,7 +1218,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) · 2 unmodified lines | |||
| 1223 | _rtl92e_dm_cs_ratio(dev); | 1218 | _rtl92e_dm_cs_ratio(dev); |
| 1224 | if (dm_digtable.dig_algorithm_switch) | 1219 | if (dm_digtable.dig_algorithm_switch) |
| 1225 | dm_digtable.dig_algorithm_switch = 0; | 1220 | dm_digtable.dig_algorithm_switch = 0; |
| 1226 | dm_digtable.PreSTAConnectState = dm_digtable.CurSTAConnectState; | 1221 | dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state; |
| 1227 | 1222 | ||
| 1228 | } | 1223 | } |
| 1229 | 1224 | ||
| @@ -1373,8 +1368,8 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev) · 143 unmodified lines | |||
| 1373 | return; | 1368 | return; |
| 1374 | } | 1369 | } |
| 1375 | 1370 | ||
| 1376 | if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { | 1371 | if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { |
| 1377 | if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { | 1372 | if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { |
| 1378 | long gain_range = dm_digtable.rssi_val + 10 - | 1373 | long gain_range = dm_digtable.rssi_val + 10 - |
| 1379 | dm_digtable.backoff_val; | 1374 | dm_digtable.backoff_val; |
| 1380 | gain_range = clamp_t(long, gain_range, | 1375 | gain_range = clamp_t(long, gain_range, |
| @@ -1424,8 +1419,8 @@ static void _rtl92e_dm_pd_th(struct net_device *dev) · 43 unmodified lines | |||
| 1424 | reset_cnt = 0; | 1419 | reset_cnt = 0; |
| 1425 | } | 1420 | } |
| 1426 | 1421 | ||
| 1427 | if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { | 1422 | if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { |
| 1428 | if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { | 1423 | if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { |
| 1429 | if (dm_digtable.rssi_val >= | 1424 | if (dm_digtable.rssi_val >= |
| 1430 | dm_digtable.rssi_high_power_highthresh) | 1425 | dm_digtable.rssi_high_power_highthresh) |
| 1431 | dm_digtable.curpd_thstate = | 1426 | dm_digtable.curpd_thstate = |
| @@ -1492,8 +1487,8 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev) · 60 unmodified lines | |||
| 1492 | reset_cnt = 0; | 1487 | reset_cnt = 0; |
| 1493 | } | 1488 | } |
| 1494 | 1489 | ||
| 1495 | if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { | 1490 | if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { |
| 1496 | if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { | 1491 | if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { |
| 1497 | if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh) | 1492 | if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh) |
| 1498 | dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; | 1493 | dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; |
| 1499 | else if (dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) | 1494 | else if (dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) |
| @@ -1537,7 +1532,7 @@ void rtl92e_dm_init_edca_turbo(struct net_device *dev) · 37 unmodified lines | |||
| 1537 | static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) | 1532 | static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) |
| 1538 | { | 1533 | { |
| 1539 | struct r8192_priv *priv = rtllib_priv(dev); | 1534 | struct r8192_priv *priv = rtllib_priv(dev); |
| 1540 | struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; | 1535 | struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; |
| 1541 | 1536 | ||
| 1542 | static unsigned long lastTxOkCnt; | 1537 | static unsigned long lastTxOkCnt; |
| 1543 | static unsigned long lastRxOkCnt; | 1538 | static unsigned long lastRxOkCnt; |
| @@ -1548,18 +1543,18 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 4 unmodified lines | |||
| 1548 | goto dm_CheckEdcaTurbo_EXIT; | 1543 | goto dm_CheckEdcaTurbo_EXIT; |
| 1549 | if (priv->rtllib->state != RTLLIB_LINKED) | 1544 | if (priv->rtllib->state != RTLLIB_LINKED) |
| 1550 | goto dm_CheckEdcaTurbo_EXIT; | 1545 | goto dm_CheckEdcaTurbo_EXIT; |
| 1551 | if (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) | 1546 | if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) |
| 1552 | goto dm_CheckEdcaTurbo_EXIT; | 1547 | goto dm_CheckEdcaTurbo_EXIT; |
| 1553 | 1548 | ||
| 1554 | if (!priv->rtllib->bis_any_nonbepkts) { | 1549 | if (!priv->rtllib->bis_any_nonbepkts) { |
| 1555 | curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; | 1550 | curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; |
| 1556 | curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; | 1551 | curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; |
| 1557 | if (pHTInfo->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { | 1552 | if (ht_info->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { |
| 1558 | if (curTxOkCnt > 4*curRxOkCnt) { | 1553 | if (curTxOkCnt > 4*curRxOkCnt) { |
| 1559 | if (priv->bis_cur_rdlstate || | 1554 | if (priv->bis_cur_rdlstate || |
| 1560 | !priv->bcurrent_turbo_EDCA) { | 1555 | !priv->bcurrent_turbo_EDCA) { |
| 1561 | rtl92e_writel(dev, EDCAPARA_BE, | 1556 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1562 | edca_setting_UL[pHTInfo->IOTPeer]); | 1557 | edca_setting_UL[ht_info->IOTPeer]); |
| 1563 | priv->bis_cur_rdlstate = false; | 1558 | priv->bis_cur_rdlstate = false; |
| 1564 | } | 1559 | } |
| 1565 | } else { | 1560 | } else { |
| @@ -1567,10 +1562,10 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 1 unmodified line | |||
| 1567 | !priv->bcurrent_turbo_EDCA) { | 1562 | !priv->bcurrent_turbo_EDCA) { |
| 1568 | if (priv->rtllib->mode == WIRELESS_MODE_G) | 1563 | if (priv->rtllib->mode == WIRELESS_MODE_G) |
| 1569 | rtl92e_writel(dev, EDCAPARA_BE, | 1564 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1570 | edca_setting_DL_GMode[pHTInfo->IOTPeer]); | 1565 | edca_setting_DL_GMode[ht_info->IOTPeer]); |
| 1571 | else | 1566 | else |
| 1572 | rtl92e_writel(dev, EDCAPARA_BE, | 1567 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1573 | edca_setting_DL[pHTInfo->IOTPeer]); | 1568 | edca_setting_DL[ht_info->IOTPeer]); |
| 1574 | priv->bis_cur_rdlstate = true; | 1569 | priv->bis_cur_rdlstate = true; |
| 1575 | } | 1570 | } |
| 1576 | } | 1571 | } |
| @@ -1581,17 +1576,17 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 4 unmodified lines | |||
| 1581 | !priv->bcurrent_turbo_EDCA) { | 1576 | !priv->bcurrent_turbo_EDCA) { |
| 1582 | if (priv->rtllib->mode == WIRELESS_MODE_G) | 1577 | if (priv->rtllib->mode == WIRELESS_MODE_G) |
| 1583 | rtl92e_writel(dev, EDCAPARA_BE, | 1578 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1584 | edca_setting_DL_GMode[pHTInfo->IOTPeer]); | 1579 | edca_setting_DL_GMode[ht_info->IOTPeer]); |
| 1585 | else | 1580 | else |
| 1586 | rtl92e_writel(dev, EDCAPARA_BE, | 1581 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1587 | edca_setting_DL[pHTInfo->IOTPeer]); | 1582 | edca_setting_DL[ht_info->IOTPeer]); |
| 1588 | priv->bis_cur_rdlstate = true; | 1583 | priv->bis_cur_rdlstate = true; |
| 1589 | } | 1584 | } |
| 1590 | } else { | 1585 | } else { |
| 1591 | if (priv->bis_cur_rdlstate || | 1586 | if (priv->bis_cur_rdlstate || |
| 1592 | !priv->bcurrent_turbo_EDCA) { | 1587 | !priv->bcurrent_turbo_EDCA) { |
| 1593 | rtl92e_writel(dev, EDCAPARA_BE, | 1588 | rtl92e_writel(dev, EDCAPARA_BE, |
| 1594 | edca_setting_UL[pHTInfo->IOTPeer]); | 1589 | edca_setting_UL[ht_info->IOTPeer]); |
| 1595 | priv->bis_cur_rdlstate = false; | 1590 | priv->bis_cur_rdlstate = false; |
| 1596 | } | 1591 | } |
| 1597 | 1592 | ||
| @@ -1626,23 +1621,23 @@ static void _rtl92e_dm_init_cts_to_self(struct net_device *dev) · 28 unmodified lines | |||
| 1626 | static void _rtl92e_dm_cts_to_self(struct net_device *dev) | 1621 | static void _rtl92e_dm_cts_to_self(struct net_device *dev) |
| 1627 | { | 1622 | { |
| 1628 | struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); | 1623 | struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); |
| 1629 | struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; | 1624 | struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; |
| 1630 | static unsigned long lastTxOkCnt; | 1625 | static unsigned long lastTxOkCnt; |
| 1631 | static unsigned long lastRxOkCnt; | 1626 | static unsigned long lastRxOkCnt; |
| 1632 | unsigned long curTxOkCnt = 0; | 1627 | unsigned long curTxOkCnt = 0; |
| 1633 | unsigned long curRxOkCnt = 0; | 1628 | unsigned long curRxOkCnt = 0; |
| 1634 | 1629 | ||
| 1635 | if (!priv->rtllib->bCTSToSelfEnable) { | 1630 | if (!priv->rtllib->bCTSToSelfEnable) { |
| 1636 | pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; | 1631 | ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; |
| 1637 | return; | 1632 | return; |
| 1638 | } | 1633 | } |
| 1639 | if (pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) { | 1634 | if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { |
| 1640 | curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; | 1635 | curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; |
| 1641 | curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; | 1636 | curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; |
| 1642 | if (curRxOkCnt > 4*curTxOkCnt) | 1637 | if (curRxOkCnt > 4*curTxOkCnt) |
| 1643 | pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; | 1638 | ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; |
| 1644 | else | 1639 | else |
| 1645 | pHTInfo->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; | 1640 | ht_info->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; |
| 1646 | 1641 | ||
| 1647 | lastTxOkCnt = priv->stats.txbytesunicast; | 1642 | lastTxOkCnt = priv->stats.txbytesunicast; |
| 1648 | lastRxOkCnt = priv->stats.rxbytesunicast; | 1643 | lastRxOkCnt = priv->stats.rxbytesunicast; |
| @@ -1653,10 +1648,10 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev) · 4 unmodified lines | |||
| 1653 | static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev) | 1648 | static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev) |
| 1654 | { | 1649 | { |
| 1655 | struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); | 1650 | struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); |
| 1656 | struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; | 1651 | struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; |
| 1657 | 1652 | ||
| 1658 | pHTInfo->bWAIotBroadcom = false; | 1653 | ht_info->bWAIotBroadcom = false; |
| 1659 | pHTInfo->WAIotTH = WAIotTHVal; | 1654 | ht_info->WAIotTH = WAIotTHVal; |
| 1660 | } | 1655 | } |
| 1661 | 1656 | ||
| 1662 | static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) | 1657 | static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) |
| @@ -1698,7 +1693,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) · 35 unmodified lines | |||
| 1698 | 1693 | ||
| 1699 | if (bActuallySet) { | 1694 | if (bActuallySet) { |
| 1700 | mdelay(1000); | 1695 | mdelay(1000); |
| 1701 | priv->bHwRfOffAction = 1; | 1696 | priv->hw_rf_off_action = 1; |
| 1702 | rtl92e_set_rf_state(dev, rf_power_state_to_set, RF_CHANGE_BY_HW); | 1697 | rtl92e_set_rf_state(dev, rf_power_state_to_set, RF_CHANGE_BY_HW); |
| 1703 | if (priv->hw_radio_off) | 1698 | if (priv->hw_radio_off) |
| 1704 | argv[1] = "RFOFF"; | 1699 | argv[1] = "RFOFF"; |
| @@ -1997,7 +1992,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t) · 292 unmodified lines | |||
| 1997 | 1992 | ||
| 1998 | if (priv->rtllib->state == RTLLIB_LINKED && | 1993 | if (priv->rtllib->state == RTLLIB_LINKED && |
| 1999 | priv->rtllib->bfsync_enable && | 1994 | priv->rtllib->bfsync_enable && |
| 2000 | (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_CDD_FSYNC)) { | 1995 | (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) { |
| 2001 | u32 rate_bitmap; | 1996 | u32 rate_bitmap; |
| 2002 | 1997 | ||
| 2003 | for (rate_index = 0; rate_index <= 27; rate_index++) { | 1998 | for (rate_index = 0; rate_index <= 27; rate_index++) { |
| @@ -2126,8 +2121,8 @@ static void _rtl92e_dm_end_sw_fsync(struct net_device *dev) · 122 unmodified lines | |||
| 2126 | static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) | 2121 | static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) |
| 2127 | { | 2122 | { |
| 2128 | struct r8192_priv *priv = rtllib_priv(dev); | 2123 | struct r8192_priv *priv = rtllib_priv(dev); |
| 2129 | u32 rateIndex; | 2124 | u32 rate_index; |
| 2130 | u32 rateBitmap; | 2125 | u32 rate_bitmap; |
| 2131 | 2126 | ||
| 2132 | priv->rate_record = 0; | 2127 | priv->rate_record = 0; |
| 2133 | priv->ContinueDiffCount = 0; | 2128 | priv->ContinueDiffCount = 0; |
| @@ -2141,12 +2136,12 @@ static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) · 7 unmodified lines | |||
| 2141 | priv->rtllib->fsync_firstdiff_ratethreshold = 200; | 2136 | priv->rtllib->fsync_firstdiff_ratethreshold = 200; |
| 2142 | priv->rtllib->fsync_seconddiff_ratethreshold = 200; | 2137 | priv->rtllib->fsync_seconddiff_ratethreshold = 200; |
| 2143 | } | 2138 | } |
| 2144 | for (rateIndex = 0; rateIndex <= 27; rateIndex++) { | 2139 | for (rate_index = 0; rate_index <= 27; rate_index++) { |
| 2145 | rateBitmap = 1 << rateIndex; | 2140 | rate_bitmap = 1 << rate_index; |
| 2146 | if (priv->rtllib->fsync_rate_bitmap & rateBitmap) | 2141 | if (priv->rtllib->fsync_rate_bitmap & rate_bitmap) |
| 2147 | priv->rate_record += | 2142 | priv->rate_record += |
| 2148 | priv->stats.received_rate_histogram[1] | 2143 | priv->stats.received_rate_histogram[1] |
| 2149 | [rateIndex]; | 2144 | [rate_index]; |
| 2150 | } | 2145 | } |
| 2151 | if (timer_pending(&priv->fsync_timer)) | 2146 | if (timer_pending(&priv->fsync_timer)) |
| 2152 | del_timer_sync(&priv->fsync_timer); | 2147 | del_timer_sync(&priv->fsync_timer); |
| @@ -2168,7 +2163,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) · 15 unmodified lines | |||
| 2168 | static u32 reset_cnt; | 2163 | static u32 reset_cnt; |
| 2169 | 2164 | ||
| 2170 | if (priv->rtllib->state == RTLLIB_LINKED && | 2165 | if (priv->rtllib->state == RTLLIB_LINKED && |
| 2171 | priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) { | 2166 | priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { |
| 2172 | if (priv->rtllib->bfsync_enable == 0) { | 2167 | if (priv->rtllib->bfsync_enable == 0) { |
| 2173 | switch (priv->rtllib->fsync_state) { | 2168 | switch (priv->rtllib->fsync_state) { |
| 2174 | case Default_Fsync: | 2169 | case Default_Fsync: |
| @@ -2293,7 +2288,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) · 118 unmodified lines | |||
| 2293 | priv->bDynamicTxLowPower = false; | 2288 | priv->bDynamicTxLowPower = false; |
| 2294 | return; | 2289 | return; |
| 2295 | } | 2290 | } |
| 2296 | if ((priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) && | 2291 | if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) && |
| 2297 | (priv->rtllib->mode == IEEE_G)) { | 2292 | (priv->rtllib->mode == IEEE_G)) { |
| 2298 | txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; | 2293 | txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; |
| 2299 | txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW; | 2294 | txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW; |
| @@ -66,8 +66,8 @@ struct dig_t { · 65 unmodified lines | |||
| 66 | 66 | ||
| 67 | u8 dig_state; | 67 | u8 dig_state; |
| 68 | u8 dig_highpwr_state; | 68 | u8 dig_highpwr_state; |
| 69 | u8 CurSTAConnectState; | 69 | u8 cur_sta_connect_state; |
| 70 | u8 PreSTAConnectState; | 70 | u8 pre_sta_connect_state; |
| 71 | 71 | ||
| 72 | u8 curpd_thstate; | 72 | u8 curpd_thstate; |
| 73 | u8 prepd_thstate; | 73 | u8 prepd_thstate; |
| @@ -152,9 +152,9 @@ enum dm_cck_rx_path_method { · 78 unmodified lines | |||
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | struct dcmd_txcmd { | 154 | struct dcmd_txcmd { |
| 155 | u32 Op; | 155 | u32 op; |
| 156 | u32 Length; | 156 | u32 length; |
| 157 | u32 Value; | 157 | u32 value; |
| 158 | }; | 158 | }; |
| 159 | /*------------------------------Define structure----------------------------*/ | 159 | /*------------------------------Define structure----------------------------*/ |
| 160 | 160 | ||
| @@ -79,6 +79,6 @@ u32 rtl92e_eeprom_read(struct net_device *dev, u32 addr) · 78 unmodified lines | |||
| 79 | ret = _rtl92e_eeprom_xfer(dev, (addr & 0x3F) | (0x6 << 6), 9); | 79 | ret = _rtl92e_eeprom_xfer(dev, (addr & 0x3F) | (0x6 << 6), 9); |
| 80 | 80 | ||
| 81 | rtl92e_writeb(dev, EPROM_CMD, | 81 | rtl92e_writeb(dev, EPROM_CMD, |
| 82 | (EPROM_CMD_NORMAL<<EPROM_CMD_OPERATING_MODE_SHIFT)); | 82 | (EPROM_CMD_NORMAL << EPROM_CMD_OPERATING_MODE_SHIFT)); |
| 83 | return ret; | 83 | return ret; |
| 84 | } | 84 | } |
| @@ -100,50 +100,43 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time) · 99 unmodified lines | |||
| 100 | static void _rtl92e_ps_update_rf_state(struct net_device *dev) | 100 | static void _rtl92e_ps_update_rf_state(struct net_device *dev) |
| 101 | { | 101 | { |
| 102 | struct r8192_priv *priv = rtllib_priv(dev); | 102 | struct r8192_priv *priv = rtllib_priv(dev); |
| 103 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 103 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 104 | &(priv->rtllib->PowerSaveControl); | 104 | &priv->rtllib->pwr_save_ctrl; |
| 105 | 105 | ||
| 106 | pPSC->bSwRfProcessing = true; | 106 | psc->bSwRfProcessing = true; |
| 107 | rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS); | 107 | rtl92e_set_rf_state(dev, psc->eInactivePowerState, RF_CHANGE_BY_IPS); |
| 108 | 108 | ||
| 109 | pPSC->bSwRfProcessing = false; | 109 | psc->bSwRfProcessing = false; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void rtl92e_ips_enter(struct net_device *dev) | 112 | void rtl92e_ips_enter(struct net_device *dev) |
| 113 | { | 113 | { |
| 114 | struct r8192_priv *priv = rtllib_priv(dev); | 114 | struct r8192_priv *priv = rtllib_priv(dev); |
| 115 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 115 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 116 | &(priv->rtllib->PowerSaveControl); | 116 | &priv->rtllib->pwr_save_ctrl; |
| 117 | enum rt_rf_power_state rt_state; | 117 | enum rt_rf_power_state rt_state; |
| 118 | 118 | ||
| 119 | if (pPSC->bInactivePs) { | 119 | rt_state = priv->rtllib->rf_power_state; |
| 120 | rt_state = priv->rtllib->rf_power_state; | 120 | if (rt_state == rf_on && !psc->bSwRfProcessing && |
| 121 | if (rt_state == rf_on && !pPSC->bSwRfProcessing && | 121 | (priv->rtllib->state != RTLLIB_LINKED) && |
| 122 | (priv->rtllib->state != RTLLIB_LINKED) && | 122 | (priv->rtllib->iw_mode != IW_MODE_MASTER)) { |
| 123 | (priv->rtllib->iw_mode != IW_MODE_MASTER)) { | 123 | psc->eInactivePowerState = rf_off; |
| 124 | pPSC->eInactivePowerState = rf_off; | 124 | _rtl92e_ps_update_rf_state(dev); |
| 125 | priv->isRFOff = true; | ||
| 126 | priv->bInPowerSaveMode = true; | ||
| 127 | _rtl92e_ps_update_rf_state(dev); | ||
| 128 | } | ||
| 129 | } | 125 | } |
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | void rtl92e_ips_leave(struct net_device *dev) | 128 | void rtl92e_ips_leave(struct net_device *dev) |
| 133 | { | 129 | { |
| 134 | struct r8192_priv *priv = rtllib_priv(dev); | 130 | struct r8192_priv *priv = rtllib_priv(dev); |
| 135 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 131 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 136 | &(priv->rtllib->PowerSaveControl); | 132 | &priv->rtllib->pwr_save_ctrl; |
| 137 | enum rt_rf_power_state rt_state; | 133 | enum rt_rf_power_state rt_state; |
| 138 | 134 | ||
| 139 | if (pPSC->bInactivePs) { | 135 | rt_state = priv->rtllib->rf_power_state; |
| 140 | rt_state = priv->rtllib->rf_power_state; | 136 | if (rt_state != rf_on && !psc->bSwRfProcessing && |
| 141 | if (rt_state != rf_on && !pPSC->bSwRfProcessing && | 137 | priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) { |
| 142 | priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) { | 138 | psc->eInactivePowerState = rf_on; |
| 143 | pPSC->eInactivePowerState = rf_on; | 139 | _rtl92e_ps_update_rf_state(dev); |
| 144 | priv->bInPowerSaveMode = false; | ||
| 145 | _rtl92e_ps_update_rf_state(dev); | ||
| 146 | } | ||
| 147 | } | 140 | } |
| 148 | } | 141 | } |
| 149 | 142 | ||
| @@ -165,18 +158,15 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev) · 15 unmodified lines | |||
| 165 | enum rt_rf_power_state rt_state; | 158 | enum rt_rf_power_state rt_state; |
| 166 | 159 | ||
| 167 | rt_state = priv->rtllib->rf_power_state; | 160 | rt_state = priv->rtllib->rf_power_state; |
| 168 | 161 | if (rt_state == rf_off) { | |
| 169 | if (priv->rtllib->PowerSaveControl.bInactivePs) { | 162 | if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { |
| 170 | if (rt_state == rf_off) { | 163 | netdev_warn(dev, "%s(): RF is OFF.\n", |
| 171 | if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { | ||
| 172 | netdev_warn(dev, "%s(): RF is OFF.\n", | ||
| 173 | __func__); | ||
| 174 | return; | ||
| 175 | } | ||
| 176 | netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n", | ||
| 177 | __func__); | 164 | __func__); |
| 178 | schedule_work(&priv->rtllib->ips_leave_wq); | 165 | return; |
| 179 | } | 166 | } |
| 167 | netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n", | ||
| 168 | __func__); | ||
| 169 | schedule_work(&priv->rtllib->ips_leave_wq); | ||
| 180 | } | 170 | } |
| 181 | } | 171 | } |
| 182 | 172 | ||
| @@ -216,8 +206,8 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode) · 33 unmodified lines | |||
| 216 | void rtl92e_leisure_ps_enter(struct net_device *dev) | 206 | void rtl92e_leisure_ps_enter(struct net_device *dev) |
| 217 | { | 207 | { |
| 218 | struct r8192_priv *priv = rtllib_priv(dev); | 208 | struct r8192_priv *priv = rtllib_priv(dev); |
| 219 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 209 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 220 | &(priv->rtllib->PowerSaveControl); | 210 | &priv->rtllib->pwr_save_ctrl; |
| 221 | 211 | ||
| 222 | if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && | 212 | if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && |
| 223 | (priv->rtllib->state == RTLLIB_LINKED)) | 213 | (priv->rtllib->state == RTLLIB_LINKED)) |
| @@ -225,38 +215,31 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) · 1 unmodified line | |||
| 225 | (priv->rtllib->iw_mode == IW_MODE_MASTER)) | 215 | (priv->rtllib->iw_mode == IW_MODE_MASTER)) |
| 226 | return; | 216 | return; |
| 227 | 217 | ||
| 228 | if (pPSC->bLeisurePs) { | 218 | if (psc->bLeisurePs) { |
| 229 | if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { | 219 | if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { |
| 230 | 220 | ||
| 231 | if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { | 221 | if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { |
| 232 | if (!pPSC->bFwCtrlLPS) { | 222 | if (priv->rtllib->SetFwCmdHandler) |
| 233 | if (priv->rtllib->SetFwCmdHandler) | 223 | priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER); |
| 234 | priv->rtllib->SetFwCmdHandler( | ||
| 235 | dev, FW_CMD_LPS_ENTER); | ||
| 236 | } | ||
| 237 | _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | | 224 | _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | |
| 238 | RTLLIB_PS_UNICAST); | 225 | RTLLIB_PS_UNICAST); |
| 239 | } | 226 | } |
| 240 | } else | 227 | } else |
| 241 | pPSC->LpsIdleCount++; | 228 | psc->LpsIdleCount++; |
| 242 | } | 229 | } |
| 243 | } | 230 | } |
| 244 | 231 | ||
| 245 | void rtl92e_leisure_ps_leave(struct net_device *dev) | 232 | void rtl92e_leisure_ps_leave(struct net_device *dev) |
| 246 | { | 233 | { |
| 247 | struct r8192_priv *priv = rtllib_priv(dev); | 234 | struct r8192_priv *priv = rtllib_priv(dev); |
| 248 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 235 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 249 | &(priv->rtllib->PowerSaveControl); | 236 | &priv->rtllib->pwr_save_ctrl; |
| 250 | 237 | ||
| 251 | if (pPSC->bLeisurePs) { | 238 | if (psc->bLeisurePs) { |
| 252 | if (priv->rtllib->ps != RTLLIB_PS_DISABLED) { | 239 | if (priv->rtllib->ps != RTLLIB_PS_DISABLED) { |
| 253 | _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED); | 240 | _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED); |
| 254 | 241 | if (priv->rtllib->SetFwCmdHandler) | |
| 255 | if (!pPSC->bFwCtrlLPS) { | 242 | priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE); |
| 256 | if (priv->rtllib->SetFwCmdHandler) | ||
| 257 | priv->rtllib->SetFwCmdHandler(dev, | ||
| 258 | FW_CMD_LPS_LEAVE); | ||
| 259 | } | ||
| 260 | } | 243 | } |
| 261 | } | 244 | } |
| 262 | } | 245 | } |
| @@ -159,21 +159,21 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, · 158 unmodified lines | |||
| 159 | union iwreq_data *wrqu, char *extra) | 159 | union iwreq_data *wrqu, char *extra) |
| 160 | { | 160 | { |
| 161 | struct r8192_priv *priv = rtllib_priv(dev); | 161 | struct r8192_priv *priv = rtllib_priv(dev); |
| 162 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 162 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 163 | (&priv->rtllib->PowerSaveControl); | 163 | (&priv->rtllib->pwr_save_ctrl); |
| 164 | struct rtllib_device *ieee = priv->rtllib; | 164 | struct rtllib_device *ieee = priv->rtllib; |
| 165 | 165 | ||
| 166 | mutex_lock(&priv->wx_mutex); | 166 | mutex_lock(&priv->wx_mutex); |
| 167 | 167 | ||
| 168 | if (*extra || priv->force_lps) { | 168 | if (*extra || priv->force_lps) { |
| 169 | priv->ps_force = false; | 169 | priv->ps_force = false; |
| 170 | pPSC->bLeisurePs = true; | 170 | psc->bLeisurePs = true; |
| 171 | } else { | 171 | } else { |
| 172 | if (priv->rtllib->state == RTLLIB_LINKED) | 172 | if (priv->rtllib->state == RTLLIB_LINKED) |
| 173 | rtl92e_leisure_ps_leave(dev); | 173 | rtl92e_leisure_ps_leave(dev); |
| 174 | 174 | ||
| 175 | priv->ps_force = true; | 175 | priv->ps_force = true; |
| 176 | pPSC->bLeisurePs = false; | 176 | psc->bLeisurePs = false; |
| 177 | ieee->ps = *extra; | 177 | ieee->ps = *extra; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| @@ -188,15 +188,15 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev, · 8 unmodified lines | |||
| 188 | char *extra) | 188 | char *extra) |
| 189 | { | 189 | { |
| 190 | struct r8192_priv *priv = rtllib_priv(dev); | 190 | struct r8192_priv *priv = rtllib_priv(dev); |
| 191 | struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) | 191 | struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) |
| 192 | (&priv->rtllib->PowerSaveControl); | 192 | (&priv->rtllib->pwr_save_ctrl); |
| 193 | 193 | ||
| 194 | mutex_lock(&priv->wx_mutex); | 194 | mutex_lock(&priv->wx_mutex); |
| 195 | 195 | ||
| 196 | netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n", | 196 | netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n", |
| 197 | __func__, *extra); | 197 | __func__, *extra); |
| 198 | 198 | ||
| 199 | pPSC->RegMaxLPSAwakeIntvl = *extra; | 199 | psc->reg_max_lps_awake_intvl = *extra; |
| 200 | mutex_unlock(&priv->wx_mutex); | 200 | mutex_unlock(&priv->wx_mutex); |
| 201 | return 0; | 201 | return 0; |
| 202 | } | 202 | } |
| @@ -251,23 +251,21 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, · 48 unmodified lines | |||
| 251 | rt_state = priv->rtllib->rf_power_state; | 251 | rt_state = priv->rtllib->rf_power_state; |
| 252 | mutex_lock(&priv->wx_mutex); | 252 | mutex_lock(&priv->wx_mutex); |
| 253 | if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || | 253 | if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || |
| 254 | ieee->bNetPromiscuousMode) { | 254 | ieee->net_promiscuous_md) { |
| 255 | if (priv->rtllib->PowerSaveControl.bInactivePs) { | 255 | if (rt_state == rf_off) { |
| 256 | if (rt_state == rf_off) { | 256 | if (priv->rtllib->rf_off_reason > |
| 257 | if (priv->rtllib->rf_off_reason > | 257 | RF_CHANGE_BY_IPS) { |
| 258 | RF_CHANGE_BY_IPS) { | 258 | netdev_warn(dev, "%s(): RF is OFF.\n", |
| 259 | netdev_warn(dev, "%s(): RF is OFF.\n", | ||
| 260 | __func__); | ||
| 261 | mutex_unlock(&priv->wx_mutex); | ||
| 262 | return -1; | ||
| 263 | } | ||
| 264 | netdev_info(dev, | ||
| 265 | "=========>%s(): rtl92e_ips_leave\n", | ||
| 266 | __func__); | 259 | __func__); |
| 267 | mutex_lock(&priv->rtllib->ips_mutex); | 260 | mutex_unlock(&priv->wx_mutex); |
| 268 | rtl92e_ips_leave(dev); | 261 | return -1; |
| 269 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 270 | } | 262 | } |
| 263 | netdev_info(dev, | ||
| 264 | "=========>%s(): rtl92e_ips_leave\n", | ||
| 265 | __func__); | ||
| 266 | mutex_lock(&priv->rtllib->ips_mutex); | ||
| 267 | rtl92e_ips_leave(dev); | ||
| 268 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 271 | } | 269 | } |
| 272 | } | 270 | } |
| 273 | ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); | 271 | ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); |
| @@ -395,7 +393,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, · 121 unmodified lines | |||
| 395 | rt_state = priv->rtllib->rf_power_state; | 393 | rt_state = priv->rtllib->rf_power_state; |
| 396 | if (!priv->up) | 394 | if (!priv->up) |
| 397 | return -ENETDOWN; | 395 | return -ENETDOWN; |
| 398 | if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true) | 396 | if (priv->rtllib->link_detect_info.bBusyTraffic == true) |
| 399 | return -EAGAIN; | 397 | return -EAGAIN; |
| 400 | 398 | ||
| 401 | if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { | 399 | if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { |
| @@ -414,19 +412,17 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, · 12 unmodified lines | |||
| 414 | priv->rtllib->FirstIe_InScan = true; | 412 | priv->rtllib->FirstIe_InScan = true; |
| 415 | 413 | ||
| 416 | if (priv->rtllib->state != RTLLIB_LINKED) { | 414 | if (priv->rtllib->state != RTLLIB_LINKED) { |
| 417 | if (priv->rtllib->PowerSaveControl.bInactivePs) { | 415 | if (rt_state == rf_off) { |
| 418 | if (rt_state == rf_off) { | 416 | if (priv->rtllib->rf_off_reason > |
| 419 | if (priv->rtllib->rf_off_reason > | 417 | RF_CHANGE_BY_IPS) { |
| 420 | RF_CHANGE_BY_IPS) { | 418 | netdev_warn(dev, "%s(): RF is OFF.\n", |
| 421 | netdev_warn(dev, "%s(): RF is OFF.\n", | 419 | __func__); |
| 422 | __func__); | 420 | mutex_unlock(&priv->wx_mutex); |
| 423 | mutex_unlock(&priv->wx_mutex); | 421 | return -1; |
| 424 | return -1; | ||
| 425 | } | ||
| 426 | mutex_lock(&priv->rtllib->ips_mutex); | ||
| 427 | rtl92e_ips_leave(dev); | ||
| 428 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 429 | } | 422 | } |
| 423 | mutex_lock(&priv->rtllib->ips_mutex); | ||
| 424 | rtl92e_ips_leave(dev); | ||
| 425 | mutex_unlock(&priv->rtllib->ips_mutex); | ||
| 430 | } | 426 | } |
| 431 | rtllib_stop_scan(priv->rtllib); | 427 | rtllib_stop_scan(priv->rtllib); |
| 432 | if (priv->rtllib->LedControlHandler) | 428 | if (priv->rtllib->LedControlHandler) |
| @@ -919,7 +915,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, · 486 unmodified lines | |||
| 919 | key, 0); | 915 | key, 0); |
| 920 | } else { | 916 | } else { |
| 921 | if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && | 917 | if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && |
| 922 | ieee->pHTInfo->bCurrentHTSupport) | 918 | ieee->ht_info->bCurrentHTSupport) |
| 923 | rtl92e_writeb(dev, 0x173, 1); | 919 | rtl92e_writeb(dev, 0x173, 1); |
| 924 | rtl92e_set_key(dev, 4, idx, alg, | 920 | rtl92e_set_key(dev, 4, idx, alg, |
| 925 | (u8 *)ieee->ap_mac_addr, 0, key); | 921 | (u8 *)ieee->ap_mac_addr, 0, key); |
| @@ -1018,29 +1014,29 @@ static int _rtl92e_wx_set_promisc_mode(struct net_device *dev, · 92 unmodified lines | |||
| 1018 | u32 info_buf[3]; | 1014 | u32 info_buf[3]; |
| 1019 | 1015 | ||
| 1020 | u32 oid; | 1016 | u32 oid; |
| 1021 | u32 bPromiscuousOn; | 1017 | u32 promiscuous_on; |
| 1022 | u32 bFilterSourceStationFrame; | 1018 | u32 fltr_src_sta_frame; |
| 1023 | 1019 | ||
| 1024 | if (copy_from_user(info_buf, wrqu->data.pointer, sizeof(info_buf))) | 1020 | if (copy_from_user(info_buf, wrqu->data.pointer, sizeof(info_buf))) |
| 1025 | return -EFAULT; | 1021 | return -EFAULT; |
| 1026 | 1022 | ||
| 1027 | oid = info_buf[0]; | 1023 | oid = info_buf[0]; |
| 1028 | bPromiscuousOn = info_buf[1]; | 1024 | promiscuous_on = info_buf[1]; |
| 1029 | bFilterSourceStationFrame = info_buf[2]; | 1025 | fltr_src_sta_frame = info_buf[2]; |
| 1030 | 1026 | ||
| 1031 | if (oid == OID_RT_INTEL_PROMISCUOUS_MODE) { | 1027 | if (oid == OID_RT_INTEL_PROMISCUOUS_MODE) { |
| 1032 | ieee->IntelPromiscuousModeInfo.bPromiscuousOn = | 1028 | ieee->intel_promiscuous_md_info.promiscuous_on = |
| 1033 | (bPromiscuousOn) ? (true) : (false); | 1029 | (promiscuous_on) ? (true) : (false); |
| 1034 | ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame = | 1030 | ieee->intel_promiscuous_md_info.fltr_src_sta_frame = |
| 1035 | (bFilterSourceStationFrame) ? (true) : (false); | 1031 | (fltr_src_sta_frame) ? (true) : (false); |
| 1036 | (bPromiscuousOn) ? | 1032 | (promiscuous_on) ? |
| 1037 | (rtllib_EnableIntelPromiscuousMode(dev, false)) : | 1033 | (rtllib_EnableIntelPromiscuousMode(dev, false)) : |
| 1038 | (rtllib_DisableIntelPromiscuousMode(dev, false)); | 1034 | (rtllib_DisableIntelPromiscuousMode(dev, false)); |
| 1039 | 1035 | ||
| 1040 | netdev_info(dev, | 1036 | netdev_info(dev, |
| 1041 | "=======>%s(), on = %d, filter src sta = %d\n", | 1037 | "=======>%s(), on = %d, filter src sta = %d\n", |
| 1042 | __func__, bPromiscuousOn, | 1038 | __func__, promiscuous_on, |
| 1043 | bFilterSourceStationFrame); | 1039 | fltr_src_sta_frame); |
| 1044 | } else { | 1040 | } else { |
| 1045 | return -1; | 1041 | return -1; |
| 1046 | } | 1042 | } |
| @@ -1058,8 +1054,8 @@ static int _rtl92e_wx_get_promisc_mode(struct net_device *dev, · 11 unmodified lines | |||
| 1058 | mutex_lock(&priv->wx_mutex); | 1054 | mutex_lock(&priv->wx_mutex); |
| 1059 | 1055 | ||
| 1060 | snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d", | 1056 | snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d", |
| 1061 | ieee->IntelPromiscuousModeInfo.bPromiscuousOn, | 1057 | ieee->intel_promiscuous_md_info.promiscuous_on, |
| 1062 | ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame); | 1058 | ieee->intel_promiscuous_md_info.fltr_src_sta_frame); |
| 1063 | wrqu->data.length = strlen(extra) + 1; | 1059 | wrqu->data.length = strlen(extra) + 1; |
| 1064 | 1060 | ||
| 1065 | mutex_unlock(&priv->wx_mutex); | 1061 | mutex_unlock(&priv->wx_mutex); |
| @@ -62,6 +62,7 @@ void ResetBaEntry(struct ba_record *pBA) · 61 unmodified lines | |||
| 62 | pBA->dialog_token = 0; | 62 | pBA->dialog_token = 0; |
| 63 | pBA->ba_start_seq_ctrl.short_data = 0; | 63 | pBA->ba_start_seq_ctrl.short_data = 0; |
| 64 | } | 64 | } |
| 65 | |||
| 65 | static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, | 66 | static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, |
| 66 | struct ba_record *pBA, | 67 | struct ba_record *pBA, |
| 67 | u16 StatusCode, u8 type) | 68 | u16 StatusCode, u8 type) |
| @@ -111,7 +112,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, · 43 unmodified lines | |||
| 111 | tag += 2; | 112 | tag += 2; |
| 112 | 113 | ||
| 113 | if (type == ACT_ADDBAREQ) { | 114 | if (type == ACT_ADDBAREQ) { |
| 114 | memcpy(tag, (u8 *)&(pBA->ba_start_seq_ctrl), 2); | 115 | memcpy(tag, (u8 *)&pBA->ba_start_seq_ctrl, 2); |
| 115 | tag += 2; | 116 | tag += 2; |
| 116 | } | 117 | } |
| 117 | 118 | ||
| @@ -159,7 +160,6 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, · 41 unmodified lines | |||
| 159 | *tag++ = ACT_CAT_BA; | 160 | *tag++ = ACT_CAT_BA; |
| 160 | *tag++ = ACT_DELBA; | 161 | *tag++ = ACT_DELBA; |
| 161 | 162 | ||
| 162 | |||
| 163 | put_unaligned_le16(DelbaParamSet.short_data, tag); | 163 | put_unaligned_le16(DelbaParamSet.short_data, tag); |
| 164 | tag += 2; | 164 | tag += 2; |
| 165 | 165 | ||
| @@ -180,11 +180,10 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, · 14 unmodified lines | |||
| 180 | 180 | ||
| 181 | skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); | 181 | skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); |
| 182 | 182 | ||
| 183 | if (skb) { | 183 | if (skb) |
| 184 | softmac_mgmt_xmit(skb, ieee); | 184 | softmac_mgmt_xmit(skb, ieee); |
| 185 | } else { | 185 | else |
| 186 | netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n"); | 186 | netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n"); |
| 187 | } | ||
| 188 | } | 187 | } |
| 189 | 188 | ||
| 190 | static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, | 189 | static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, |
| @@ -245,17 +244,17 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · 54 unmodified lines | |||
| 245 | pBaStartSeqCtrl = (union sequence_control *)(req + 7); | 244 | pBaStartSeqCtrl = (union sequence_control *)(req + 7); |
| 246 | 245 | ||
| 247 | if (!ieee->current_network.qos_data.active || | 246 | if (!ieee->current_network.qos_data.active || |
| 248 | !ieee->pHTInfo->bCurrentHTSupport || | 247 | !ieee->ht_info->bCurrentHTSupport || |
| 249 | (ieee->pHTInfo->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) { | 248 | (ieee->ht_info->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) { |
| 250 | rc = ADDBA_STATUS_REFUSED; | 249 | rc = ADDBA_STATUS_REFUSED; |
| 251 | netdev_warn(ieee->dev, | 250 | netdev_warn(ieee->dev, |
| 252 | "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", | 251 | "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", |
| 253 | ieee->current_network.qos_data.active, | 252 | ieee->current_network.qos_data.active, |
| 254 | ieee->pHTInfo->bCurrentHTSupport); | 253 | ieee->ht_info->bCurrentHTSupport); |
| 255 | goto OnADDBAReq_Fail; | 254 | goto OnADDBAReq_Fail; |
| 256 | } | 255 | } |
| 257 | if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, | 256 | if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst, |
| 258 | (u8)(pBaParamSet->field.tid), RX_DIR, true)) { | 257 | (u8)(pBaParamSet->field.tid), RX_DIR, true)) { |
| 259 | rc = ADDBA_STATUS_REFUSED; | 258 | rc = ADDBA_STATUS_REFUSED; |
| 260 | netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); | 259 | netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); |
| 261 | goto OnADDBAReq_Fail; | 260 | goto OnADDBAReq_Fail; |
| @@ -278,7 +277,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · 16 unmodified lines | |||
| 278 | pBA->ba_start_seq_ctrl = *pBaStartSeqCtrl; | 277 | pBA->ba_start_seq_ctrl = *pBaStartSeqCtrl; |
| 279 | 278 | ||
| 280 | if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) || | 279 | if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) || |
| 281 | (ieee->pHTInfo->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) | 280 | (ieee->ht_info->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) |
| 282 | pBA->ba_param_set.field.buffer_size = 1; | 281 | pBA->ba_param_set.field.buffer_size = 1; |
| 283 | else | 282 | else |
| 284 | pBA->ba_param_set.field.buffer_size = 32; | 283 | pBA->ba_param_set.field.buffer_size = 32; |
| @@ -327,18 +326,18 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) · 42 unmodified lines | |||
| 327 | pBaTimeoutVal = (u16 *)(tag + 7); | 326 | pBaTimeoutVal = (u16 *)(tag + 7); |
| 328 | 327 | ||
| 329 | if (!ieee->current_network.qos_data.active || | 328 | if (!ieee->current_network.qos_data.active || |
| 330 | !ieee->pHTInfo->bCurrentHTSupport || | 329 | !ieee->ht_info->bCurrentHTSupport || |
| 331 | !ieee->pHTInfo->bCurrentAMPDUEnable) { | 330 | !ieee->ht_info->bCurrentAMPDUEnable) { |
| 332 | netdev_warn(ieee->dev, | 331 | netdev_warn(ieee->dev, |
| 333 | "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", | 332 | "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", |
| 334 | ieee->current_network.qos_data.active, | 333 | ieee->current_network.qos_data.active, |
| 335 | ieee->pHTInfo->bCurrentHTSupport, | 334 | ieee->ht_info->bCurrentHTSupport, |
| 336 | ieee->pHTInfo->bCurrentAMPDUEnable); | 335 | ieee->ht_info->bCurrentAMPDUEnable); |
| 337 | ReasonCode = DELBA_REASON_UNKNOWN_BA; | 336 | ReasonCode = DELBA_REASON_UNKNOWN_BA; |
| 338 | goto OnADDBARsp_Reject; | 337 | goto OnADDBARsp_Reject; |
| 339 | } | 338 | } |
| 340 | 339 | ||
| 341 | if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, | 340 | if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst, |
| 342 | (u8)(pBaParamSet->field.tid), TX_DIR, false)) { | 341 | (u8)(pBaParamSet->field.tid), TX_DIR, false)) { |
| 343 | netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); | 342 | netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); |
| 344 | ReasonCode = DELBA_REASON_UNKNOWN_BA; | 343 | ReasonCode = DELBA_REASON_UNKNOWN_BA; |
| @@ -375,7 +374,6 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) · 30 unmodified lines | |||
| 375 | goto OnADDBARsp_Reject; | 374 | goto OnADDBARsp_Reject; |
| 376 | } | 375 | } |
| 377 | 376 | ||
| 378 | |||
| 379 | pAdmittedBA->dialog_token = *pDialogToken; | 377 | pAdmittedBA->dialog_token = *pDialogToken; |
| 380 | pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; | 378 | pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; |
| 381 | pAdmittedBA->ba_start_seq_ctrl = pPendingBA->ba_start_seq_ctrl; | 379 | pAdmittedBA->ba_start_seq_ctrl = pPendingBA->ba_start_seq_ctrl; |
| @@ -415,11 +413,11 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) · 33 unmodified lines | |||
| 415 | } | 413 | } |
| 416 | 414 | ||
| 417 | if (!ieee->current_network.qos_data.active || | 415 | if (!ieee->current_network.qos_data.active || |
| 418 | !ieee->pHTInfo->bCurrentHTSupport) { | 416 | !ieee->ht_info->bCurrentHTSupport) { |
| 419 | netdev_warn(ieee->dev, | 417 | netdev_warn(ieee->dev, |
| 420 | "received DELBA while QOS or HT is not supported(%d, %d)\n", | 418 | "received DELBA while QOS or HT is not supported(%d, %d)\n", |
| 421 | ieee->current_network. qos_data.active, | 419 | ieee->current_network. qos_data.active, |
| 422 | ieee->pHTInfo->bCurrentHTSupport); | 420 | ieee->ht_info->bCurrentHTSupport); |
| 423 | return -1; | 421 | return -1; |
| 424 | } | 422 | } |
| 425 | 423 | ||
| @@ -435,7 +433,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) · 9 unmodified lines | |||
| 435 | struct rx_ts_record *pRxTs; | 433 | struct rx_ts_record *pRxTs; |
| 436 | 434 | ||
| 437 | if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst, | 435 | if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst, |
| 438 | (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { | 436 | (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { |
| 439 | netdev_warn(ieee->dev, | 437 | netdev_warn(ieee->dev, |
| 440 | "%s(): can't get TS for RXTS. dst:%pM TID:%d\n", | 438 | "%s(): can't get TS for RXTS. dst:%pM TID:%d\n", |
| 441 | __func__, dst, | 439 | __func__, dst, |
| @@ -96,7 +96,7 @@ enum ht_aggre_mode { · 95 unmodified lines | |||
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | struct rt_hi_throughput { | 98 | struct rt_hi_throughput { |
| 99 | u8 bEnableHT; | 99 | u8 enable_ht; |
| 100 | u8 bCurrentHTSupport; | 100 | u8 bCurrentHTSupport; |
| 101 | 101 | ||
| 102 | u8 bRegBW40MHz; | 102 | u8 bRegBW40MHz; |
| @@ -69,47 +69,48 @@ static u8 LINKSYS_MARVELL_4400N[3] = {0x00, 0x14, 0xa4}; · 68 unmodified lines | |||
| 69 | 69 | ||
| 70 | void HTUpdateDefaultSetting(struct rtllib_device *ieee) | 70 | void HTUpdateDefaultSetting(struct rtllib_device *ieee) |
| 71 | { | 71 | { |
| 72 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 72 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 73 | pHTInfo->bRegShortGI20MHz = 1; | ||
| 74 | pHTInfo->bRegShortGI40MHz = 1; | ||
| 75 | 73 | ||
| 76 | pHTInfo->bRegBW40MHz = 1; | 74 | ht_info->bRegShortGI20MHz = 1; |
| 75 | ht_info->bRegShortGI40MHz = 1; | ||
| 77 | 76 | ||
| 78 | if (pHTInfo->bRegBW40MHz) | 77 | ht_info->bRegBW40MHz = 1; |
| 79 | pHTInfo->bRegSuppCCK = 1; | 78 | |
| 79 | if (ht_info->bRegBW40MHz) | ||
| 80 | ht_info->bRegSuppCCK = 1; | ||
| 80 | else | 81 | else |
| 81 | pHTInfo->bRegSuppCCK = true; | 82 | ht_info->bRegSuppCCK = true; |
| 82 | 83 | ||
| 83 | pHTInfo->nAMSDU_MaxSize = 7935UL; | 84 | ht_info->nAMSDU_MaxSize = 7935UL; |
| 84 | pHTInfo->bAMSDU_Support = 0; | 85 | ht_info->bAMSDU_Support = 0; |
| 85 | 86 | ||
| 86 | pHTInfo->bAMPDUEnable = 1; | 87 | ht_info->bAMPDUEnable = 1; |
| 87 | pHTInfo->AMPDU_Factor = 2; | 88 | ht_info->AMPDU_Factor = 2; |
| 88 | pHTInfo->MPDU_Density = 0; | 89 | ht_info->MPDU_Density = 0; |
| 89 | 90 | ||
| 90 | pHTInfo->self_mimo_ps = 3; | 91 | ht_info->self_mimo_ps = 3; |
| 91 | if (pHTInfo->self_mimo_ps == 2) | 92 | if (ht_info->self_mimo_ps == 2) |
| 92 | pHTInfo->self_mimo_ps = 3; | 93 | ht_info->self_mimo_ps = 3; |
| 93 | ieee->bTxDisableRateFallBack = 0; | 94 | ieee->tx_dis_rate_fallback = 0; |
| 94 | ieee->bTxUseDriverAssingedRate = 0; | 95 | ieee->tx_use_drv_assinged_rate = 0; |
| 95 | 96 | ||
| 96 | ieee->bTxEnableFwCalcDur = 1; | 97 | ieee->bTxEnableFwCalcDur = 1; |
| 97 | 98 | ||
| 98 | pHTInfo->reg_rt2rt_aggregation = 1; | 99 | ht_info->reg_rt2rt_aggregation = 1; |
| 99 | 100 | ||
| 100 | pHTInfo->reg_rx_reorder_enable = 1; | 101 | ht_info->reg_rx_reorder_enable = 1; |
| 101 | pHTInfo->rx_reorder_win_size = 64; | 102 | ht_info->rx_reorder_win_size = 64; |
| 102 | pHTInfo->rx_reorder_pending_time = 30; | 103 | ht_info->rx_reorder_pending_time = 30; |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate) | 106 | static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate) |
| 106 | { | 107 | { |
| 107 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 108 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 108 | 109 | ||
| 109 | u8 is40MHz = (pHTInfo->bCurBW40MHz) ? 1 : 0; | 110 | u8 is40MHz = (ht_info->bCurBW40MHz) ? 1 : 0; |
| 110 | u8 isShortGI = (pHTInfo->bCurBW40MHz) ? | 111 | u8 isShortGI = (ht_info->bCurBW40MHz) ? |
| 111 | ((pHTInfo->bCurShortGI40MHz) ? 1 : 0) : | 112 | ((ht_info->bCurShortGI40MHz) ? 1 : 0) : |
| 112 | ((pHTInfo->bCurShortGI20MHz) ? 1 : 0); | 113 | ((ht_info->bCurShortGI20MHz) ? 1 : 0); |
| 113 | return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; | 114 | return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; |
| 114 | } | 115 | } |
| 115 | 116 | ||
| @@ -151,8 +152,8 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) · 35 unmodified lines | |||
| 151 | (net->ralink_cap_exist)) | 152 | (net->ralink_cap_exist)) |
| 152 | retValue = true; | 153 | retValue = true; |
| 153 | else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || | 154 | else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || |
| 154 | !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || | 155 | !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || |
| 155 | !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) || | 156 | !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) || |
| 156 | (net->broadcom_cap_exist)) | 157 | (net->broadcom_cap_exist)) |
| 157 | retValue = true; | 158 | retValue = true; |
| 158 | else if (net->bssht.bd_rt2rt_aggregation) | 159 | else if (net->bssht.bd_rt2rt_aggregation) |
| @@ -165,45 +166,45 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) · 6 unmodified lines | |||
| 165 | 166 | ||
| 166 | static void HTIOTPeerDetermine(struct rtllib_device *ieee) | 167 | static void HTIOTPeerDetermine(struct rtllib_device *ieee) |
| 167 | { | 168 | { |
| 168 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 169 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 169 | struct rtllib_network *net = &ieee->current_network; | 170 | struct rtllib_network *net = &ieee->current_network; |
| 170 | 171 | ||
| 171 | if (net->bssht.bd_rt2rt_aggregation) { | 172 | if (net->bssht.bd_rt2rt_aggregation) { |
| 172 | pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK; | 173 | ht_info->IOTPeer = HT_IOT_PEER_REALTEK; |
| 173 | if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE) | 174 | if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE) |
| 174 | pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK_92SE; | 175 | ht_info->IOTPeer = HT_IOT_PEER_REALTEK_92SE; |
| 175 | if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP) | 176 | if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP) |
| 176 | pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP; | 177 | ht_info->IOTPeer = HT_IOT_PEER_92U_SOFTAP; |
| 177 | } else if (net->broadcom_cap_exist) { | 178 | } else if (net->broadcom_cap_exist) { |
| 178 | pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; | 179 | ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; |
| 179 | } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || | 180 | } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || |
| 180 | !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || | 181 | !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || |
| 181 | !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) { | 182 | !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) { |
| 182 | pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; | 183 | ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; |
| 183 | } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) || | 184 | } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) || |
| 184 | (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) || | 185 | (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) || |
| 185 | (memcmp(net->bssid, PCI_RALINK, 3) == 0) || | 186 | (memcmp(net->bssid, PCI_RALINK, 3) == 0) || |
| 186 | (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) || | 187 | (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) || |
| 187 | (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) || | 188 | (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) || |
| 188 | net->ralink_cap_exist) { | 189 | net->ralink_cap_exist) { |
| 189 | pHTInfo->IOTPeer = HT_IOT_PEER_RALINK; | 190 | ht_info->IOTPeer = HT_IOT_PEER_RALINK; |
| 190 | } else if ((net->atheros_cap_exist) || | 191 | } else if ((net->atheros_cap_exist) || |
| 191 | (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) || | 192 | (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) || |
| 192 | (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) { | 193 | (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) { |
| 193 | pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS; | 194 | ht_info->IOTPeer = HT_IOT_PEER_ATHEROS; |
| 194 | } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) || | 195 | } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) || |
| 195 | net->cisco_cap_exist) { | 196 | net->cisco_cap_exist) { |
| 196 | pHTInfo->IOTPeer = HT_IOT_PEER_CISCO; | 197 | ht_info->IOTPeer = HT_IOT_PEER_CISCO; |
| 197 | } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) || | 198 | } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) || |
| 198 | net->marvell_cap_exist) { | 199 | net->marvell_cap_exist) { |
| 199 | pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL; | 200 | ht_info->IOTPeer = HT_IOT_PEER_MARVELL; |
| 200 | } else if (net->airgo_cap_exist) { | 201 | } else if (net->airgo_cap_exist) { |
| 201 | pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO; | 202 | ht_info->IOTPeer = HT_IOT_PEER_AIRGO; |
| 202 | } else { | 203 | } else { |
| 203 | pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; | 204 | ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; |
| 204 | } | 205 | } |
| 205 | 206 | ||
| 206 | netdev_dbg(ieee->dev, "IOTPEER: %x\n", pHTInfo->IOTPeer); | 207 | netdev_dbg(ieee->dev, "IOTPEER: %x\n", ht_info->IOTPeer); |
| 207 | } | 208 | } |
| 208 | 209 | ||
| 209 | static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr) | 210 | static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr) |
| @@ -232,7 +233,7 @@ static u8 HTIOTActIsMgntUseCCK6M(struct rtllib_device *ieee, · 22 unmodified lines | |||
| 232 | { | 233 | { |
| 233 | u8 retValue = 0; | 234 | u8 retValue = 0; |
| 234 | 235 | ||
| 235 | if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) | 236 | if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) |
| 236 | retValue = 1; | 237 | retValue = 1; |
| 237 | 238 | ||
| 238 | return retValue; | 239 | return retValue; |
| @@ -242,49 +243,49 @@ static u8 HTIOTActIsCCDFsync(struct rtllib_device *ieee) · 3 unmodified lines | |||
| 242 | { | 243 | { |
| 243 | u8 retValue = 0; | 244 | u8 retValue = 0; |
| 244 | 245 | ||
| 245 | if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) | 246 | if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) |
| 246 | retValue = 1; | 247 | retValue = 1; |
| 247 | return retValue; | 248 | return retValue; |
| 248 | } | 249 | } |
| 249 | 250 | ||
| 250 | static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss) | 251 | static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss) |
| 251 | { | 252 | { |
| 252 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 253 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 253 | 254 | ||
| 254 | pHTInfo->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL; | 255 | ht_info->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL; |
| 255 | 256 | ||
| 256 | if (pHTInfo->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss) | 257 | if (ht_info->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss) |
| 257 | pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R; | 258 | ht_info->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R; |
| 258 | 259 | ||
| 259 | if (pHTInfo->iot_action & HT_IOT_ACT_AMSDU_ENABLE) | 260 | if (ht_info->iot_action & HT_IOT_ACT_AMSDU_ENABLE) |
| 260 | pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU; | 261 | ht_info->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU; |
| 261 | } | 262 | } |
| 262 | 263 | ||
| 263 | void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo) | 264 | void HTResetIOTSetting(struct rt_hi_throughput *ht_info) |
| 264 | { | 265 | { |
| 265 | pHTInfo->iot_action = 0; | 266 | ht_info->iot_action = 0; |
| 266 | pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; | 267 | ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; |
| 267 | pHTInfo->iot_ra_func = 0; | 268 | ht_info->iot_ra_func = 0; |
| 268 | } | 269 | } |
| 269 | 270 | ||
| 270 | void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, | 271 | void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, |
| 271 | u8 *len, u8 IsEncrypt, bool bAssoc) | 272 | u8 *len, u8 IsEncrypt, bool bAssoc) |
| 272 | { | 273 | { |
| 273 | struct rt_hi_throughput *pHT = ieee->pHTInfo; | 274 | struct rt_hi_throughput *pHT = ieee->ht_info; |
| 274 | struct ht_capab_ele *pCapELE = NULL; | 275 | struct ht_capab_ele *pCapELE = NULL; |
| 275 | 276 | ||
| 276 | if (!posHTCap || !pHT) { | 277 | if (!posHTCap || !pHT) { |
| 277 | netdev_warn(ieee->dev, | 278 | netdev_warn(ieee->dev, |
| 278 | "%s(): posHTCap and pHTInfo are null\n", __func__); | 279 | "%s(): posHTCap and ht_info are null\n", __func__); |
| 279 | return; | 280 | return; |
| 280 | } | 281 | } |
| 281 | memset(posHTCap, 0, *len); | 282 | memset(posHTCap, 0, *len); |
| 282 | 283 | ||
| 283 | if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) { | 284 | if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) { |
| 284 | u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; | 285 | static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; |
| 285 | 286 | ||
| 286 | memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); | 287 | memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); |
| 287 | pCapELE = (struct ht_capab_ele *)&(posHTCap[4]); | 288 | pCapELE = (struct ht_capab_ele *)&posHTCap[4]; |
| 288 | *len = 30 + 2; | 289 | *len = 30 + 2; |
| 289 | } else { | 290 | } else { |
| 290 | pCapELE = (struct ht_capab_ele *)posHTCap; | 291 | pCapELE = (struct ht_capab_ele *)posHTCap; |
| @@ -322,7 +323,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, · 31 unmodified lines | |||
| 322 | pCapELE->MPDUDensity = 0; | 323 | pCapELE->MPDUDensity = 0; |
| 323 | } | 324 | } |
| 324 | 325 | ||
| 325 | memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16); | 326 | memcpy(pCapELE->MCS, ieee->reg_dot11ht_oper_rate_set, 16); |
| 326 | memset(&pCapELE->ExtHTCapInfo, 0, 2); | 327 | memset(&pCapELE->ExtHTCapInfo, 0, 2); |
| 327 | memset(pCapELE->TxBFCap, 0, 4); | 328 | memset(pCapELE->TxBFCap, 0, 4); |
| 328 | 329 | ||
| @@ -351,7 +352,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, · 22 unmodified lines | |||
| 351 | void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, | 352 | void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, |
| 352 | u8 *len, u8 IsEncrypt) | 353 | u8 *len, u8 IsEncrypt) |
| 353 | { | 354 | { |
| 354 | struct rt_hi_throughput *pHT = ieee->pHTInfo; | 355 | struct rt_hi_throughput *pHT = ieee->ht_info; |
| 355 | struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; | 356 | struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; |
| 356 | 357 | ||
| 357 | if (!posHTInfo || !pHTInfoEle) { | 358 | if (!posHTInfo || !pHTInfoEle) { |
| @@ -488,7 +489,7 @@ static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS, · 130 unmodified lines | |||
| 488 | u8 i; | 489 | u8 i; |
| 489 | 490 | ||
| 490 | for (i = 0; i <= 15; i++) | 491 | for (i = 0; i <= 15; i++) |
| 491 | pOperateMCS[i] = ieee->Regdot11TxHTOperationalRateSet[i] & | 492 | pOperateMCS[i] = ieee->reg_dot11tx_ht_oper_rate_set[i] & |
| 492 | pSupportMCS[i]; | 493 | pSupportMCS[i]; |
| 493 | 494 | ||
| 494 | HT_PickMCSRate(ieee, pOperateMCS); | 495 | HT_PickMCSRate(ieee, pOperateMCS); |
| @@ -508,163 +509,159 @@ void HTSetConnectBwMode(struct rtllib_device *ieee, · 13 unmodified lines | |||
| 508 | 509 | ||
| 509 | void HTOnAssocRsp(struct rtllib_device *ieee) | 510 | void HTOnAssocRsp(struct rtllib_device *ieee) |
| 510 | { | 511 | { |
| 511 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 512 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 512 | struct ht_capab_ele *pPeerHTCap = NULL; | 513 | struct ht_capab_ele *pPeerHTCap = NULL; |
| 513 | struct ht_info_ele *pPeerHTInfo = NULL; | 514 | struct ht_info_ele *pPeerHTInfo = NULL; |
| 514 | u16 nMaxAMSDUSize = 0; | 515 | u16 nMaxAMSDUSize = 0; |
| 515 | u8 *pMcsFilter = NULL; | 516 | u8 *pMcsFilter = NULL; |
| 516 | 517 | ||
| 517 | static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; | 518 | static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; |
| 518 | static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; | 519 | static const u8 EWC11NHTInfo[] = { 0x00, 0x90, 0x4c, 0x34 }; |
| 519 | 520 | ||
| 520 | if (!pHTInfo->bCurrentHTSupport) { | 521 | if (!ht_info->bCurrentHTSupport) { |
| 521 | netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__); | 522 | netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__); |
| 522 | return; | 523 | return; |
| 523 | } | 524 | } |
| 524 | netdev_dbg(ieee->dev, "%s(): HT_ENABLE\n", __func__); | 525 | netdev_dbg(ieee->dev, "%s(): HT_ENABLE\n", __func__); |
| 525 | 526 | ||
| 526 | if (!memcmp(pHTInfo->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap))) | 527 | if (!memcmp(ht_info->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap))) |
| 527 | pPeerHTCap = (struct ht_capab_ele *)(&pHTInfo->PeerHTCapBuf[4]); | 528 | pPeerHTCap = (struct ht_capab_ele *)(&ht_info->PeerHTCapBuf[4]); |
| 528 | else | 529 | else |
| 529 | pPeerHTCap = (struct ht_capab_ele *)(pHTInfo->PeerHTCapBuf); | 530 | pPeerHTCap = (struct ht_capab_ele *)(ht_info->PeerHTCapBuf); |
| 530 | 531 | ||
| 531 | if (!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) | 532 | if (!memcmp(ht_info->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) |
| 532 | pPeerHTInfo = (struct ht_info_ele *) | 533 | pPeerHTInfo = (struct ht_info_ele *) |
| 533 | (&pHTInfo->PeerHTInfoBuf[4]); | 534 | (&ht_info->PeerHTInfoBuf[4]); |
| 534 | else | 535 | else |
| 535 | pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf); | 536 | pPeerHTInfo = (struct ht_info_ele *)(ht_info->PeerHTInfoBuf); |
| 536 | 537 | ||
| 537 | #ifdef VERBOSE_DEBUG | 538 | #ifdef VERBOSE_DEBUG |
| 538 | print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE, | 539 | print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE, |
| 539 | pPeerHTCap, sizeof(struct ht_capab_ele)); | 540 | pPeerHTCap, sizeof(struct ht_capab_ele)); |
| 540 | #endif | 541 | #endif |
| 541 | HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), | 542 | HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), |
| 542 | (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); | 543 | (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); |
| 543 | pHTInfo->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? | 544 | ht_info->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? |
| 544 | true : false); | 545 | true : false); |
| 545 | 546 | ||
| 546 | pHTInfo->bCurShortGI20MHz = ((pHTInfo->bRegShortGI20MHz) ? | 547 | ht_info->bCurShortGI20MHz = ((ht_info->bRegShortGI20MHz) ? |
| 547 | ((pPeerHTCap->ShortGI20Mhz == 1) ? | 548 | ((pPeerHTCap->ShortGI20Mhz == 1) ? |
| 548 | true : false) : false); | 549 | true : false) : false); |
| 549 | pHTInfo->bCurShortGI40MHz = ((pHTInfo->bRegShortGI40MHz) ? | 550 | ht_info->bCurShortGI40MHz = ((ht_info->bRegShortGI40MHz) ? |
| 550 | ((pPeerHTCap->ShortGI40Mhz == 1) ? | 551 | ((pPeerHTCap->ShortGI40Mhz == 1) ? |
| 551 | true : false) : false); | 552 | true : false) : false); |
| 552 | 553 | ||
| 553 | pHTInfo->bCurSuppCCK = ((pHTInfo->bRegSuppCCK) ? | 554 | ht_info->bCurSuppCCK = ((ht_info->bRegSuppCCK) ? |
| 554 | ((pPeerHTCap->DssCCk == 1) ? true : | 555 | ((pPeerHTCap->DssCCk == 1) ? true : |
| 555 | false) : false); | 556 | false) : false); |
| 556 | 557 | ||
| 557 | pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; | 558 | ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support; |
| 558 | 559 | ||
| 559 | nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935; | 560 | nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935; |
| 560 | 561 | ||
| 561 | if (pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize) | 562 | if (ht_info->nAMSDU_MaxSize > nMaxAMSDUSize) |
| 562 | pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; | 563 | ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; |
| 563 | else | 564 | else |
| 564 | pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; | 565 | ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; |
| 565 | 566 | ||
| 566 | pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; | 567 | ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable; |
| 567 | if (ieee->rtllib_ap_sec_type && | 568 | if (ieee->rtllib_ap_sec_type && |
| 568 | (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { | 569 | (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { |
| 569 | if ((pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) || | 570 | if ((ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) || |
| 570 | (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN)) | 571 | (ht_info->IOTPeer == HT_IOT_PEER_UNKNOWN)) |
| 571 | pHTInfo->bCurrentAMPDUEnable = false; | 572 | ht_info->bCurrentAMPDUEnable = false; |
| 572 | } | 573 | } |
| 573 | 574 | ||
| 574 | if (!pHTInfo->reg_rt2rt_aggregation) { | 575 | if (!ht_info->reg_rt2rt_aggregation) { |
| 575 | if (pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) | 576 | if (ht_info->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) |
| 576 | pHTInfo->CurrentAMPDUFactor = | 577 | ht_info->CurrentAMPDUFactor = |
| 577 | pPeerHTCap->MaxRxAMPDUFactor; | 578 | pPeerHTCap->MaxRxAMPDUFactor; |
| 578 | else | 579 | else |
| 579 | pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; | 580 | ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; |
| 580 | 581 | ||
| 581 | } else { | 582 | } else { |
| 582 | if (ieee->current_network.bssht.bd_rt2rt_aggregation) { | 583 | if (ieee->current_network.bssht.bd_rt2rt_aggregation) { |
| 583 | if (ieee->pairwise_key_type != KEY_TYPE_NA) | 584 | if (ieee->pairwise_key_type != KEY_TYPE_NA) |
| 584 | pHTInfo->CurrentAMPDUFactor = | 585 | ht_info->CurrentAMPDUFactor = |
| 585 | pPeerHTCap->MaxRxAMPDUFactor; | 586 | pPeerHTCap->MaxRxAMPDUFactor; |
| 586 | else | 587 | else |
| 587 | pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K; | 588 | ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K; |
| 588 | } else { | 589 | } else { |
| 589 | if (pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K) | 590 | ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor, |
| 590 | pHTInfo->CurrentAMPDUFactor = | 591 | HT_AGG_SIZE_32K); |
| 591 | pPeerHTCap->MaxRxAMPDUFactor; | ||
| 592 | else | ||
| 593 | pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K; | ||
| 594 | } | 592 | } |
| 595 | } | 593 | } |
| 596 | if (pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) | 594 | ht_info->current_mpdu_density = max_t(u8, ht_info->MPDU_Density, |
| 597 | pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density; | 595 | pPeerHTCap->MPDUDensity); |
| 598 | else | 596 | if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) { |
| 599 | pHTInfo->current_mpdu_density = pPeerHTCap->MPDUDensity; | 597 | ht_info->bCurrentAMPDUEnable = false; |
| 600 | if (pHTInfo->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) { | 598 | ht_info->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; |
| 601 | pHTInfo->bCurrentAMPDUEnable = false; | ||
| 602 | pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; | ||
| 603 | } | 599 | } |
| 604 | pHTInfo->cur_rx_reorder_enable = pHTInfo->reg_rx_reorder_enable; | 600 | ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable; |
| 605 | 601 | ||
| 606 | if (pPeerHTCap->MCS[0] == 0) | 602 | if (pPeerHTCap->MCS[0] == 0) |
| 607 | pPeerHTCap->MCS[0] = 0xff; | 603 | pPeerHTCap->MCS[0] = 0xff; |
| 608 | 604 | ||
| 609 | HTIOTActDetermineRaFunc(ieee, ((pPeerHTCap->MCS[1]) != 0)); | 605 | HTIOTActDetermineRaFunc(ieee, ((pPeerHTCap->MCS[1]) != 0)); |
| 610 | 606 | ||
| 611 | HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet); | 607 | HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set); |
| 612 | 608 | ||
| 613 | pHTInfo->peer_mimo_ps = pPeerHTCap->MimoPwrSave; | 609 | ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave; |
| 614 | if (pHTInfo->peer_mimo_ps == MIMO_PS_STATIC) | 610 | if (ht_info->peer_mimo_ps == MIMO_PS_STATIC) |
| 615 | pMcsFilter = MCS_FILTER_1SS; | 611 | pMcsFilter = MCS_FILTER_1SS; |
| 616 | else | 612 | else |
| 617 | pMcsFilter = MCS_FILTER_ALL; | 613 | pMcsFilter = MCS_FILTER_ALL; |
| 618 | ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, | 614 | ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, |
| 619 | ieee->dot11HTOperationalRateSet, pMcsFilter); | 615 | ieee->dot11ht_oper_rate_set, |
| 616 | pMcsFilter); | ||
| 620 | ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; | 617 | ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; |
| 621 | 618 | ||
| 622 | pHTInfo->current_op_mode = pPeerHTInfo->OptMode; | 619 | ht_info->current_op_mode = pPeerHTInfo->OptMode; |
| 623 | } | 620 | } |
| 624 | 621 | ||
| 625 | void HTInitializeHTInfo(struct rtllib_device *ieee) | 622 | void HTInitializeHTInfo(struct rtllib_device *ieee) |
| 626 | { | 623 | { |
| 627 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 624 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 628 | 625 | ||
| 629 | pHTInfo->bCurrentHTSupport = false; | 626 | ht_info->bCurrentHTSupport = false; |
| 630 | 627 | ||
| 631 | pHTInfo->bCurBW40MHz = false; | 628 | ht_info->bCurBW40MHz = false; |
| 632 | pHTInfo->cur_tx_bw40mhz = false; | 629 | ht_info->cur_tx_bw40mhz = false; |
| 633 | 630 | ||
| 634 | pHTInfo->bCurShortGI20MHz = false; | 631 | ht_info->bCurShortGI20MHz = false; |
| 635 | pHTInfo->bCurShortGI40MHz = false; | 632 | ht_info->bCurShortGI40MHz = false; |
| 636 | pHTInfo->forced_short_gi = false; | 633 | ht_info->forced_short_gi = false; |
| 637 | 634 | ||
| 638 | pHTInfo->bCurSuppCCK = true; | 635 | ht_info->bCurSuppCCK = true; |
| 639 | 636 | ||
| 640 | pHTInfo->bCurrent_AMSDU_Support = false; | 637 | ht_info->bCurrent_AMSDU_Support = false; |
| 641 | pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; | 638 | ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; |
| 642 | pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density; | 639 | ht_info->current_mpdu_density = ht_info->MPDU_Density; |
| 643 | pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; | 640 | ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; |
| 644 | 641 | ||
| 645 | memset((void *)(&(pHTInfo->SelfHTCap)), 0, | 642 | memset((void *)(&ht_info->SelfHTCap), 0, |
| 646 | sizeof(pHTInfo->SelfHTCap)); | 643 | sizeof(ht_info->SelfHTCap)); |
| 647 | memset((void *)(&(pHTInfo->SelfHTInfo)), 0, | 644 | memset((void *)(&ht_info->SelfHTInfo), 0, |
| 648 | sizeof(pHTInfo->SelfHTInfo)); | 645 | sizeof(ht_info->SelfHTInfo)); |
| 649 | memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0, | 646 | memset((void *)(&ht_info->PeerHTCapBuf), 0, |
| 650 | sizeof(pHTInfo->PeerHTCapBuf)); | 647 | sizeof(ht_info->PeerHTCapBuf)); |
| 651 | memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0, | 648 | memset((void *)(&ht_info->PeerHTInfoBuf), 0, |
| 652 | sizeof(pHTInfo->PeerHTInfoBuf)); | 649 | sizeof(ht_info->PeerHTInfoBuf)); |
| 653 | 650 | ||
| 654 | pHTInfo->sw_bw_in_progress = false; | 651 | ht_info->sw_bw_in_progress = false; |
| 655 | 652 | ||
| 656 | pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE; | 653 | ht_info->ePeerHTSpecVer = HT_SPEC_VER_IEEE; |
| 657 | 654 | ||
| 658 | pHTInfo->current_rt2rt_aggregation = false; | 655 | ht_info->current_rt2rt_aggregation = false; |
| 659 | pHTInfo->current_rt2rt_long_slot_time = false; | 656 | ht_info->current_rt2rt_long_slot_time = false; |
| 660 | pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; | 657 | ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; |
| 661 | 658 | ||
| 662 | pHTInfo->IOTPeer = 0; | 659 | ht_info->IOTPeer = 0; |
| 663 | pHTInfo->iot_action = 0; | 660 | ht_info->iot_action = 0; |
| 664 | pHTInfo->iot_ra_func = 0; | 661 | ht_info->iot_ra_func = 0; |
| 665 | 662 | ||
| 666 | { | 663 | { |
| 667 | u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]); | 664 | u8 *RegHTSuppRateSets = &ieee->reg_ht_supp_rate_set[0]; |
| 668 | 665 | ||
| 669 | RegHTSuppRateSets[0] = 0xFF; | 666 | RegHTSuppRateSets[0] = 0xFF; |
| 670 | RegHTSuppRateSets[1] = 0xFF; | 667 | RegHTSuppRateSets[1] = 0xFF; |
| @@ -690,130 +687,130 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) · 19 unmodified lines | |||
| 690 | void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, | 687 | void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, |
| 691 | struct rtllib_network *pNetwork) | 688 | struct rtllib_network *pNetwork) |
| 692 | { | 689 | { |
| 693 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 690 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 694 | u8 bIOTAction = 0; | 691 | u8 bIOTAction = 0; |
| 695 | 692 | ||
| 696 | /* unmark bEnableHT flag here is the same reason why unmarked in | 693 | /* unmark enable_ht flag here is the same reason why unmarked in |
| 697 | * function rtllib_softmac_new_net. WB 2008.09.10 | 694 | * function rtllib_softmac_new_net. WB 2008.09.10 |
| 698 | */ | 695 | */ |
| 699 | if (pNetwork->bssht.bd_support_ht) { | 696 | if (pNetwork->bssht.bd_support_ht) { |
| 700 | pHTInfo->bCurrentHTSupport = true; | 697 | ht_info->bCurrentHTSupport = true; |
| 701 | pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; | 698 | ht_info->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; |
| 702 | 699 | ||
| 703 | if (pNetwork->bssht.bd_ht_cap_len > 0 && | 700 | if (pNetwork->bssht.bd_ht_cap_len > 0 && |
| 704 | pNetwork->bssht.bd_ht_cap_len <= sizeof(pHTInfo->PeerHTCapBuf)) | 701 | pNetwork->bssht.bd_ht_cap_len <= sizeof(ht_info->PeerHTCapBuf)) |
| 705 | memcpy(pHTInfo->PeerHTCapBuf, | 702 | memcpy(ht_info->PeerHTCapBuf, |
| 706 | pNetwork->bssht.bd_ht_cap_buf, | 703 | pNetwork->bssht.bd_ht_cap_buf, |
| 707 | pNetwork->bssht.bd_ht_cap_len); | 704 | pNetwork->bssht.bd_ht_cap_len); |
| 708 | 705 | ||
| 709 | if (pNetwork->bssht.bd_ht_info_len > 0 && | 706 | if (pNetwork->bssht.bd_ht_info_len > 0 && |
| 710 | pNetwork->bssht.bd_ht_info_len <= | 707 | pNetwork->bssht.bd_ht_info_len <= |
| 711 | sizeof(pHTInfo->PeerHTInfoBuf)) | 708 | sizeof(ht_info->PeerHTInfoBuf)) |
| 712 | memcpy(pHTInfo->PeerHTInfoBuf, | 709 | memcpy(ht_info->PeerHTInfoBuf, |
| 713 | pNetwork->bssht.bd_ht_info_buf, | 710 | pNetwork->bssht.bd_ht_info_buf, |
| 714 | pNetwork->bssht.bd_ht_info_len); | 711 | pNetwork->bssht.bd_ht_info_len); |
| 715 | 712 | ||
| 716 | if (pHTInfo->reg_rt2rt_aggregation) { | 713 | if (ht_info->reg_rt2rt_aggregation) { |
| 717 | pHTInfo->current_rt2rt_aggregation = | 714 | ht_info->current_rt2rt_aggregation = |
| 718 | pNetwork->bssht.bd_rt2rt_aggregation; | 715 | pNetwork->bssht.bd_rt2rt_aggregation; |
| 719 | pHTInfo->current_rt2rt_long_slot_time = | 716 | ht_info->current_rt2rt_long_slot_time = |
| 720 | pNetwork->bssht.bd_rt2rt_long_slot_time; | 717 | pNetwork->bssht.bd_rt2rt_long_slot_time; |
| 721 | pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; | 718 | ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; |
| 722 | } else { | 719 | } else { |
| 723 | pHTInfo->current_rt2rt_aggregation = false; | 720 | ht_info->current_rt2rt_aggregation = false; |
| 724 | pHTInfo->current_rt2rt_long_slot_time = false; | 721 | ht_info->current_rt2rt_long_slot_time = false; |
| 725 | pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; | 722 | ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; |
| 726 | } | 723 | } |
| 727 | 724 | ||
| 728 | HTIOTPeerDetermine(ieee); | 725 | HTIOTPeerDetermine(ieee); |
| 729 | 726 | ||
| 730 | pHTInfo->iot_action = 0; | 727 | ht_info->iot_action = 0; |
| 731 | bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid); | 728 | bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid); |
| 732 | if (bIOTAction) | 729 | if (bIOTAction) |
| 733 | pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS14; | 730 | ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS14; |
| 734 | 731 | ||
| 735 | bIOTAction = HTIOTActIsDisableMCS15(ieee); | 732 | bIOTAction = HTIOTActIsDisableMCS15(ieee); |
| 736 | if (bIOTAction) | 733 | if (bIOTAction) |
| 737 | pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS15; | 734 | ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS15; |
| 738 | 735 | ||
| 739 | bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee); | 736 | bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee); |
| 740 | if (bIOTAction) | 737 | if (bIOTAction) |
| 741 | pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS; | 738 | ht_info->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS; |
| 742 | 739 | ||
| 743 | bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid); | 740 | bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid); |
| 744 | if (bIOTAction) | 741 | if (bIOTAction) |
| 745 | pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO; | 742 | ht_info->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO; |
| 746 | 743 | ||
| 747 | bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork); | 744 | bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork); |
| 748 | if (bIOTAction) | 745 | if (bIOTAction) |
| 749 | pHTInfo->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M; | 746 | ht_info->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M; |
| 750 | bIOTAction = HTIOTActIsCCDFsync(ieee); | 747 | bIOTAction = HTIOTActIsCCDFsync(ieee); |
| 751 | if (bIOTAction) | 748 | if (bIOTAction) |
| 752 | pHTInfo->iot_action |= HT_IOT_ACT_CDD_FSYNC; | 749 | ht_info->iot_action |= HT_IOT_ACT_CDD_FSYNC; |
| 753 | } else { | 750 | } else { |
| 754 | pHTInfo->bCurrentHTSupport = false; | 751 | ht_info->bCurrentHTSupport = false; |
| 755 | pHTInfo->current_rt2rt_aggregation = false; | 752 | ht_info->current_rt2rt_aggregation = false; |
| 756 | pHTInfo->current_rt2rt_long_slot_time = false; | 753 | ht_info->current_rt2rt_long_slot_time = false; |
| 757 | pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; | 754 | ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; |
| 758 | 755 | ||
| 759 | pHTInfo->iot_action = 0; | 756 | ht_info->iot_action = 0; |
| 760 | pHTInfo->iot_ra_func = 0; | 757 | ht_info->iot_ra_func = 0; |
| 761 | } | 758 | } |
| 762 | } | 759 | } |
| 763 | 760 | ||
| 764 | void HT_update_self_and_peer_setting(struct rtllib_device *ieee, | 761 | void HT_update_self_and_peer_setting(struct rtllib_device *ieee, |
| 765 | struct rtllib_network *pNetwork) | 762 | struct rtllib_network *pNetwork) |
| 766 | { | 763 | { |
| 767 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 764 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 768 | struct ht_info_ele *pPeerHTInfo = | 765 | struct ht_info_ele *pPeerHTInfo = |
| 769 | (struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf; | 766 | (struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf; |
| 770 | 767 | ||
| 771 | if (pHTInfo->bCurrentHTSupport) { | 768 | if (ht_info->bCurrentHTSupport) { |
| 772 | if (pNetwork->bssht.bd_ht_info_len != 0) | 769 | if (pNetwork->bssht.bd_ht_info_len != 0) |
| 773 | pHTInfo->current_op_mode = pPeerHTInfo->OptMode; | 770 | ht_info->current_op_mode = pPeerHTInfo->OptMode; |
| 774 | } | 771 | } |
| 775 | } | 772 | } |
| 776 | EXPORT_SYMBOL(HT_update_self_and_peer_setting); | 773 | EXPORT_SYMBOL(HT_update_self_and_peer_setting); |
| 777 | 774 | ||
| 778 | void HTUseDefaultSetting(struct rtllib_device *ieee) | 775 | void HTUseDefaultSetting(struct rtllib_device *ieee) |
| 779 | { | 776 | { |
| 780 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 777 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 781 | 778 | ||
| 782 | if (pHTInfo->bEnableHT) { | 779 | if (ht_info->enable_ht) { |
| 783 | pHTInfo->bCurrentHTSupport = true; | 780 | ht_info->bCurrentHTSupport = true; |
| 784 | pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK; | 781 | ht_info->bCurSuppCCK = ht_info->bRegSuppCCK; |
| 785 | 782 | ||
| 786 | pHTInfo->bCurBW40MHz = pHTInfo->bRegBW40MHz; | 783 | ht_info->bCurBW40MHz = ht_info->bRegBW40MHz; |
| 787 | pHTInfo->bCurShortGI20MHz = pHTInfo->bRegShortGI20MHz; | 784 | ht_info->bCurShortGI20MHz = ht_info->bRegShortGI20MHz; |
| 788 | 785 | ||
| 789 | pHTInfo->bCurShortGI40MHz = pHTInfo->bRegShortGI40MHz; | 786 | ht_info->bCurShortGI40MHz = ht_info->bRegShortGI40MHz; |
| 790 | 787 | ||
| 791 | if (ieee->iw_mode == IW_MODE_ADHOC) | 788 | if (ieee->iw_mode == IW_MODE_ADHOC) |
| 792 | ieee->current_network.qos_data.active = | 789 | ieee->current_network.qos_data.active = |
| 793 | ieee->current_network.qos_data.supported; | 790 | ieee->current_network.qos_data.supported; |
| 794 | pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; | 791 | ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support; |
| 795 | pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; | 792 | ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; |
| 796 | 793 | ||
| 797 | pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; | 794 | ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable; |
| 798 | pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; | 795 | ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; |
| 799 | 796 | ||
| 800 | pHTInfo->current_mpdu_density = pHTInfo->current_mpdu_density; | 797 | ht_info->current_mpdu_density = ht_info->current_mpdu_density; |
| 801 | 798 | ||
| 802 | HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet, | 799 | HTFilterMCSRate(ieee, ieee->reg_dot11tx_ht_oper_rate_set, |
| 803 | ieee->dot11HTOperationalRateSet); | 800 | ieee->dot11ht_oper_rate_set); |
| 804 | ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, | 801 | ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, |
| 805 | ieee->dot11HTOperationalRateSet, | 802 | ieee->dot11ht_oper_rate_set, |
| 806 | MCS_FILTER_ALL); | 803 | MCS_FILTER_ALL); |
| 807 | ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; | 804 | ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; |
| 808 | 805 | ||
| 809 | } else { | 806 | } else { |
| 810 | pHTInfo->bCurrentHTSupport = false; | 807 | ht_info->bCurrentHTSupport = false; |
| 811 | } | 808 | } |
| 812 | } | 809 | } |
| 813 | 810 | ||
| 814 | u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) | 811 | u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) |
| 815 | { | 812 | { |
| 816 | if (ieee->pHTInfo->bCurrentHTSupport) { | 813 | if (ieee->ht_info->bCurrentHTSupport) { |
| 817 | if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) { | 814 | if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) { |
| 818 | netdev_dbg(ieee->dev, "HT CONTROL FILED EXIST!!\n"); | 815 | netdev_dbg(ieee->dev, "HT CONTROL FILED EXIST!!\n"); |
| 819 | return true; | 816 | return true; |
| @@ -824,13 +821,13 @@ u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) · 4 unmodified lines | |||
| 824 | 821 | ||
| 825 | static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) | 822 | static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) |
| 826 | { | 823 | { |
| 827 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 824 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 828 | 825 | ||
| 829 | if (pHTInfo->bCurBW40MHz) { | 826 | if (ht_info->bCurBW40MHz) { |
| 830 | if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) | 827 | if (ht_info->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) |
| 831 | ieee->set_chan(ieee->dev, | 828 | ieee->set_chan(ieee->dev, |
| 832 | ieee->current_network.channel + 2); | 829 | ieee->current_network.channel + 2); |
| 833 | else if (pHTInfo->CurSTAExtChnlOffset == | 830 | else if (ht_info->CurSTAExtChnlOffset == |
| 834 | HT_EXTCHNL_OFFSET_LOWER) | 831 | HT_EXTCHNL_OFFSET_LOWER) |
| 835 | ieee->set_chan(ieee->dev, | 832 | ieee->set_chan(ieee->dev, |
| 836 | ieee->current_network.channel - 2); | 833 | ieee->current_network.channel - 2); |
| @@ -839,29 +836,29 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) · 2 unmodified lines | |||
| 839 | ieee->current_network.channel); | 836 | ieee->current_network.channel); |
| 840 | 837 | ||
| 841 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, | 838 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, |
| 842 | pHTInfo->CurSTAExtChnlOffset); | 839 | ht_info->CurSTAExtChnlOffset); |
| 843 | } else { | 840 | } else { |
| 844 | ieee->set_chan(ieee->dev, ieee->current_network.channel); | 841 | ieee->set_chan(ieee->dev, ieee->current_network.channel); |
| 845 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, | 842 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, |
| 846 | HT_EXTCHNL_OFFSET_NO_EXT); | 843 | HT_EXTCHNL_OFFSET_NO_EXT); |
| 847 | } | 844 | } |
| 848 | 845 | ||
| 849 | pHTInfo->sw_bw_in_progress = false; | 846 | ht_info->sw_bw_in_progress = false; |
| 850 | } | 847 | } |
| 851 | 848 | ||
| 852 | void HTSetConnectBwMode(struct rtllib_device *ieee, | 849 | void HTSetConnectBwMode(struct rtllib_device *ieee, |
| 853 | enum ht_channel_width bandwidth, | 850 | enum ht_channel_width bandwidth, |
| 854 | enum ht_extchnl_offset Offset) | 851 | enum ht_extchnl_offset Offset) |
| 855 | { | 852 | { |
| 856 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 853 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 857 | 854 | ||
| 858 | if (!pHTInfo->bRegBW40MHz) | 855 | if (!ht_info->bRegBW40MHz) |
| 859 | return; | 856 | return; |
| 860 | 857 | ||
| 861 | if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) | 858 | if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) |
| 862 | bandwidth = HT_CHANNEL_WIDTH_20; | 859 | bandwidth = HT_CHANNEL_WIDTH_20; |
| 863 | 860 | ||
| 864 | if (pHTInfo->sw_bw_in_progress) { | 861 | if (ht_info->sw_bw_in_progress) { |
| 865 | pr_info("%s: sw_bw_in_progress!!\n", __func__); | 862 | pr_info("%s: sw_bw_in_progress!!\n", __func__); |
| 866 | return; | 863 | return; |
| 867 | } | 864 | } |
| @@ -871,21 +868,21 @@ void HTSetConnectBwMode(struct rtllib_device *ieee, · 3 unmodified lines | |||
| 871 | Offset = HT_EXTCHNL_OFFSET_NO_EXT; | 868 | Offset = HT_EXTCHNL_OFFSET_NO_EXT; |
| 872 | if (Offset == HT_EXTCHNL_OFFSET_UPPER || | 869 | if (Offset == HT_EXTCHNL_OFFSET_UPPER || |
| 873 | Offset == HT_EXTCHNL_OFFSET_LOWER) { | 870 | Offset == HT_EXTCHNL_OFFSET_LOWER) { |
| 874 | pHTInfo->bCurBW40MHz = true; | 871 | ht_info->bCurBW40MHz = true; |
| 875 | pHTInfo->CurSTAExtChnlOffset = Offset; | 872 | ht_info->CurSTAExtChnlOffset = Offset; |
| 876 | } else { | 873 | } else { |
| 877 | pHTInfo->bCurBW40MHz = false; | 874 | ht_info->bCurBW40MHz = false; |
| 878 | pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; | 875 | ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; |
| 879 | } | 876 | } |
| 880 | } else { | 877 | } else { |
| 881 | pHTInfo->bCurBW40MHz = false; | 878 | ht_info->bCurBW40MHz = false; |
| 882 | pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; | 879 | ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; |
| 883 | } | 880 | } |
| 884 | 881 | ||
| 885 | netdev_dbg(ieee->dev, "%s():pHTInfo->bCurBW40MHz:%x\n", __func__, | 882 | netdev_dbg(ieee->dev, "%s():ht_info->bCurBW40MHz:%x\n", __func__, |
| 886 | pHTInfo->bCurBW40MHz); | 883 | ht_info->bCurBW40MHz); |
| 887 | 884 | ||
| 888 | pHTInfo->sw_bw_in_progress = true; | 885 | ht_info->sw_bw_in_progress = true; |
| 889 | 886 | ||
| 890 | HTSetConnectBwModeCallback(ieee); | 887 | HTSetConnectBwModeCallback(ieee); |
| 891 | } | 888 | } |
| @@ -97,13 +97,6 @@ enum direction_value { · 96 unmodified lines | |||
| 97 | DIR_BI_DIR = 3, | 97 | DIR_BI_DIR = 3, |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | enum acm_method { | ||
| 101 | eAcmWay0_SwAndHw = 0, | ||
| 102 | eAcmWay1_HW = 1, | ||
| 103 | eAcmWay2_SW = 2, | ||
| 104 | }; | ||
| 105 | |||
| 106 | |||
| 107 | struct acm { | 100 | struct acm { |
| 108 | u64 UsedTime; | 101 | u64 UsedTime; |
| 109 | u64 MediumTime; | 102 | u64 MediumTime; |
| @@ -83,7 +83,7 @@ static void RxPktPendingTimeout(struct timer_list *t) · 82 unmodified lines | |||
| 83 | if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { | 83 | if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { |
| 84 | pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq; | 84 | pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq; |
| 85 | mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies + | 85 | mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies + |
| 86 | msecs_to_jiffies(ieee->pHTInfo->rx_reorder_pending_time) | 86 | msecs_to_jiffies(ieee->ht_info->rx_reorder_pending_time) |
| 87 | ); | 87 | ); |
| 88 | } | 88 | } |
| 89 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); | 89 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); |
| @@ -111,11 +111,11 @@ static inline void *netdev_priv_rsl(struct net_device *dev) · 110 unmodified lines | |||
| 111 | #define SUPPORT_CKIP_MIC 0x08 | 111 | #define SUPPORT_CKIP_MIC 0x08 |
| 112 | #define SUPPORT_CKIP_PK 0x10 | 112 | #define SUPPORT_CKIP_PK 0x10 |
| 113 | #define RT_RF_OFF_LEVL_HALT_NIC BIT3 | 113 | #define RT_RF_OFF_LEVL_HALT_NIC BIT3 |
| 114 | #define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) \ | 114 | #define RT_IN_PS_LEVEL(psc, _PS_FLAG) \ |
| 115 | ((pPSC->CurPsLevel & _PS_FLAG) ? true : false) | 115 | ((psc->CurPsLevel & _PS_FLAG) ? true : false) |
| 116 | #define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) \ | 116 | #define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \ |
| 117 | (pPSC->CurPsLevel &= (~(_PS_FLAG))) | 117 | (psc->CurPsLevel &= (~(_PS_FLAG))) |
| 118 | #define RT_SET_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel |= _PS_FLAG) | 118 | #define RT_SET_PS_LEVEL(psc, _PS_FLAG) (psc->CurPsLevel |= _PS_FLAG) |
| 119 | 119 | ||
| 120 | /* defined for skb cb field */ | 120 | /* defined for skb cb field */ |
| 121 | /* At most 28 byte */ | 121 | /* At most 28 byte */ |
| @@ -126,8 +126,8 @@ struct cb_desc { · 4 unmodified lines | |||
| 126 | u8 bFirstSeg:1; | 126 | u8 bFirstSeg:1; |
| 127 | u8 bLastSeg:1; | 127 | u8 bLastSeg:1; |
| 128 | u8 bEncrypt:1; | 128 | u8 bEncrypt:1; |
| 129 | u8 bTxDisableRateFallBack:1; | 129 | u8 tx_dis_rate_fallback:1; |
| 130 | u8 bTxUseDriverAssingedRate:1; | 130 | u8 tx_use_drv_assinged_rate:1; |
| 131 | u8 bHwSec:1; | 131 | u8 bHwSec:1; |
| 132 | 132 | ||
| 133 | u8 nStuckCount; | 133 | u8 nStuckCount; |
| @@ -1250,23 +1250,17 @@ enum rt_rf_power_state { · 1116 unmodified lines | |||
| 1250 | }; | 1250 | }; |
| 1251 | 1251 | ||
| 1252 | struct rt_pwr_save_ctrl { | 1252 | struct rt_pwr_save_ctrl { |
| 1253 | |||
| 1254 | bool bInactivePs; | ||
| 1255 | bool bIPSModeBackup; | ||
| 1256 | bool bSwRfProcessing; | 1253 | bool bSwRfProcessing; |
| 1257 | enum rt_rf_power_state eInactivePowerState; | 1254 | enum rt_rf_power_state eInactivePowerState; |
| 1258 | enum ips_callback_function ReturnPoint; | 1255 | enum ips_callback_function ReturnPoint; |
| 1259 | 1256 | ||
| 1260 | bool bLeisurePs; | 1257 | bool bLeisurePs; |
| 1261 | u8 LpsIdleCount; | 1258 | u8 LpsIdleCount; |
| 1262 | u8 RegMaxLPSAwakeIntvl; | 1259 | u8 reg_max_lps_awake_intvl; |
| 1263 | u8 LPSAwakeIntvl; | 1260 | u8 LPSAwakeIntvl; |
| 1264 | 1261 | ||
| 1265 | u32 CurPsLevel; | 1262 | u32 CurPsLevel; |
| 1266 | u32 RegRfPsLevel; | 1263 | u32 RegRfPsLevel; |
| 1267 | |||
| 1268 | bool bFwCtrlLPS; | ||
| 1269 | |||
| 1270 | }; | 1264 | }; |
| 1271 | 1265 | ||
| 1272 | #define RT_RF_CHANGE_SOURCE u32 | 1266 | #define RT_RF_CHANGE_SOURCE u32 |
| @@ -1390,8 +1384,8 @@ struct rt_pmkid_list { · 117 unmodified lines | |||
| 1390 | }; | 1384 | }; |
| 1391 | 1385 | ||
| 1392 | struct rt_intel_promisc_mode { | 1386 | struct rt_intel_promisc_mode { |
| 1393 | bool bPromiscuousOn; | 1387 | bool promiscuous_on; |
| 1394 | bool bFilterSourceStationFrame; | 1388 | bool fltr_src_sta_frame; |
| 1395 | }; | 1389 | }; |
| 1396 | 1390 | ||
| 1397 | 1391 | ||
| @@ -1438,17 +1432,17 @@ struct rtllib_device { · 40 unmodified lines | |||
| 1438 | RT_RF_CHANGE_SOURCE rf_off_reason; | 1432 | RT_RF_CHANGE_SOURCE rf_off_reason; |
| 1439 | bool is_set_key; | 1433 | bool is_set_key; |
| 1440 | bool wx_set_enc; | 1434 | bool wx_set_enc; |
| 1441 | struct rt_hi_throughput *pHTInfo; | 1435 | struct rt_hi_throughput *ht_info; |
| 1442 | 1436 | ||
| 1443 | spinlock_t reorder_spinlock; | 1437 | spinlock_t reorder_spinlock; |
| 1444 | u8 Regdot11HTOperationalRateSet[16]; | 1438 | u8 reg_dot11ht_oper_rate_set[16]; |
| 1445 | u8 Regdot11TxHTOperationalRateSet[16]; | 1439 | u8 reg_dot11tx_ht_oper_rate_set[16]; |
| 1446 | u8 dot11HTOperationalRateSet[16]; | 1440 | u8 dot11ht_oper_rate_set[16]; |
| 1447 | u8 RegHTSuppRateSet[16]; | 1441 | u8 reg_ht_supp_rate_set[16]; |
| 1448 | u8 HTCurrentOperaRate; | 1442 | u8 HTCurrentOperaRate; |
| 1449 | u8 HTHighestOperaRate; | 1443 | u8 HTHighestOperaRate; |
| 1450 | u8 bTxDisableRateFallBack; | 1444 | u8 tx_dis_rate_fallback; |
| 1451 | u8 bTxUseDriverAssingedRate; | 1445 | u8 tx_use_drv_assinged_rate; |
| 1452 | u8 bTxEnableFwCalcDur; | 1446 | u8 bTxEnableFwCalcDur; |
| 1453 | atomic_t atm_swbw; | 1447 | atomic_t atm_swbw; |
| 1454 | 1448 | ||
| @@ -1476,8 +1470,8 @@ struct rtllib_device { · 21 unmodified lines | |||
| 1476 | int scan_age; | 1470 | int scan_age; |
| 1477 | 1471 | ||
| 1478 | int iw_mode; /* operating mode (IW_MODE_*) */ | 1472 | int iw_mode; /* operating mode (IW_MODE_*) */ |
| 1479 | bool bNetPromiscuousMode; | 1473 | bool net_promiscuous_md; |
| 1480 | struct rt_intel_promisc_mode IntelPromiscuousModeInfo; | 1474 | struct rt_intel_promisc_mode intel_promiscuous_md_info; |
| 1481 | 1475 | ||
| 1482 | spinlock_t lock; | 1476 | spinlock_t lock; |
| 1483 | spinlock_t wpax_suitlist_lock; | 1477 | spinlock_t wpax_suitlist_lock; |
| @@ -1630,7 +1624,6 @@ struct rtllib_device { · 146 unmodified lines | |||
| 1630 | int mgmt_queue_tail; | 1624 | int mgmt_queue_tail; |
| 1631 | u8 AsocRetryCount; | 1625 | u8 AsocRetryCount; |
| 1632 | struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; | 1626 | struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; |
| 1633 | struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE]; | ||
| 1634 | 1627 | ||
| 1635 | bool bdynamic_txpower_enable; | 1628 | bool bdynamic_txpower_enable; |
| 1636 | 1629 | ||
| @@ -1649,9 +1642,9 @@ struct rtllib_device { · 12 unmodified lines | |||
| 1649 | struct bandwidth_autoswitch bandwidth_auto_switch; | 1642 | struct bandwidth_autoswitch bandwidth_auto_switch; |
| 1650 | bool FwRWRF; | 1643 | bool FwRWRF; |
| 1651 | 1644 | ||
| 1652 | struct rt_link_detect LinkDetectInfo; | 1645 | struct rt_link_detect link_detect_info; |
| 1653 | bool bIsAggregateFrame; | 1646 | bool bIsAggregateFrame; |
| 1654 | struct rt_pwr_save_ctrl PowerSaveControl; | 1647 | struct rt_pwr_save_ctrl pwr_save_ctrl; |
| 1655 | 1648 | ||
| 1656 | /* used if IEEE_SOFTMAC_TX_QUEUE is set */ | 1649 | /* used if IEEE_SOFTMAC_TX_QUEUE is set */ |
| 1657 | struct tx_pending tx_pending; | 1650 | struct tx_pending tx_pending; |
| @@ -2095,7 +2088,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, · 437 unmodified lines | |||
| 2095 | extern u8 MCS_FILTER_ALL[]; | 2088 | extern u8 MCS_FILTER_ALL[]; |
| 2096 | extern u16 MCS_DATA_RATE[2][2][77]; | 2089 | extern u16 MCS_DATA_RATE[2][2][77]; |
| 2097 | u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame); | 2090 | u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame); |
| 2098 | void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo); | 2091 | void HTResetIOTSetting(struct rt_hi_throughput *ht_info); |
| 2099 | bool IsHTHalfNmodeAPs(struct rtllib_device *ieee); | 2092 | bool IsHTHalfNmodeAPs(struct rtllib_device *ieee); |
| 2100 | u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate); | 2093 | u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate); |
| 2101 | int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb); | 2094 | int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb); |
| @@ -62,7 +62,7 @@ static void *rtllib_tkip_init(int key_idx) · 61 unmodified lines | |||
| 62 | return NULL; | 62 | return NULL; |
| 63 | 63 | ||
| 64 | priv = kzalloc(sizeof(*priv), GFP_ATOMIC); | 64 | priv = kzalloc(sizeof(*priv), GFP_ATOMIC); |
| 65 | if (priv == NULL) | 65 | if (!priv) |
| 66 | goto fail; | 66 | goto fail; |
| 67 | priv->key_idx = key_idx; | 67 | priv->key_idx = key_idx; |
| 68 | 68 | ||
| @@ -91,7 +91,6 @@ fail: · 22 unmodified lines | |||
| 91 | return NULL; | 91 | return NULL; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | |||
| 95 | static void rtllib_tkip_deinit(void *priv) | 94 | static void rtllib_tkip_deinit(void *priv) |
| 96 | { | 95 | { |
| 97 | struct rtllib_tkip_data *_priv = priv; | 96 | struct rtllib_tkip_data *_priv = priv; |
| @@ -103,49 +102,41 @@ static void rtllib_tkip_deinit(void *priv) · 5 unmodified lines | |||
| 103 | kfree_sensitive(priv); | 102 | kfree_sensitive(priv); |
| 104 | } | 103 | } |
| 105 | 104 | ||
| 106 | |||
| 107 | static inline u16 RotR1(u16 val) | 105 | static inline u16 RotR1(u16 val) |
| 108 | { | 106 | { |
| 109 | return (val >> 1) | (val << 15); | 107 | return (val >> 1) | (val << 15); |
| 110 | } | 108 | } |
| 111 | 109 | ||
| 112 | |||
| 113 | static inline u8 Lo8(u16 val) | 110 | static inline u8 Lo8(u16 val) |
| 114 | { | 111 | { |
| 115 | return val & 0xff; | 112 | return val & 0xff; |
| 116 | } | 113 | } |
| 117 | 114 | ||
| 118 | |||
| 119 | static inline u8 Hi8(u16 val) | 115 | static inline u8 Hi8(u16 val) |
| 120 | { | 116 | { |
| 121 | return val >> 8; | 117 | return val >> 8; |
| 122 | } | 118 | } |
| 123 | 119 | ||
| 124 | |||
| 125 | static inline u16 Lo16(u32 val) | 120 | static inline u16 Lo16(u32 val) |
| 126 | { | 121 | { |
| 127 | return val & 0xffff; | 122 | return val & 0xffff; |
| 128 | } | 123 | } |
| 129 | 124 | ||
| 130 | |||
| 131 | static inline u16 Hi16(u32 val) | 125 | static inline u16 Hi16(u32 val) |
| 132 | { | 126 | { |
| 133 | return val >> 16; | 127 | return val >> 16; |
| 134 | } | 128 | } |
| 135 | 129 | ||
| 136 | |||
| 137 | static inline u16 Mk16(u8 hi, u8 lo) | 130 | static inline u16 Mk16(u8 hi, u8 lo) |
| 138 | { | 131 | { |
| 139 | return lo | (hi << 8); | 132 | return lo | (hi << 8); |
| 140 | } | 133 | } |
| 141 | 134 | ||
| 142 | |||
| 143 | static inline u16 Mk16_le(u16 *v) | 135 | static inline u16 Mk16_le(u16 *v) |
| 144 | { | 136 | { |
| 145 | return *v; | 137 | return *v; |
| 146 | } | 138 | } |
| 147 | 139 | ||
| 148 | |||
| 149 | static const u16 Sbox[256] = { | 140 | static const u16 Sbox[256] = { |
| 150 | 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, | 141 | 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, |
| 151 | 0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A, | 142 | 0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A, |
| @@ -181,17 +172,14 @@ static const u16 Sbox[256] = { · 29 unmodified lines | |||
| 181 | 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, | 172 | 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, |
| 182 | }; | 173 | }; |
| 183 | 174 | ||
| 184 | |||
| 185 | static inline u16 _S_(u16 v) | 175 | static inline u16 _S_(u16 v) |
| 186 | { | 176 | { |
| 187 | u16 t = Sbox[Hi8(v)]; | 177 | u16 t = Sbox[Hi8(v)]; |
| 188 | return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8)); | 178 | return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8)); |
| 189 | } | 179 | } |
| 190 | 180 | ||
| 191 | |||
| 192 | #define PHASE1_LOOP_COUNT 8 | 181 | #define PHASE1_LOOP_COUNT 8 |
| 193 | 182 | ||
| 194 | |||
| 195 | static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) | 183 | static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) |
| 196 | { | 184 | { |
| 197 | int i, j; | 185 | int i, j; |
| @@ -213,7 +201,6 @@ static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) · 15 unmodified lines | |||
| 213 | } | 201 | } |
| 214 | } | 202 | } |
| 215 | 203 | ||
| 216 | |||
| 217 | static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, | 204 | static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, |
| 218 | u16 IV16) | 205 | u16 IV16) |
| 219 | { | 206 | { |
| @@ -263,7 +250,6 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, · 43 unmodified lines | |||
| 263 | #endif | 250 | #endif |
| 264 | } | 251 | } |
| 265 | 252 | ||
| 266 | |||
| 267 | static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | 253 | static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) |
| 268 | { | 254 | { |
| 269 | struct rtllib_tkip_data *tkey = priv; | 255 | struct rtllib_tkip_data *tkey = priv; |
| @@ -285,14 +271,14 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 15 unmodified lines | |||
| 285 | if (!tcb_desc->bHwSec) { | 271 | if (!tcb_desc->bHwSec) { |
| 286 | if (!tkey->tx_phase1_done) { | 272 | if (!tkey->tx_phase1_done) { |
| 287 | tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2, | 273 | tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2, |
| 288 | tkey->tx_iv32); | 274 | tkey->tx_iv32); |
| 289 | tkey->tx_phase1_done = 1; | 275 | tkey->tx_phase1_done = 1; |
| 290 | } | 276 | } |
| 291 | tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, | 277 | tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, |
| 292 | tkey->tx_iv16); | 278 | tkey->tx_iv16); |
| 293 | } else | 279 | } else { |
| 294 | tkey->tx_phase1_done = 1; | 280 | tkey->tx_phase1_done = 1; |
| 295 | 281 | } | |
| 296 | 282 | ||
| 297 | len = skb->len - hdr_len; | 283 | len = skb->len - hdr_len; |
| 298 | pos = skb_push(skb, 8); | 284 | pos = skb_push(skb, 8); |
| @@ -336,8 +322,6 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 37 unmodified lines | |||
| 336 | if (!tcb_desc->bHwSec) | 322 | if (!tcb_desc->bHwSec) |
| 337 | return ret; | 323 | return ret; |
| 338 | return 0; | 324 | return 0; |
| 339 | |||
| 340 | |||
| 341 | } | 325 | } |
| 342 | 326 | ||
| 343 | static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | 327 | static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) |
| @@ -389,8 +373,8 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 45 unmodified lines | |||
| 389 | 373 | ||
| 390 | if (!tcb_desc->bHwSec || (skb->cb[0] == 1)) { | 374 | if (!tcb_desc->bHwSec || (skb->cb[0] == 1)) { |
| 391 | if ((iv32 < tkey->rx_iv32 || | 375 | if ((iv32 < tkey->rx_iv32 || |
| 392 | (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) && | 376 | (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) && |
| 393 | tkey->initialized) { | 377 | tkey->initialized) { |
| 394 | if (net_ratelimit()) { | 378 | if (net_ratelimit()) { |
| 395 | netdev_dbg(skb->dev, | 379 | netdev_dbg(skb->dev, |
| 396 | "Replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n", | 380 | "Replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n", |
| @@ -436,7 +420,6 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 39 unmodified lines | |||
| 436 | tkey->dot11RSNAStatsTKIPICVErrors++; | 420 | tkey->dot11RSNAStatsTKIPICVErrors++; |
| 437 | return -5; | 421 | return -5; |
| 438 | } | 422 | } |
| 439 | |||
| 440 | } | 423 | } |
| 441 | 424 | ||
| 442 | /* Update real counters only after Michael MIC verification has | 425 | /* Update real counters only after Michael MIC verification has |
| @@ -453,7 +436,6 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 10 unmodified lines | |||
| 453 | return keyidx; | 436 | return keyidx; |
| 454 | } | 437 | } |
| 455 | 438 | ||
| 456 | |||
| 457 | static int michael_mic(struct crypto_shash *tfm_michael, u8 *key, u8 *hdr, | 439 | static int michael_mic(struct crypto_shash *tfm_michael, u8 *key, u8 *hdr, |
| 458 | u8 *data, size_t data_len, u8 *mic) | 440 | u8 *data, size_t data_len, u8 *mic) |
| 459 | { | 441 | { |
| @@ -506,12 +488,15 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) · 46 unmodified lines | |||
| 506 | break; | 488 | break; |
| 507 | } | 489 | } |
| 508 | 490 | ||
| 509 | hdr[12] = 0; /* priority */ | 491 | /* priority */ |
| 492 | hdr[12] = 0; | ||
| 510 | 493 | ||
| 511 | hdr[13] = hdr[14] = hdr[15] = 0; /* reserved */ | 494 | /* reserved */ |
| 495 | hdr[13] = 0; | ||
| 496 | hdr[14] = 0; | ||
| 497 | hdr[15] = 0; | ||
| 512 | } | 498 | } |
| 513 | 499 | ||
| 514 | |||
| 515 | static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) | 500 | static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) |
| 516 | { | 501 | { |
| 517 | struct rtllib_tkip_data *tkey = priv; | 502 | struct rtllib_tkip_data *tkey = priv; |
| @@ -533,13 +518,12 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) · 15 unmodified lines | |||
| 533 | tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; | 518 | tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; |
| 534 | pos = skb_put(skb, 8); | 519 | pos = skb_put(skb, 8); |
| 535 | if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, | 520 | if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, |
| 536 | skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) | 521 | skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) |
| 537 | return -1; | 522 | return -1; |
| 538 | 523 | ||
| 539 | return 0; | 524 | return 0; |
| 540 | } | 525 | } |
| 541 | 526 | ||
| 542 | |||
| 543 | static void rtllib_michael_mic_failure(struct net_device *dev, | 527 | static void rtllib_michael_mic_failure(struct net_device *dev, |
| 544 | struct rtllib_hdr_4addr *hdr, | 528 | struct rtllib_hdr_4addr *hdr, |
| 545 | int keyidx) | 529 | int keyidx) |
| @@ -609,7 +593,6 @@ static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx, · 63 unmodified lines | |||
| 609 | return 0; | 593 | return 0; |
| 610 | } | 594 | } |
| 611 | 595 | ||
| 612 | |||
| 613 | static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv) | 596 | static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv) |
| 614 | { | 597 | { |
| 615 | struct rtllib_tkip_data *tkey = priv; | 598 | struct rtllib_tkip_data *tkey = priv; |
| @@ -632,15 +615,15 @@ static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv) · 16 unmodified lines | |||
| 632 | (seq[3] << 8) | seq[2]; | 615 | (seq[3] << 8) | seq[2]; |
| 633 | tkey->rx_iv16 = (seq[1] << 8) | seq[0]; | 616 | tkey->rx_iv16 = (seq[1] << 8) | seq[0]; |
| 634 | } | 617 | } |
| 635 | } else if (len == 0) | 618 | } else if (len == 0) { |
| 636 | tkey->key_set = 0; | 619 | tkey->key_set = 0; |
| 637 | else | 620 | } else { |
| 638 | return -1; | 621 | return -1; |
| 622 | } | ||
| 639 | 623 | ||
| 640 | return 0; | 624 | return 0; |
| 641 | } | 625 | } |
| 642 | 626 | ||
| 643 | |||
| 644 | static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv) | 627 | static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv) |
| 645 | { | 628 | { |
| 646 | struct rtllib_tkip_data *tkey = priv; | 629 | struct rtllib_tkip_data *tkey = priv; |
| @@ -671,7 +654,6 @@ static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv) · 24 unmodified lines | |||
| 671 | return TKIP_KEY_LEN; | 654 | return TKIP_KEY_LEN; |
| 672 | } | 655 | } |
| 673 | 656 | ||
| 674 | |||
| 675 | static void rtllib_tkip_print_stats(struct seq_file *m, void *priv) | 657 | static void rtllib_tkip_print_stats(struct seq_file *m, void *priv) |
| 676 | { | 658 | { |
| 677 | struct rtllib_tkip_data *tkip = priv; | 659 | struct rtllib_tkip_data *tkip = priv; |
| @@ -713,13 +695,11 @@ static struct lib80211_crypto_ops rtllib_crypt_tkip = { · 35 unmodified lines | |||
| 713 | .owner = THIS_MODULE, | 695 | .owner = THIS_MODULE, |
| 714 | }; | 696 | }; |
| 715 | 697 | ||
| 716 | |||
| 717 | static int __init rtllib_crypto_tkip_init(void) | 698 | static int __init rtllib_crypto_tkip_init(void) |
| 718 | { | 699 | { |
| 719 | return lib80211_register_crypto_ops(&rtllib_crypt_tkip); | 700 | return lib80211_register_crypto_ops(&rtllib_crypt_tkip); |
| 720 | } | 701 | } |
| 721 | 702 | ||
| 722 | |||
| 723 | static void __exit rtllib_crypto_tkip_exit(void) | 703 | static void __exit rtllib_crypto_tkip_exit(void) |
| 724 | { | 704 | { |
| 725 | lib80211_unregister_crypto_ops(&rtllib_crypt_tkip); | 705 | lib80211_unregister_crypto_ops(&rtllib_crypt_tkip); |
| @@ -27,7 +27,6 @@ struct prism2_wep_data { · 26 unmodified lines | |||
| 27 | struct arc4_ctx tx_ctx_arc4; | 27 | struct arc4_ctx tx_ctx_arc4; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | |||
| 31 | static void *prism2_wep_init(int keyidx) | 30 | static void *prism2_wep_init(int keyidx) |
| 32 | { | 31 | { |
| 33 | struct prism2_wep_data *priv; | 32 | struct prism2_wep_data *priv; |
| @@ -46,7 +45,6 @@ static void *prism2_wep_init(int keyidx) · 12 unmodified lines | |||
| 46 | return priv; | 45 | return priv; |
| 47 | } | 46 | } |
| 48 | 47 | ||
| 49 | |||
| 50 | static void prism2_wep_deinit(void *priv) | 48 | static void prism2_wep_deinit(void *priv) |
| 51 | { | 49 | { |
| 52 | kfree_sensitive(priv); | 50 | kfree_sensitive(priv); |
| @@ -120,7 +118,6 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 67 unmodified lines | |||
| 120 | return 0; | 118 | return 0; |
| 121 | } | 119 | } |
| 122 | 120 | ||
| 123 | |||
| 124 | /* Perform WEP decryption on given struct buffer. Buffer includes whole WEP | 121 | /* Perform WEP decryption on given struct buffer. Buffer includes whole WEP |
| 125 | * part of the frame: IV (4 bytes), encrypted payload (including SNAP header), | 122 | * part of the frame: IV (4 bytes), encrypted payload (including SNAP header), |
| 126 | * ICV (4 bytes). len includes both IV and ICV. | 123 | * ICV (4 bytes). len includes both IV and ICV. |
| @@ -180,7 +177,6 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 53 unmodified lines | |||
| 180 | return 0; | 177 | return 0; |
| 181 | } | 178 | } |
| 182 | 179 | ||
| 183 | |||
| 184 | static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) | 180 | static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) |
| 185 | { | 181 | { |
| 186 | struct prism2_wep_data *wep = priv; | 182 | struct prism2_wep_data *wep = priv; |
| @@ -194,7 +190,6 @@ static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) · 7 unmodified lines | |||
| 194 | return 0; | 190 | return 0; |
| 195 | } | 191 | } |
| 196 | 192 | ||
| 197 | |||
| 198 | static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) | 193 | static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) |
| 199 | { | 194 | { |
| 200 | struct prism2_wep_data *wep = priv; | 195 | struct prism2_wep_data *wep = priv; |
| @@ -207,7 +202,6 @@ static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) · 6 unmodified lines | |||
| 207 | return wep->key_len; | 202 | return wep->key_len; |
| 208 | } | 203 | } |
| 209 | 204 | ||
| 210 | |||
| 211 | static void prism2_wep_print_stats(struct seq_file *m, void *priv) | 205 | static void prism2_wep_print_stats(struct seq_file *m, void *priv) |
| 212 | { | 206 | { |
| 213 | struct prism2_wep_data *wep = priv; | 207 | struct prism2_wep_data *wep = priv; |
| @@ -231,13 +225,11 @@ static struct lib80211_crypto_ops rtllib_crypt_wep = { · 17 unmodified lines | |||
| 231 | .owner = THIS_MODULE, | 225 | .owner = THIS_MODULE, |
| 232 | }; | 226 | }; |
| 233 | 227 | ||
| 234 | |||
| 235 | static int __init rtllib_crypto_wep_init(void) | 228 | static int __init rtllib_crypto_wep_init(void) |
| 236 | { | 229 | { |
| 237 | return lib80211_register_crypto_ops(&rtllib_crypt_wep); | 230 | return lib80211_register_crypto_ops(&rtllib_crypt_wep); |
| 238 | } | 231 | } |
| 239 | 232 | ||
| 240 | |||
| 241 | static void __exit rtllib_crypto_wep_exit(void) | 233 | static void __exit rtllib_crypto_wep_exit(void) |
| 242 | { | 234 | { |
| 243 | lib80211_unregister_crypto_ops(&rtllib_crypt_wep); | 235 | lib80211_unregister_crypto_ops(&rtllib_crypt_wep); |
| @@ -107,7 +107,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) · 106 unmodified lines | |||
| 107 | spin_lock_init(&ieee->lock); | 107 | spin_lock_init(&ieee->lock); |
| 108 | spin_lock_init(&ieee->wpax_suitlist_lock); | 108 | spin_lock_init(&ieee->wpax_suitlist_lock); |
| 109 | spin_lock_init(&ieee->reorder_spinlock); | 109 | spin_lock_init(&ieee->reorder_spinlock); |
| 110 | atomic_set(&(ieee->atm_swbw), 0); | 110 | atomic_set(&ieee->atm_swbw, 0); |
| 111 | 111 | ||
| 112 | /* SAM FIXME */ | 112 | /* SAM FIXME */ |
| 113 | lib80211_crypt_info_init(&ieee->crypt_info, "RTLLIB", &ieee->lock); | 113 | lib80211_crypt_info_init(&ieee->crypt_info, "RTLLIB", &ieee->lock); |
| @@ -125,8 +125,8 @@ struct net_device *alloc_rtllib(int sizeof_priv) · 11 unmodified lines | |||
| 125 | if (err) | 125 | if (err) |
| 126 | goto free_crypt_info; | 126 | goto free_crypt_info; |
| 127 | 127 | ||
| 128 | ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL); | 128 | ieee->ht_info = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL); |
| 129 | if (!ieee->pHTInfo) | 129 | if (!ieee->ht_info) |
| 130 | goto free_softmac; | 130 | goto free_softmac; |
| 131 | 131 | ||
| 132 | HTUpdateDefaultSetting(ieee); | 132 | HTUpdateDefaultSetting(ieee); |
| @@ -160,7 +160,7 @@ void free_rtllib(struct net_device *dev) · 27 unmodified lines | |||
| 160 | struct rtllib_device *ieee = (struct rtllib_device *) | 160 | struct rtllib_device *ieee = (struct rtllib_device *) |
| 161 | netdev_priv_rsl(dev); | 161 | netdev_priv_rsl(dev); |
| 162 | 162 | ||
| 163 | kfree(ieee->pHTInfo); | 163 | kfree(ieee->ht_info); |
| 164 | rtllib_softmac_free(ieee); | 164 | rtllib_softmac_free(ieee); |
| 165 | 165 | ||
| 166 | lib80211_crypt_info_free(&ieee->crypt_info); | 166 | lib80211_crypt_info_free(&ieee->crypt_info); |
| @@ -567,9 +567,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 566 unmodified lines | |||
| 567 | struct rtllib_rxb *prxb, | 567 | struct rtllib_rxb *prxb, |
| 568 | struct rx_ts_record *pTS, u16 SeqNum) | 568 | struct rx_ts_record *pTS, u16 SeqNum) |
| 569 | { | 569 | { |
| 570 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 570 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 571 | struct rx_reorder_entry *pReorderEntry = NULL; | 571 | struct rx_reorder_entry *pReorderEntry = NULL; |
| 572 | u8 WinSize = pHTInfo->rx_reorder_win_size; | 572 | u8 WinSize = ht_info->rx_reorder_win_size; |
| 573 | u16 WinEnd = 0; | 573 | u16 WinEnd = 0; |
| 574 | u8 index = 0; | 574 | u8 index = 0; |
| 575 | bool bMatchWinStart = false, bPktInBuf = false; | 575 | bool bMatchWinStart = false, bPktInBuf = false; |
| @@ -591,7 +591,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 15 unmodified lines | |||
| 591 | netdev_dbg(ieee->dev, | 591 | netdev_dbg(ieee->dev, |
| 592 | "Packet Drop! IndicateSeq: %d, NewSeq: %d\n", | 592 | "Packet Drop! IndicateSeq: %d, NewSeq: %d\n", |
| 593 | pTS->rx_indicate_seq, SeqNum); | 593 | pTS->rx_indicate_seq, SeqNum); |
| 594 | pHTInfo->rx_reorder_drop_counter++; | 594 | ht_info->rx_reorder_drop_counter++; |
| 595 | { | 595 | { |
| 596 | int i; | 596 | int i; |
| 597 | 597 | ||
| @@ -755,7 +755,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 157 unmodified lines | |||
| 755 | netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__); | 755 | netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__); |
| 756 | pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq; | 756 | pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq; |
| 757 | mod_timer(&pTS->rx_pkt_pending_timer, jiffies + | 757 | mod_timer(&pTS->rx_pkt_pending_timer, jiffies + |
| 758 | msecs_to_jiffies(pHTInfo->rx_reorder_pending_time)); | 758 | msecs_to_jiffies(ht_info->rx_reorder_pending_time)); |
| 759 | } | 759 | } |
| 760 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); | 760 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); |
| 761 | } | 761 | } |
| @@ -924,7 +924,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, · 162 unmodified lines | |||
| 924 | sc = le16_to_cpu(hdr->seq_ctl); | 924 | sc = le16_to_cpu(hdr->seq_ctl); |
| 925 | frag = WLAN_GET_SEQ_FRAG(sc); | 925 | frag = WLAN_GET_SEQ_FRAG(sc); |
| 926 | 926 | ||
| 927 | if (!ieee->pHTInfo->cur_rx_reorder_enable || | 927 | if (!ieee->ht_info->cur_rx_reorder_enable || |
| 928 | !ieee->current_network.qos_data.active || | 928 | !ieee->current_network.qos_data.active || |
| 929 | !IsDataFrame(skb->data) || | 929 | !IsDataFrame(skb->data) || |
| 930 | IsLegacyDataFrame(skb->data)) { | 930 | IsLegacyDataFrame(skb->data)) { |
| @@ -999,8 +999,8 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, · 68 unmodified lines | |||
| 999 | } | 999 | } |
| 1000 | 1000 | ||
| 1001 | /* Filter packets sent by an STA that will be forwarded by AP */ | 1001 | /* Filter packets sent by an STA that will be forwarded by AP */ |
| 1002 | if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn && | 1002 | if (ieee->intel_promiscuous_md_info.promiscuous_on && |
| 1003 | ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame) { | 1003 | ieee->intel_promiscuous_md_info.fltr_src_sta_frame) { |
| 1004 | if ((fc & RTLLIB_FCTL_TODS) && !(fc & RTLLIB_FCTL_FROMDS) && | 1004 | if ((fc & RTLLIB_FCTL_TODS) && !(fc & RTLLIB_FCTL_FROMDS) && |
| 1005 | !ether_addr_equal(dst, ieee->current_network.bssid) && | 1005 | !ether_addr_equal(dst, ieee->current_network.bssid) && |
| 1006 | ether_addr_equal(bssid, ieee->current_network.bssid)) { | 1006 | ether_addr_equal(bssid, ieee->current_network.bssid)) { |
| @@ -1011,7 +1011,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, · 4 unmodified lines | |||
| 1011 | /* Nullfunc frames may have PS-bit set, so they must be passed to | 1011 | /* Nullfunc frames may have PS-bit set, so they must be passed to |
| 1012 | * hostap_handle_sta_rx() before being dropped here. | 1012 | * hostap_handle_sta_rx() before being dropped here. |
| 1013 | */ | 1013 | */ |
| 1014 | if (!ieee->IntelPromiscuousModeInfo.bPromiscuousOn) { | 1014 | if (!ieee->intel_promiscuous_md_info.promiscuous_on) { |
| 1015 | if (stype != RTLLIB_STYPE_DATA && | 1015 | if (stype != RTLLIB_STYPE_DATA && |
| 1016 | stype != RTLLIB_STYPE_DATA_CFACK && | 1016 | stype != RTLLIB_STYPE_DATA_CFACK && |
| 1017 | stype != RTLLIB_STYPE_DATA_CFPOLL && | 1017 | stype != RTLLIB_STYPE_DATA_CFPOLL && |
| @@ -1211,9 +1211,9 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, · 193 unmodified lines | |||
| 1211 | if (unicast) { | 1211 | if (unicast) { |
| 1212 | 1212 | ||
| 1213 | if (ieee->state == RTLLIB_LINKED) { | 1213 | if (ieee->state == RTLLIB_LINKED) { |
| 1214 | if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod + | 1214 | if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + |
| 1215 | ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) || | 1215 | ieee->link_detect_info.NumTxOkInPeriod) > 8) || |
| 1216 | (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) { | 1216 | (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { |
| 1217 | if (ieee->LeisurePSLeave) | 1217 | if (ieee->LeisurePSLeave) |
| 1218 | ieee->LeisurePSLeave(ieee->dev); | 1218 | ieee->LeisurePSLeave(ieee->dev); |
| 1219 | } | 1219 | } |
| @@ -1317,7 +1317,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 97 unmodified lines | |||
| 1317 | multicast = is_multicast_ether_addr(hdr->addr1); | 1317 | multicast = is_multicast_ether_addr(hdr->addr1); |
| 1318 | unicast = !multicast; | 1318 | unicast = !multicast; |
| 1319 | if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1)) { | 1319 | if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1)) { |
| 1320 | if (ieee->bNetPromiscuousMode) | 1320 | if (ieee->net_promiscuous_md) |
| 1321 | bToOtherSTA = true; | 1321 | bToOtherSTA = true; |
| 1322 | else | 1322 | else |
| 1323 | goto rx_dropped; | 1323 | goto rx_dropped; |
| @@ -1355,8 +1355,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 31 unmodified lines | |||
| 1355 | 1355 | ||
| 1356 | /* Update statstics for AP roaming */ | 1356 | /* Update statstics for AP roaming */ |
| 1357 | if (!bToOtherSTA) { | 1357 | if (!bToOtherSTA) { |
| 1358 | ieee->LinkDetectInfo.NumRecvDataInPeriod++; | 1358 | ieee->link_detect_info.NumRecvDataInPeriod++; |
| 1359 | ieee->LinkDetectInfo.NumRxOkInPeriod++; | 1359 | ieee->link_detect_info.NumRxOkInPeriod++; |
| 1360 | } | 1360 | } |
| 1361 | 1361 | ||
| 1362 | /* Data frame - extract src/dst addresses */ | 1362 | /* Data frame - extract src/dst addresses */ |
| @@ -1437,12 +1437,12 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 74 unmodified lines | |||
| 1437 | else | 1437 | else |
| 1438 | nr_subframes = 1; | 1438 | nr_subframes = 1; |
| 1439 | if (unicast) | 1439 | if (unicast) |
| 1440 | ieee->LinkDetectInfo.NumRxUnicastOkInPeriod += nr_subframes; | 1440 | ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes; |
| 1441 | rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes); | 1441 | rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes); |
| 1442 | } | 1442 | } |
| 1443 | 1443 | ||
| 1444 | /* Indicate packets to upper layer or Rx Reorder */ | 1444 | /* Indicate packets to upper layer or Rx Reorder */ |
| 1445 | if (!ieee->pHTInfo->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA) | 1445 | if (!ieee->ht_info->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA) |
| 1446 | rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); | 1446 | rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); |
| 1447 | else | 1447 | else |
| 1448 | RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum); | 1448 | RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum); |
| @@ -1489,9 +1489,9 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, · 40 unmodified lines | |||
| 1489 | hdrlen += 4; | 1489 | hdrlen += 4; |
| 1490 | } | 1490 | } |
| 1491 | 1491 | ||
| 1492 | rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen); | ||
| 1493 | ieee->stats.rx_packets++; | 1492 | ieee->stats.rx_packets++; |
| 1494 | ieee->stats.rx_bytes += skb->len; | 1493 | ieee->stats.rx_bytes += skb->len; |
| 1494 | rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen); | ||
| 1495 | 1495 | ||
| 1496 | return 1; | 1496 | return 1; |
| 1497 | } | 1497 | } |
| @@ -1776,7 +1776,7 @@ static inline void rtllib_extract_country_ie( · 278 unmodified lines | |||
| 1776 | if (rtllib_act_scanning(ieee, false) && | 1776 | if (rtllib_act_scanning(ieee, false) && |
| 1777 | ieee->FirstIe_InScan) | 1777 | ieee->FirstIe_InScan) |
| 1778 | netdev_info(ieee->dev, | 1778 | netdev_info(ieee->dev, |
| 1779 | "Received beacon ContryIE, SSID: <%s>\n", | 1779 | "Received beacon CountryIE, SSID: <%s>\n", |
| 1780 | network->ssid); | 1780 | network->ssid); |
| 1781 | dot11d_update_country(ieee, addr2, | 1781 | dot11d_update_country(ieee, addr2, |
| 1782 | info_element->len, | 1782 | info_element->len, |
| @@ -2620,7 +2620,7 @@ static inline void rtllib_process_probe_response( · 837 unmodified lines | |||
| 2620 | } | 2620 | } |
| 2621 | if (is_beacon(frame_ctl)) { | 2621 | if (is_beacon(frame_ctl)) { |
| 2622 | if (ieee->state >= RTLLIB_LINKED) | 2622 | if (ieee->state >= RTLLIB_LINKED) |
| 2623 | ieee->LinkDetectInfo.NumRecvBcnInPeriod++; | 2623 | ieee->link_detect_info.NumRecvBcnInPeriod++; |
| 2624 | } | 2624 | } |
| 2625 | } | 2625 | } |
| 2626 | list_for_each_entry(target, &ieee->network_list, list) { | 2626 | list_for_each_entry(target, &ieee->network_list, list) { |
| @@ -148,8 +148,7 @@ static void init_mgmt_queue(struct rtllib_device *ieee) · 147 unmodified lines | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | 150 | ||
| 151 | u8 | 151 | u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) |
| 152 | MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) | ||
| 153 | { | 152 | { |
| 154 | u16 i; | 153 | u16 i; |
| 155 | u8 QueryRate = 0; | 154 | u8 QueryRate = 0; |
| @@ -177,10 +176,10 @@ MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) · 21 unmodified lines | |||
| 177 | 176 | ||
| 178 | static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) | 177 | static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) |
| 179 | { | 178 | { |
| 180 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 179 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 181 | u8 rate; | 180 | u8 rate; |
| 182 | 181 | ||
| 183 | if (pHTInfo->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M) | 182 | if (ht_info->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M) |
| 184 | rate = 0x0c; | 183 | rate = 0x0c; |
| 185 | else | 184 | else |
| 186 | rate = ieee->basic_rate & 0x7f; | 185 | rate = ieee->basic_rate & 0x7f; |
| @@ -188,7 +187,7 @@ static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) · 1 unmodified line | |||
| 188 | if (rate == 0) { | 187 | if (rate == 0) { |
| 189 | if (ieee->mode == IEEE_A || | 188 | if (ieee->mode == IEEE_A || |
| 190 | ieee->mode == IEEE_N_5G || | 189 | ieee->mode == IEEE_N_5G || |
| 191 | (ieee->mode == IEEE_N_24G && !pHTInfo->bCurSuppCCK)) | 190 | (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK)) |
| 192 | rate = 0x0c; | 191 | rate = 0x0c; |
| 193 | else | 192 | else |
| 194 | rate = 0x02; | 193 | rate = 0x02; |
| @@ -221,8 +220,8 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) · 26 unmodified lines | |||
| 221 | 220 | ||
| 222 | tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); | 221 | tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); |
| 223 | tcb_desc->RATRIndex = 7; | 222 | tcb_desc->RATRIndex = 7; |
| 224 | tcb_desc->bTxDisableRateFallBack = 1; | 223 | tcb_desc->tx_dis_rate_fallback = 1; |
| 225 | tcb_desc->bTxUseDriverAssingedRate = 1; | 224 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 226 | if (single) { | 225 | if (single) { |
| 227 | if (ieee->queue_stop) { | 226 | if (ieee->queue_stop) { |
| 228 | enqueue_mgmt(ieee, skb); | 227 | enqueue_mgmt(ieee, skb); |
| @@ -299,8 +298,8 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, · 70 unmodified lines | |||
| 299 | 298 | ||
| 300 | tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); | 299 | tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); |
| 301 | tcb_desc->RATRIndex = 7; | 300 | tcb_desc->RATRIndex = 7; |
| 302 | tcb_desc->bTxDisableRateFallBack = 1; | 301 | tcb_desc->tx_dis_rate_fallback = 1; |
| 303 | tcb_desc->bTxUseDriverAssingedRate = 1; | 302 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 304 | if (single) { | 303 | if (single) { |
| 305 | if (type != RTLLIB_FTYPE_CTL) { | 304 | if (type != RTLLIB_FTYPE_CTL) { |
| 306 | header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); | 305 | header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); |
| @@ -446,7 +445,7 @@ void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, · 139 unmodified lines | |||
| 446 | ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, | 445 | ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, |
| 447 | (u8 *)&bFilterOutNonAssociatedBSSID); | 446 | (u8 *)&bFilterOutNonAssociatedBSSID); |
| 448 | 447 | ||
| 449 | ieee->bNetPromiscuousMode = true; | 448 | ieee->net_promiscuous_md = true; |
| 450 | } | 449 | } |
| 451 | EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); | 450 | EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); |
| 452 | 451 | ||
| @@ -467,7 +466,7 @@ void rtllib_DisableIntelPromiscuousMode(struct net_device *dev, · 14 unmodified lines | |||
| 467 | ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, | 466 | ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, |
| 468 | (u8 *)&bFilterOutNonAssociatedBSSID); | 467 | (u8 *)&bFilterOutNonAssociatedBSSID); |
| 469 | 468 | ||
| 470 | ieee->bNetPromiscuousMode = false; | 469 | ieee->net_promiscuous_md = false; |
| 471 | } | 470 | } |
| 472 | EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); | 471 | EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); |
| 473 | 472 | ||
| @@ -830,7 +829,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 356 unmodified lines | |||
| 830 | u8 tmp_ht_cap_len = 0; | 829 | u8 tmp_ht_cap_len = 0; |
| 831 | u8 *tmp_ht_info_buf = NULL; | 830 | u8 *tmp_ht_info_buf = NULL; |
| 832 | u8 tmp_ht_info_len = 0; | 831 | u8 tmp_ht_info_len = 0; |
| 833 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 832 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 834 | u8 *tmp_generic_ie_buf = NULL; | 833 | u8 *tmp_generic_ie_buf = NULL; |
| 835 | u8 tmp_generic_ie_len = 0; | 834 | u8 tmp_generic_ie_len = 0; |
| 836 | 835 | ||
| @@ -844,7 +843,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 7 unmodified lines | |||
| 844 | 843 | ||
| 845 | if ((ieee->current_network.mode == IEEE_G) || | 844 | if ((ieee->current_network.mode == IEEE_G) || |
| 846 | (ieee->current_network.mode == IEEE_N_24G && | 845 | (ieee->current_network.mode == IEEE_N_24G && |
| 847 | ieee->pHTInfo->bCurSuppCCK)) { | 846 | ieee->ht_info->bCurSuppCCK)) { |
| 848 | erp_len = 3; | 847 | erp_len = 3; |
| 849 | erpinfo_content = 0; | 848 | erpinfo_content = 0; |
| 850 | if (ieee->current_network.buseprotection) | 849 | if (ieee->current_network.buseprotection) |
| @@ -855,20 +854,20 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 4 unmodified lines | |||
| 855 | crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; | 854 | crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; |
| 856 | encrypt = ieee->host_encrypt && crypt && crypt->ops && | 855 | encrypt = ieee->host_encrypt && crypt && crypt->ops && |
| 857 | ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); | 856 | ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); |
| 858 | if (ieee->pHTInfo->bCurrentHTSupport) { | 857 | if (ieee->ht_info->bCurrentHTSupport) { |
| 859 | tmp_ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap); | 858 | tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); |
| 860 | tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); | 859 | tmp_ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); |
| 861 | tmp_ht_info_buf = (u8 *)&(ieee->pHTInfo->SelfHTInfo); | 860 | tmp_ht_info_buf = (u8 *)&(ieee->ht_info->SelfHTInfo); |
| 862 | tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo); | 861 | tmp_ht_info_len = sizeof(ieee->ht_info->SelfHTInfo); |
| 863 | HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, | 862 | HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, |
| 864 | &tmp_ht_cap_len, encrypt, false); | 863 | &tmp_ht_cap_len, encrypt, false); |
| 865 | HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, | 864 | HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, |
| 866 | encrypt); | 865 | encrypt); |
| 867 | 866 | ||
| 868 | if (pHTInfo->reg_rt2rt_aggregation) { | 867 | if (ht_info->reg_rt2rt_aggregation) { |
| 869 | tmp_generic_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf; | 868 | tmp_generic_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; |
| 870 | tmp_generic_ie_len = | 869 | tmp_generic_ie_len = |
| 871 | sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf); | 870 | sizeof(ieee->ht_info->sz_rt2rt_agg_buf); |
| 872 | HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, | 871 | HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, |
| 873 | &tmp_generic_ie_len); | 872 | &tmp_generic_ie_len); |
| 874 | } | 873 | } |
| @@ -1180,19 +1179,19 @@ rtllib_association_req(struct rtllib_network *beacon, · 305 unmodified lines | |||
| 1180 | if ((ieee->rtllib_ap_sec_type && | 1179 | if ((ieee->rtllib_ap_sec_type && |
| 1181 | (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) || | 1180 | (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) || |
| 1182 | ieee->bForcedBgMode) { | 1181 | ieee->bForcedBgMode) { |
| 1183 | ieee->pHTInfo->bEnableHT = 0; | 1182 | ieee->ht_info->enable_ht = 0; |
| 1184 | ieee->mode = WIRELESS_MODE_G; | 1183 | ieee->mode = WIRELESS_MODE_G; |
| 1185 | } | 1184 | } |
| 1186 | 1185 | ||
| 1187 | if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { | 1186 | if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { |
| 1188 | ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap); | 1187 | ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); |
| 1189 | ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); | 1188 | ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); |
| 1190 | HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, | 1189 | HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, |
| 1191 | encrypt, true); | 1190 | encrypt, true); |
| 1192 | if (ieee->pHTInfo->current_rt2rt_aggregation) { | 1191 | if (ieee->ht_info->current_rt2rt_aggregation) { |
| 1193 | realtek_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf; | 1192 | realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; |
| 1194 | realtek_ie_len = | 1193 | realtek_ie_len = |
| 1195 | sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf); | 1194 | sizeof(ieee->ht_info->sz_rt2rt_agg_buf); |
| 1196 | HTConstructRT2RTAggElement(ieee, realtek_ie_buf, | 1195 | HTConstructRT2RTAggElement(ieee, realtek_ie_buf, |
| 1197 | &realtek_ie_len); | 1196 | &realtek_ie_len); |
| 1198 | } | 1197 | } |
| @@ -1325,8 +1324,8 @@ rtllib_association_req(struct rtllib_network *beacon, · 126 unmodified lines | |||
| 1325 | memcpy(tag, osCcxVerNum.Octet, osCcxVerNum.Length); | 1324 | memcpy(tag, osCcxVerNum.Octet, osCcxVerNum.Length); |
| 1326 | tag += osCcxVerNum.Length; | 1325 | tag += osCcxVerNum.Length; |
| 1327 | } | 1326 | } |
| 1328 | if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { | 1327 | if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { |
| 1329 | if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) { | 1328 | if (ieee->ht_info->ePeerHTSpecVer != HT_SPEC_VER_EWC) { |
| 1330 | tag = skb_put(skb, ht_cap_len); | 1329 | tag = skb_put(skb, ht_cap_len); |
| 1331 | *tag++ = MFIE_TYPE_HT_CAP; | 1330 | *tag++ = MFIE_TYPE_HT_CAP; |
| 1332 | *tag++ = ht_cap_len - 2; | 1331 | *tag++ = ht_cap_len - 2; |
| @@ -1359,8 +1358,8 @@ rtllib_association_req(struct rtllib_network *beacon, · 26 unmodified lines | |||
| 1359 | rtllib_TURBO_Info(ieee, &tag); | 1358 | rtllib_TURBO_Info(ieee, &tag); |
| 1360 | } | 1359 | } |
| 1361 | 1360 | ||
| 1362 | if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { | 1361 | if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { |
| 1363 | if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) { | 1362 | if (ieee->ht_info->ePeerHTSpecVer == HT_SPEC_VER_EWC) { |
| 1364 | tag = skb_put(skb, ht_cap_len); | 1363 | tag = skb_put(skb, ht_cap_len); |
| 1365 | *tag++ = MFIE_TYPE_GENERIC; | 1364 | *tag++ = MFIE_TYPE_GENERIC; |
| 1366 | *tag++ = ht_cap_len - 2; | 1365 | *tag++ = ht_cap_len - 2; |
| @@ -1368,7 +1367,7 @@ rtllib_association_req(struct rtllib_network *beacon, · 1 unmodified line | |||
| 1368 | tag += ht_cap_len - 2; | 1367 | tag += ht_cap_len - 2; |
| 1369 | } | 1368 | } |
| 1370 | 1369 | ||
| 1371 | if (ieee->pHTInfo->current_rt2rt_aggregation) { | 1370 | if (ieee->ht_info->current_rt2rt_aggregation) { |
| 1372 | tag = skb_put(skb, realtek_ie_len); | 1371 | tag = skb_put(skb, realtek_ie_len); |
| 1373 | *tag++ = MFIE_TYPE_GENERIC; | 1372 | *tag++ = MFIE_TYPE_GENERIC; |
| 1374 | *tag++ = realtek_ie_len - 2; | 1373 | *tag++ = realtek_ie_len - 2; |
| @@ -1505,7 +1504,7 @@ static void rtllib_associate_complete_wq(void *data) · 130 unmodified lines | |||
| 1505 | container_of_work_rsl(data, | 1504 | container_of_work_rsl(data, |
| 1506 | struct rtllib_device, | 1505 | struct rtllib_device, |
| 1507 | associate_complete_wq); | 1506 | associate_complete_wq); |
| 1508 | struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); | 1507 | struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl; |
| 1509 | 1508 | ||
| 1510 | netdev_info(ieee->dev, "Associated successfully with %pM\n", | 1509 | netdev_info(ieee->dev, "Associated successfully with %pM\n", |
| 1511 | ieee->current_network.bssid); | 1510 | ieee->current_network.bssid); |
| @@ -1525,25 +1524,25 @@ static void rtllib_associate_complete_wq(void *data) · 13 unmodified lines | |||
| 1525 | ieee->SetWirelessMode(ieee->dev, IEEE_B); | 1524 | ieee->SetWirelessMode(ieee->dev, IEEE_B); |
| 1526 | netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); | 1525 | netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); |
| 1527 | } | 1526 | } |
| 1528 | if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { | 1527 | if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { |
| 1529 | netdev_info(ieee->dev, "Successfully associated, ht enabled\n"); | 1528 | netdev_info(ieee->dev, "Successfully associated, ht enabled\n"); |
| 1530 | HTOnAssocRsp(ieee); | 1529 | HTOnAssocRsp(ieee); |
| 1531 | } else { | 1530 | } else { |
| 1532 | netdev_info(ieee->dev, | 1531 | netdev_info(ieee->dev, |
| 1533 | "Successfully associated, ht not enabled(%d, %d)\n", | 1532 | "Successfully associated, ht not enabled(%d, %d)\n", |
| 1534 | ieee->pHTInfo->bCurrentHTSupport, | 1533 | ieee->ht_info->bCurrentHTSupport, |
| 1535 | ieee->pHTInfo->bEnableHT); | 1534 | ieee->ht_info->enable_ht); |
| 1536 | memset(ieee->dot11HTOperationalRateSet, 0, 16); | 1535 | memset(ieee->dot11ht_oper_rate_set, 0, 16); |
| 1537 | } | 1536 | } |
| 1538 | ieee->LinkDetectInfo.SlotNum = 2 * (1 + | 1537 | ieee->link_detect_info.SlotNum = 2 * (1 + |
| 1539 | ieee->current_network.beacon_interval / | 1538 | ieee->current_network.beacon_interval / |
| 1540 | 500); | 1539 | 500); |
| 1541 | if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || | 1540 | if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 || |
| 1542 | ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) { | 1541 | ieee->link_detect_info.NumRecvDataInPeriod == 0) { |
| 1543 | ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; | 1542 | ieee->link_detect_info.NumRecvBcnInPeriod = 1; |
| 1544 | ieee->LinkDetectInfo.NumRecvDataInPeriod = 1; | 1543 | ieee->link_detect_info.NumRecvDataInPeriod = 1; |
| 1545 | } | 1544 | } |
| 1546 | pPSC->LpsIdleCount = 0; | 1545 | psc->LpsIdleCount = 0; |
| 1547 | ieee->link_change(ieee->dev); | 1546 | ieee->link_change(ieee->dev); |
| 1548 | 1547 | ||
| 1549 | if (ieee->is_silent_reset) { | 1548 | if (ieee->is_silent_reset) { |
| @@ -1685,7 +1684,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 135 unmodified lines | |||
| 1685 | ieee->current_network.ssid, | 1684 | ieee->current_network.ssid, |
| 1686 | ieee->current_network.channel, | 1685 | ieee->current_network.channel, |
| 1687 | ieee->current_network.qos_data.supported, | 1686 | ieee->current_network.qos_data.supported, |
| 1688 | ieee->pHTInfo->bEnableHT, | 1687 | ieee->ht_info->enable_ht, |
| 1689 | ieee->current_network.bssht.bd_support_ht, | 1688 | ieee->current_network.bssht.bd_support_ht, |
| 1690 | ieee->current_network.mode, | 1689 | ieee->current_network.mode, |
| 1691 | ieee->current_network.flags); | 1690 | ieee->current_network.flags); |
| @@ -1694,7 +1693,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 2 unmodified lines | |||
| 1694 | !(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) | 1693 | !(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) |
| 1695 | rtllib_stop_scan_syncro(ieee); | 1694 | rtllib_stop_scan_syncro(ieee); |
| 1696 | 1695 | ||
| 1697 | HTResetIOTSetting(ieee->pHTInfo); | 1696 | HTResetIOTSetting(ieee->ht_info); |
| 1698 | ieee->wmm_acm = 0; | 1697 | ieee->wmm_acm = 0; |
| 1699 | if (ieee->iw_mode == IW_MODE_INFRA) { | 1698 | if (ieee->iw_mode == IW_MODE_INFRA) { |
| 1700 | /* Join the network for the first time */ | 1699 | /* Join the network for the first time */ |
| @@ -1704,7 +1703,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 3 unmodified lines | |||
| 1704 | HTResetSelfAndSavePeerSetting(ieee, | 1703 | HTResetSelfAndSavePeerSetting(ieee, |
| 1705 | &(ieee->current_network)); | 1704 | &(ieee->current_network)); |
| 1706 | else | 1705 | else |
| 1707 | ieee->pHTInfo->bCurrentHTSupport = | 1706 | ieee->ht_info->bCurrentHTSupport = |
| 1708 | false; | 1707 | false; |
| 1709 | 1708 | ||
| 1710 | ieee->state = RTLLIB_ASSOCIATING; | 1709 | ieee->state = RTLLIB_ASSOCIATING; |
| @@ -1729,7 +1728,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 18 unmodified lines | |||
| 1729 | netdev_info(ieee->dev, | 1728 | netdev_info(ieee->dev, |
| 1730 | "Using B rates\n"); | 1729 | "Using B rates\n"); |
| 1731 | } | 1730 | } |
| 1732 | memset(ieee->dot11HTOperationalRateSet, 0, 16); | 1731 | memset(ieee->dot11ht_oper_rate_set, 0, 16); |
| 1733 | ieee->state = RTLLIB_LINKED; | 1732 | ieee->state = RTLLIB_LINKED; |
| 1734 | } | 1733 | } |
| 1735 | } | 1734 | } |
| @@ -1894,7 +1893,7 @@ static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb, · 158 unmodified lines | |||
| 1894 | ((ieee->mode == IEEE_G) && | 1893 | ((ieee->mode == IEEE_G) && |
| 1895 | (ieee->current_network.mode == IEEE_N_24G) && | 1894 | (ieee->current_network.mode == IEEE_N_24G) && |
| 1896 | (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { | 1895 | (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { |
| 1897 | ieee->pHTInfo->iot_action |= HT_IOT_ACT_PURE_N_MODE; | 1896 | ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE; |
| 1898 | } else { | 1897 | } else { |
| 1899 | ieee->AsocRetryCount = 0; | 1898 | ieee->AsocRetryCount = 0; |
| 1900 | } | 1899 | } |
| @@ -1961,7 +1960,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 60 unmodified lines | |||
| 1961 | { | 1960 | { |
| 1962 | int timeout; | 1961 | int timeout; |
| 1963 | u8 dtim; | 1962 | u8 dtim; |
| 1964 | struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); | 1963 | struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl; |
| 1965 | 1964 | ||
| 1966 | if (ieee->LPSDelayCnt) { | 1965 | if (ieee->LPSDelayCnt) { |
| 1967 | ieee->LPSDelayCnt--; | 1966 | ieee->LPSDelayCnt--; |
| @@ -1991,21 +1990,21 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 23 unmodified lines | |||
| 1991 | 1990 | ||
| 1992 | if (time) { | 1991 | if (time) { |
| 1993 | if (ieee->bAwakePktSent) { | 1992 | if (ieee->bAwakePktSent) { |
| 1994 | pPSC->LPSAwakeIntvl = 1; | 1993 | psc->LPSAwakeIntvl = 1; |
| 1995 | } else { | 1994 | } else { |
| 1996 | u8 MaxPeriod = 1; | 1995 | u8 MaxPeriod = 1; |
| 1997 | 1996 | ||
| 1998 | if (pPSC->LPSAwakeIntvl == 0) | 1997 | if (psc->LPSAwakeIntvl == 0) |
| 1999 | pPSC->LPSAwakeIntvl = 1; | 1998 | psc->LPSAwakeIntvl = 1; |
| 2000 | if (pPSC->RegMaxLPSAwakeIntvl == 0) | 1999 | if (psc->reg_max_lps_awake_intvl == 0) |
| 2001 | MaxPeriod = 1; | 2000 | MaxPeriod = 1; |
| 2002 | else if (pPSC->RegMaxLPSAwakeIntvl == 0xFF) | 2001 | else if (psc->reg_max_lps_awake_intvl == 0xFF) |
| 2003 | MaxPeriod = ieee->current_network.dtim_period; | 2002 | MaxPeriod = ieee->current_network.dtim_period; |
| 2004 | else | 2003 | else |
| 2005 | MaxPeriod = pPSC->RegMaxLPSAwakeIntvl; | 2004 | MaxPeriod = psc->reg_max_lps_awake_intvl; |
| 2006 | pPSC->LPSAwakeIntvl = (pPSC->LPSAwakeIntvl >= | 2005 | psc->LPSAwakeIntvl = (psc->LPSAwakeIntvl >= |
| 2007 | MaxPeriod) ? MaxPeriod : | 2006 | MaxPeriod) ? MaxPeriod : |
| 2008 | (pPSC->LPSAwakeIntvl + 1); | 2007 | (psc->LPSAwakeIntvl + 1); |
| 2009 | } | 2008 | } |
| 2010 | { | 2009 | { |
| 2011 | u8 LPSAwakeIntvl_tmp = 0; | 2010 | u8 LPSAwakeIntvl_tmp = 0; |
| @@ -2013,23 +2012,23 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 1 unmodified line | |||
| 2013 | u8 count = ieee->current_network.tim.tim_count; | 2012 | u8 count = ieee->current_network.tim.tim_count; |
| 2014 | 2013 | ||
| 2015 | if (count == 0) { | 2014 | if (count == 0) { |
| 2016 | if (pPSC->LPSAwakeIntvl > period) | 2015 | if (psc->LPSAwakeIntvl > period) |
| 2017 | LPSAwakeIntvl_tmp = period + | 2016 | LPSAwakeIntvl_tmp = period + |
| 2018 | (pPSC->LPSAwakeIntvl - | 2017 | (psc->LPSAwakeIntvl - |
| 2019 | period) - | 2018 | period) - |
| 2020 | ((pPSC->LPSAwakeIntvl-period) % | 2019 | ((psc->LPSAwakeIntvl-period) % |
| 2021 | period); | 2020 | period); |
| 2022 | else | 2021 | else |
| 2023 | LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl; | 2022 | LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; |
| 2024 | 2023 | ||
| 2025 | } else { | 2024 | } else { |
| 2026 | if (pPSC->LPSAwakeIntvl > | 2025 | if (psc->LPSAwakeIntvl > |
| 2027 | ieee->current_network.tim.tim_count) | 2026 | ieee->current_network.tim.tim_count) |
| 2028 | LPSAwakeIntvl_tmp = count + | 2027 | LPSAwakeIntvl_tmp = count + |
| 2029 | (pPSC->LPSAwakeIntvl - count) - | 2028 | (psc->LPSAwakeIntvl - count) - |
| 2030 | ((pPSC->LPSAwakeIntvl-count)%period); | 2029 | ((psc->LPSAwakeIntvl-count)%period); |
| 2031 | else | 2030 | else |
| 2032 | LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl; | 2031 | LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; |
| 2033 | } | 2032 | } |
| 2034 | 2033 | ||
| 2035 | *time = ieee->current_network.last_dtim_sta_time | 2034 | *time = ieee->current_network.last_dtim_sta_time |
| @@ -2101,7 +2100,7 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) · 65 unmodified lines | |||
| 2101 | { | 2100 | { |
| 2102 | if (ieee->sta_sleep == LPS_IS_WAKE) { | 2101 | if (ieee->sta_sleep == LPS_IS_WAKE) { |
| 2103 | if (nl) { | 2102 | if (nl) { |
| 2104 | if (ieee->pHTInfo->iot_action & | 2103 | if (ieee->ht_info->iot_action & |
| 2105 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) { | 2104 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) { |
| 2106 | ieee->ack_tx_to_ieee = 1; | 2105 | ieee->ack_tx_to_ieee = 1; |
| 2107 | rtllib_sta_ps_send_null_frame(ieee, 0); | 2106 | rtllib_sta_ps_send_null_frame(ieee, 0); |
| @@ -2117,7 +2116,7 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) · 9 unmodified lines | |||
| 2117 | if (ieee->sta_sleep == LPS_IS_SLEEP) | 2116 | if (ieee->sta_sleep == LPS_IS_SLEEP) |
| 2118 | ieee->sta_wake_up(ieee->dev); | 2117 | ieee->sta_wake_up(ieee->dev); |
| 2119 | if (nl) { | 2118 | if (nl) { |
| 2120 | if (ieee->pHTInfo->iot_action & | 2119 | if (ieee->ht_info->iot_action & |
| 2121 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) { | 2120 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) { |
| 2122 | ieee->ack_tx_to_ieee = 1; | 2121 | ieee->ack_tx_to_ieee = 1; |
| 2123 | rtllib_sta_ps_send_null_frame(ieee, 0); | 2122 | rtllib_sta_ps_send_null_frame(ieee, 0); |
| @@ -2152,7 +2151,7 @@ void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success) · 28 unmodified lines | |||
| 2152 | 2151 | ||
| 2153 | if ((ieee->sta_sleep == LPS_IS_WAKE) && !success) { | 2152 | if ((ieee->sta_sleep == LPS_IS_WAKE) && !success) { |
| 2154 | spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); | 2153 | spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); |
| 2155 | if (ieee->pHTInfo->iot_action & | 2154 | if (ieee->ht_info->iot_action & |
| 2156 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) | 2155 | HT_IOT_ACT_NULL_DATA_POWER_SAVING) |
| 2157 | rtllib_sta_ps_send_null_frame(ieee, 0); | 2156 | rtllib_sta_ps_send_null_frame(ieee, 0); |
| 2158 | else | 2157 | else |
| @@ -2236,10 +2235,10 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, · 77 unmodified lines | |||
| 2236 | kfree(network); | 2235 | kfree(network); |
| 2237 | return 1; | 2236 | return 1; |
| 2238 | } | 2237 | } |
| 2239 | memcpy(ieee->pHTInfo->PeerHTCapBuf, | 2238 | memcpy(ieee->ht_info->PeerHTCapBuf, |
| 2240 | network->bssht.bd_ht_cap_buf, | 2239 | network->bssht.bd_ht_cap_buf, |
| 2241 | network->bssht.bd_ht_cap_len); | 2240 | network->bssht.bd_ht_cap_len); |
| 2242 | memcpy(ieee->pHTInfo->PeerHTInfoBuf, | 2241 | memcpy(ieee->ht_info->PeerHTInfoBuf, |
| 2243 | network->bssht.bd_ht_info_buf, | 2242 | network->bssht.bd_ht_info_buf, |
| 2244 | network->bssht.bd_ht_info_len); | 2243 | network->bssht.bd_ht_info_len); |
| 2245 | if (ieee->handle_assoc_response != NULL) | 2244 | if (ieee->handle_assoc_response != NULL) |
| @@ -2296,7 +2295,7 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) · 50 unmodified lines | |||
| 2296 | if (ieee->open_wep || !challenge) { | 2295 | if (ieee->open_wep || !challenge) { |
| 2297 | ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; | 2296 | ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; |
| 2298 | ieee->softmac_stats.rx_auth_rs_ok++; | 2297 | ieee->softmac_stats.rx_auth_rs_ok++; |
| 2299 | if (!(ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE)) { | 2298 | if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { |
| 2300 | if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { | 2299 | if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { |
| 2301 | if (IsHTHalfNmodeAPs(ieee)) { | 2300 | if (IsHTHalfNmodeAPs(ieee)) { |
| 2302 | bSupportNmode = true; | 2301 | bSupportNmode = true; |
| @@ -2370,7 +2369,7 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) · 67 unmodified lines | |||
| 2370 | ieee->state = RTLLIB_ASSOCIATING; | 2369 | ieee->state = RTLLIB_ASSOCIATING; |
| 2371 | ieee->softmac_stats.reassoc++; | 2370 | ieee->softmac_stats.reassoc++; |
| 2372 | ieee->is_roaming = true; | 2371 | ieee->is_roaming = true; |
| 2373 | ieee->LinkDetectInfo.bBusyTraffic = false; | 2372 | ieee->link_detect_info.bBusyTraffic = false; |
| 2374 | rtllib_disassociate(ieee); | 2373 | rtllib_disassociate(ieee); |
| 2375 | RemovePeerTS(ieee, header->addr2); | 2374 | RemovePeerTS(ieee, header->addr2); |
| 2376 | if (ieee->LedControlHandler != NULL) | 2375 | if (ieee->LedControlHandler != NULL) |
| @@ -2670,7 +2669,7 @@ static void rtllib_start_ibss_wq(void *data) · 293 unmodified lines | |||
| 2670 | if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G)) | 2669 | if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G)) |
| 2671 | HTUseDefaultSetting(ieee); | 2670 | HTUseDefaultSetting(ieee); |
| 2672 | else | 2671 | else |
| 2673 | ieee->pHTInfo->bCurrentHTSupport = false; | 2672 | ieee->ht_info->bCurrentHTSupport = false; |
| 2674 | 2673 | ||
| 2675 | ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, | 2674 | ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, |
| 2676 | (u8 *)(&ieee->state)); | 2675 | (u8 *)(&ieee->state)); |
| @@ -2964,13 +2963,13 @@ int rtllib_softmac_init(struct rtllib_device *ieee) · 287 unmodified lines | |||
| 2964 | if (!ieee->dot11d_info) | 2963 | if (!ieee->dot11d_info) |
| 2965 | return -ENOMEM; | 2964 | return -ENOMEM; |
| 2966 | 2965 | ||
| 2967 | ieee->LinkDetectInfo.SlotIndex = 0; | 2966 | ieee->link_detect_info.SlotIndex = 0; |
| 2968 | ieee->LinkDetectInfo.SlotNum = 2; | 2967 | ieee->link_detect_info.SlotNum = 2; |
| 2969 | ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; | 2968 | ieee->link_detect_info.NumRecvBcnInPeriod = 0; |
| 2970 | ieee->LinkDetectInfo.NumRecvDataInPeriod = 0; | 2969 | ieee->link_detect_info.NumRecvDataInPeriod = 0; |
| 2971 | ieee->LinkDetectInfo.NumTxOkInPeriod = 0; | 2970 | ieee->link_detect_info.NumTxOkInPeriod = 0; |
| 2972 | ieee->LinkDetectInfo.NumRxOkInPeriod = 0; | 2971 | ieee->link_detect_info.NumRxOkInPeriod = 0; |
| 2973 | ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0; | 2972 | ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; |
| 2974 | ieee->bIsAggregateFrame = false; | 2973 | ieee->bIsAggregateFrame = false; |
| 2975 | ieee->assoc_id = 0; | 2974 | ieee->assoc_id = 0; |
| 2976 | ieee->queue_stop = 0; | 2975 | ieee->queue_stop = 0; |
| @@ -2985,13 +2984,13 @@ int rtllib_softmac_init(struct rtllib_device *ieee) · 8 unmodified lines | |||
| 2985 | ieee->ps = RTLLIB_PS_DISABLED; | 2984 | ieee->ps = RTLLIB_PS_DISABLED; |
| 2986 | ieee->sta_sleep = LPS_IS_WAKE; | 2985 | ieee->sta_sleep = LPS_IS_WAKE; |
| 2987 | 2986 | ||
| 2988 | ieee->Regdot11HTOperationalRateSet[0] = 0xff; | 2987 | ieee->reg_dot11ht_oper_rate_set[0] = 0xff; |
| 2989 | ieee->Regdot11HTOperationalRateSet[1] = 0xff; | 2988 | ieee->reg_dot11ht_oper_rate_set[1] = 0xff; |
| 2990 | ieee->Regdot11HTOperationalRateSet[4] = 0x01; | 2989 | ieee->reg_dot11ht_oper_rate_set[4] = 0x01; |
| 2991 | 2990 | ||
| 2992 | ieee->Regdot11TxHTOperationalRateSet[0] = 0xff; | 2991 | ieee->reg_dot11tx_ht_oper_rate_set[0] = 0xff; |
| 2993 | ieee->Regdot11TxHTOperationalRateSet[1] = 0xff; | 2992 | ieee->reg_dot11tx_ht_oper_rate_set[1] = 0xff; |
| 2994 | ieee->Regdot11TxHTOperationalRateSet[4] = 0x01; | 2993 | ieee->reg_dot11tx_ht_oper_rate_set[4] = 0x01; |
| 2995 | 2994 | ||
| 2996 | ieee->FirstIe_InScan = false; | 2995 | ieee->FirstIe_InScan = false; |
| 2997 | ieee->actscanning = false; | 2996 | ieee->actscanning = false; |
| @@ -359,11 +359,11 @@ void rtllib_wx_sync_scan_wq(void *data) · 358 unmodified lines | |||
| 359 | if (ieee->ScanOperationBackupHandler) | 359 | if (ieee->ScanOperationBackupHandler) |
| 360 | ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); | 360 | ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); |
| 361 | 361 | ||
| 362 | if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT && | 362 | if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht && |
| 363 | ieee->pHTInfo->bCurBW40MHz) { | 363 | ieee->ht_info->bCurBW40MHz) { |
| 364 | b40M = 1; | 364 | b40M = 1; |
| 365 | chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset; | 365 | chan_offset = ieee->ht_info->CurSTAExtChnlOffset; |
| 366 | bandwidth = (enum ht_channel_width)ieee->pHTInfo->bCurBW40MHz; | 366 | bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; |
| 367 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, | 367 | ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, |
| 368 | HT_EXTCHNL_OFFSET_NO_EXT); | 368 | HT_EXTCHNL_OFFSET_NO_EXT); |
| 369 | } | 369 | } |
| @@ -391,10 +391,10 @@ void rtllib_wx_sync_scan_wq(void *data) · 21 unmodified lines | |||
| 391 | /* Notify AP that I wake up again */ | 391 | /* Notify AP that I wake up again */ |
| 392 | rtllib_sta_ps_send_null_frame(ieee, 0); | 392 | rtllib_sta_ps_send_null_frame(ieee, 0); |
| 393 | 393 | ||
| 394 | if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || | 394 | if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 || |
| 395 | ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) { | 395 | ieee->link_detect_info.NumRecvDataInPeriod == 0) { |
| 396 | ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; | 396 | ieee->link_detect_info.NumRecvBcnInPeriod = 1; |
| 397 | ieee->LinkDetectInfo.NumRecvDataInPeriod = 1; | 397 | ieee->link_detect_info.NumRecvDataInPeriod = 1; |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | if (ieee->data_hard_resume) | 400 | if (ieee->data_hard_resume) |
| @@ -564,9 +564,8 @@ int rtllib_wx_set_power(struct rtllib_device *ieee, · 163 unmodified lines | |||
| 564 | ieee->ps = RTLLIB_PS_DISABLED; | 564 | ieee->ps = RTLLIB_PS_DISABLED; |
| 565 | goto exit; | 565 | goto exit; |
| 566 | } | 566 | } |
| 567 | if (wrqu->power.flags & IW_POWER_TIMEOUT) { | 567 | if (wrqu->power.flags & IW_POWER_TIMEOUT) |
| 568 | ieee->ps_timeout = wrqu->power.value / 1000; | 568 | ieee->ps_timeout = wrqu->power.value / 1000; |
| 569 | } | ||
| 570 | 569 | ||
| 571 | if (wrqu->power.flags & IW_POWER_PERIOD) | 570 | if (wrqu->power.flags & IW_POWER_PERIOD) |
| 572 | ieee->ps_period = wrqu->power.value / 1000; | 571 | ieee->ps_period = wrqu->power.value / 1000; |
| @@ -191,7 +191,6 @@ int rtllib_encrypt_fragment(struct rtllib_device *ieee, struct sk_buff *frag, · 190 unmodified lines | |||
| 191 | return 0; | 191 | return 0; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | |||
| 195 | void rtllib_txb_free(struct rtllib_txb *txb) | 194 | void rtllib_txb_free(struct rtllib_txb *txb) |
| 196 | { | 195 | { |
| 197 | if (unlikely(!txb)) | 196 | if (unlikely(!txb)) |
| @@ -267,14 +266,14 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 69 unmodified lines | |||
| 267 | struct sk_buff *skb, | 266 | struct sk_buff *skb, |
| 268 | struct cb_desc *tcb_desc) | 267 | struct cb_desc *tcb_desc) |
| 269 | { | 268 | { |
| 270 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 269 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 271 | struct tx_ts_record *pTxTs = NULL; | 270 | struct tx_ts_record *pTxTs = NULL; |
| 272 | struct rtllib_hdr_1addr *hdr = (struct rtllib_hdr_1addr *)skb->data; | 271 | struct rtllib_hdr_1addr *hdr = (struct rtllib_hdr_1addr *)skb->data; |
| 273 | 272 | ||
| 274 | if (rtllib_act_scanning(ieee, false)) | 273 | if (rtllib_act_scanning(ieee, false)) |
| 275 | return; | 274 | return; |
| 276 | 275 | ||
| 277 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) | 276 | if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) |
| 278 | return; | 277 | return; |
| 279 | if (!IsQoSDataFrame(skb->data)) | 278 | if (!IsQoSDataFrame(skb->data)) |
| 280 | return; | 279 | return; |
| @@ -284,14 +283,14 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 3 unmodified lines | |||
| 284 | if (tcb_desc->bdhcp || ieee->CntAfterLink < 2) | 283 | if (tcb_desc->bdhcp || ieee->CntAfterLink < 2) |
| 285 | return; | 284 | return; |
| 286 | 285 | ||
| 287 | if (pHTInfo->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION) | 286 | if (ht_info->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION) |
| 288 | return; | 287 | return; |
| 289 | 288 | ||
| 290 | if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) | 289 | if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) |
| 291 | return; | 290 | return; |
| 292 | if (pHTInfo->bCurrentAMPDUEnable) { | 291 | if (ht_info->bCurrentAMPDUEnable) { |
| 293 | if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, | 292 | if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, |
| 294 | skb->priority, TX_DIR, true)) { | 293 | skb->priority, TX_DIR, true)) { |
| 295 | netdev_info(ieee->dev, "%s: can't get TS\n", __func__); | 294 | netdev_info(ieee->dev, "%s: can't get TS\n", __func__); |
| 296 | return; | 295 | return; |
| 297 | } | 296 | } |
| @@ -307,26 +306,26 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 9 unmodified lines | |||
| 307 | goto FORCED_AGG_SETTING; | 306 | goto FORCED_AGG_SETTING; |
| 308 | } else if (!pTxTs->bUsingBa) { | 307 | } else if (!pTxTs->bUsingBa) { |
| 309 | if (SN_LESS(pTxTs->TxAdmittedBARecord.ba_start_seq_ctrl.field.seq_num, | 308 | if (SN_LESS(pTxTs->TxAdmittedBARecord.ba_start_seq_ctrl.field.seq_num, |
| 310 | (pTxTs->TxCurSeq+1)%4096)) | 309 | (pTxTs->TxCurSeq + 1) % 4096)) |
| 311 | pTxTs->bUsingBa = true; | 310 | pTxTs->bUsingBa = true; |
| 312 | else | 311 | else |
| 313 | goto FORCED_AGG_SETTING; | 312 | goto FORCED_AGG_SETTING; |
| 314 | } | 313 | } |
| 315 | if (ieee->iw_mode == IW_MODE_INFRA) { | 314 | if (ieee->iw_mode == IW_MODE_INFRA) { |
| 316 | tcb_desc->bAMPDUEnable = true; | 315 | tcb_desc->bAMPDUEnable = true; |
| 317 | tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor; | 316 | tcb_desc->ampdu_factor = ht_info->CurrentAMPDUFactor; |
| 318 | tcb_desc->ampdu_density = pHTInfo->current_mpdu_density; | 317 | tcb_desc->ampdu_density = ht_info->current_mpdu_density; |
| 319 | } | 318 | } |
| 320 | } | 319 | } |
| 321 | FORCED_AGG_SETTING: | 320 | FORCED_AGG_SETTING: |
| 322 | switch (pHTInfo->ForcedAMPDUMode) { | 321 | switch (ht_info->ForcedAMPDUMode) { |
| 323 | case HT_AGG_AUTO: | 322 | case HT_AGG_AUTO: |
| 324 | break; | 323 | break; |
| 325 | 324 | ||
| 326 | case HT_AGG_FORCE_ENABLE: | 325 | case HT_AGG_FORCE_ENABLE: |
| 327 | tcb_desc->bAMPDUEnable = true; | 326 | tcb_desc->bAMPDUEnable = true; |
| 328 | tcb_desc->ampdu_density = pHTInfo->forced_mpdu_density; | 327 | tcb_desc->ampdu_density = ht_info->forced_mpdu_density; |
| 329 | tcb_desc->ampdu_factor = pHTInfo->forced_ampdu_factor; | 328 | tcb_desc->ampdu_factor = ht_info->forced_ampdu_factor; |
| 330 | break; | 329 | break; |
| 331 | 330 | ||
| 332 | case HT_AGG_FORCE_DISABLE: | 331 | case HT_AGG_FORCE_DISABLE: |
| @@ -351,32 +350,32 @@ static void rtllib_query_ShortPreambleMode(struct rtllib_device *ieee, · 18 unmodified lines | |||
| 351 | static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee, | 350 | static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee, |
| 352 | struct cb_desc *tcb_desc) | 351 | struct cb_desc *tcb_desc) |
| 353 | { | 352 | { |
| 354 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 353 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 355 | 354 | ||
| 356 | tcb_desc->bUseShortGI = false; | 355 | tcb_desc->bUseShortGI = false; |
| 357 | 356 | ||
| 358 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) | 357 | if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) |
| 359 | return; | 358 | return; |
| 360 | 359 | ||
| 361 | if (pHTInfo->forced_short_gi) { | 360 | if (ht_info->forced_short_gi) { |
| 362 | tcb_desc->bUseShortGI = true; | 361 | tcb_desc->bUseShortGI = true; |
| 363 | return; | 362 | return; |
| 364 | } | 363 | } |
| 365 | 364 | ||
| 366 | if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz) | 365 | if (ht_info->bCurBW40MHz && ht_info->bCurShortGI40MHz) |
| 367 | tcb_desc->bUseShortGI = true; | 366 | tcb_desc->bUseShortGI = true; |
| 368 | else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz) | 367 | else if (!ht_info->bCurBW40MHz && ht_info->bCurShortGI20MHz) |
| 369 | tcb_desc->bUseShortGI = true; | 368 | tcb_desc->bUseShortGI = true; |
| 370 | } | 369 | } |
| 371 | 370 | ||
| 372 | static void rtllib_query_BandwidthMode(struct rtllib_device *ieee, | 371 | static void rtllib_query_BandwidthMode(struct rtllib_device *ieee, |
| 373 | struct cb_desc *tcb_desc) | 372 | struct cb_desc *tcb_desc) |
| 374 | { | 373 | { |
| 375 | struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; | 374 | struct rt_hi_throughput *ht_info = ieee->ht_info; |
| 376 | 375 | ||
| 377 | tcb_desc->bPacketBW = false; | 376 | tcb_desc->bPacketBW = false; |
| 378 | 377 | ||
| 379 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) | 378 | if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) |
| 380 | return; | 379 | return; |
| 381 | 380 | ||
| 382 | if (tcb_desc->bMulticast || tcb_desc->bBroadcast) | 381 | if (tcb_desc->bMulticast || tcb_desc->bBroadcast) |
| @@ -384,7 +383,7 @@ static void rtllib_query_BandwidthMode(struct rtllib_device *ieee, · 1 unmodified line | |||
| 384 | 383 | ||
| 385 | if ((tcb_desc->data_rate & 0x80) == 0) | 384 | if ((tcb_desc->data_rate & 0x80) == 0) |
| 386 | return; | 385 | return; |
| 387 | if (pHTInfo->bCurBW40MHz && pHTInfo->cur_tx_bw40mhz && | 386 | if (ht_info->bCurBW40MHz && ht_info->cur_tx_bw40mhz && |
| 388 | !ieee->bandwidth_auto_switch.bforced_tx20Mhz) | 387 | !ieee->bandwidth_auto_switch.bforced_tx20Mhz) |
| 389 | tcb_desc->bPacketBW = true; | 388 | tcb_desc->bPacketBW = true; |
| 390 | } | 389 | } |
| @@ -393,7 +392,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 2 unmodified lines | |||
| 393 | struct cb_desc *tcb_desc, | 392 | struct cb_desc *tcb_desc, |
| 394 | struct sk_buff *skb) | 393 | struct sk_buff *skb) |
| 395 | { | 394 | { |
| 396 | struct rt_hi_throughput *pHTInfo; | 395 | struct rt_hi_throughput *ht_info; |
| 397 | 396 | ||
| 398 | tcb_desc->bRTSSTBC = false; | 397 | tcb_desc->bRTSSTBC = false; |
| 399 | tcb_desc->bRTSUseShortGI = false; | 398 | tcb_desc->bRTSUseShortGI = false; |
| @@ -404,7 +403,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 4 unmodified lines | |||
| 404 | if (tcb_desc->bBroadcast || tcb_desc->bMulticast) | 403 | if (tcb_desc->bBroadcast || tcb_desc->bMulticast) |
| 405 | return; | 404 | return; |
| 406 | 405 | ||
| 407 | if (is_broadcast_ether_addr(skb->data+16)) | 406 | if (is_broadcast_ether_addr(skb->data + 16)) |
| 408 | return; | 407 | return; |
| 409 | 408 | ||
| 410 | if (ieee->mode < IEEE_N_24G) { | 409 | if (ieee->mode < IEEE_N_24G) { |
| @@ -419,15 +418,15 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 8 unmodified lines | |||
| 419 | return; | 418 | return; |
| 420 | } | 419 | } |
| 421 | 420 | ||
| 422 | pHTInfo = ieee->pHTInfo; | 421 | ht_info = ieee->ht_info; |
| 423 | 422 | ||
| 424 | while (true) { | 423 | while (true) { |
| 425 | if (pHTInfo->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) { | 424 | if (ht_info->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) { |
| 426 | tcb_desc->bCTSEnable = true; | 425 | tcb_desc->bCTSEnable = true; |
| 427 | tcb_desc->rts_rate = MGN_24M; | 426 | tcb_desc->rts_rate = MGN_24M; |
| 428 | tcb_desc->bRTSEnable = true; | 427 | tcb_desc->bRTSEnable = true; |
| 429 | break; | 428 | break; |
| 430 | } else if (pHTInfo->iot_action & (HT_IOT_ACT_FORCED_RTS | | 429 | } else if (ht_info->iot_action & (HT_IOT_ACT_FORCED_RTS | |
| 431 | HT_IOT_ACT_PURE_N_MODE)) { | 430 | HT_IOT_ACT_PURE_N_MODE)) { |
| 432 | tcb_desc->bRTSEnable = true; | 431 | tcb_desc->bRTSEnable = true; |
| 433 | tcb_desc->rts_rate = MGN_24M; | 432 | tcb_desc->rts_rate = MGN_24M; |
| @@ -439,12 +438,12 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 5 unmodified lines | |||
| 439 | tcb_desc->rts_rate = MGN_24M; | 438 | tcb_desc->rts_rate = MGN_24M; |
| 440 | break; | 439 | break; |
| 441 | } | 440 | } |
| 442 | if (pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) { | 441 | if (ht_info->bCurrentHTSupport && ht_info->enable_ht) { |
| 443 | u8 HTOpMode = pHTInfo->current_op_mode; | 442 | u8 HTOpMode = ht_info->current_op_mode; |
| 444 | 443 | ||
| 445 | if ((pHTInfo->bCurBW40MHz && (HTOpMode == 2 || | 444 | if ((ht_info->bCurBW40MHz && (HTOpMode == 2 || |
| 446 | HTOpMode == 3)) || | 445 | HTOpMode == 3)) || |
| 447 | (!pHTInfo->bCurBW40MHz && HTOpMode == 3)) { | 446 | (!ht_info->bCurBW40MHz && HTOpMode == 3)) { |
| 448 | tcb_desc->rts_rate = MGN_24M; | 447 | tcb_desc->rts_rate = MGN_24M; |
| 449 | tcb_desc->bRTSEnable = true; | 448 | tcb_desc->bRTSEnable = true; |
| 450 | break; | 449 | break; |
| @@ -475,17 +474,16 @@ NO_PROTECTION: · 24 unmodified lines | |||
| 475 | tcb_desc->bRTSBW = false; | 474 | tcb_desc->bRTSBW = false; |
| 476 | } | 475 | } |
| 477 | 476 | ||
| 478 | |||
| 479 | static void rtllib_txrate_selectmode(struct rtllib_device *ieee, | 477 | static void rtllib_txrate_selectmode(struct rtllib_device *ieee, |
| 480 | struct cb_desc *tcb_desc) | 478 | struct cb_desc *tcb_desc) |
| 481 | { | 479 | { |
| 482 | if (ieee->bTxDisableRateFallBack) | 480 | if (ieee->tx_dis_rate_fallback) |
| 483 | tcb_desc->bTxDisableRateFallBack = true; | 481 | tcb_desc->tx_dis_rate_fallback = true; |
| 484 | 482 | ||
| 485 | if (ieee->bTxUseDriverAssingedRate) | 483 | if (ieee->tx_use_drv_assinged_rate) |
| 486 | tcb_desc->bTxUseDriverAssingedRate = true; | 484 | tcb_desc->tx_use_drv_assinged_rate = true; |
| 487 | if (!tcb_desc->bTxDisableRateFallBack || | 485 | if (!tcb_desc->tx_dis_rate_fallback || |
| 488 | !tcb_desc->bTxUseDriverAssingedRate) { | 486 | !tcb_desc->tx_use_drv_assinged_rate) { |
| 489 | if (ieee->iw_mode == IW_MODE_INFRA || | 487 | if (ieee->iw_mode == IW_MODE_INFRA || |
| 490 | ieee->iw_mode == IW_MODE_ADHOC) | 488 | ieee->iw_mode == IW_MODE_ADHOC) |
| 491 | tcb_desc->RATRIndex = 0; | 489 | tcb_desc->RATRIndex = 0; |
| @@ -503,10 +501,10 @@ static u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb, · 11 unmodified lines | |||
| 503 | struct tx_ts_record *pTS = NULL; | 501 | struct tx_ts_record *pTS = NULL; |
| 504 | 502 | ||
| 505 | if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, | 503 | if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, |
| 506 | skb->priority, TX_DIR, true)) | 504 | skb->priority, TX_DIR, true)) |
| 507 | return 0; | 505 | return 0; |
| 508 | seqnum = pTS->TxCurSeq; | 506 | seqnum = pTS->TxCurSeq; |
| 509 | pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096; | 507 | pTS->TxCurSeq = (pTS->TxCurSeq + 1) % 4096; |
| 510 | return seqnum; | 508 | return seqnum; |
| 511 | } | 509 | } |
| 512 | return 0; | 510 | return 0; |
| @@ -582,7 +580,6 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 69 unmodified lines | |||
| 582 | goto success; | 580 | goto success; |
| 583 | } | 581 | } |
| 584 | 582 | ||
| 585 | |||
| 586 | if (likely(ieee->raw_tx == 0)) { | 583 | if (likely(ieee->raw_tx == 0)) { |
| 587 | if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { | 584 | if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { |
| 588 | netdev_warn(ieee->dev, "skb too small (%d).\n", | 585 | netdev_warn(ieee->dev, "skb too small (%d).\n", |
| @@ -614,14 +611,14 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 25 unmodified lines | |||
| 614 | if (skb->len > 282) { | 611 | if (skb->len > 282) { |
| 615 | if (ether_type == ETH_P_IP) { | 612 | if (ether_type == ETH_P_IP) { |
| 616 | const struct iphdr *ip = (struct iphdr *) | 613 | const struct iphdr *ip = (struct iphdr *) |
| 617 | ((u8 *)skb->data+14); | 614 | ((u8 *)skb->data + 14); |
| 618 | if (ip->protocol == IPPROTO_UDP) { | 615 | if (ip->protocol == IPPROTO_UDP) { |
| 619 | struct udphdr *udp; | 616 | struct udphdr *udp; |
| 620 | 617 | ||
| 621 | udp = (struct udphdr *)((u8 *)ip + | 618 | udp = (struct udphdr *)((u8 *)ip + |
| 622 | (ip->ihl << 2)); | 619 | (ip->ihl << 2)); |
| 623 | if (((((u8 *)udp)[1] == 68) && | 620 | if (((((u8 *)udp)[1] == 68) && |
| 624 | (((u8 *)udp)[3] == 67)) || | 621 | (((u8 *)udp)[3] == 67)) || |
| 625 | ((((u8 *)udp)[1] == 67) && | 622 | ((((u8 *)udp)[1] == 67) && |
| 626 | (((u8 *)udp)[3] == 68))) { | 623 | (((u8 *)udp)[3] == 68))) { |
| 627 | bdhcp = true; | 624 | bdhcp = true; |
| @@ -715,11 +712,11 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 87 unmodified lines | |||
| 715 | /* in case we are a client verify acm is not set for this ac */ | 712 | /* in case we are a client verify acm is not set for this ac */ |
| 716 | while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) { | 713 | while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) { |
| 717 | netdev_info(ieee->dev, "skb->priority = %x\n", | 714 | netdev_info(ieee->dev, "skb->priority = %x\n", |
| 718 | skb->priority); | 715 | skb->priority); |
| 719 | if (wme_downgrade_ac(skb)) | 716 | if (wme_downgrade_ac(skb)) |
| 720 | break; | 717 | break; |
| 721 | netdev_info(ieee->dev, "converted skb->priority = %x\n", | 718 | netdev_info(ieee->dev, "converted skb->priority = %x\n", |
| 722 | skb->priority); | 719 | skb->priority); |
| 723 | } | 720 | } |
| 724 | 721 | ||
| 725 | qos_ctl |= skb->priority; | 722 | qos_ctl |= skb->priority; |
| @@ -805,8 +802,8 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 79 unmodified lines | |||
| 805 | * MOREFRAGS bit to the frame control | 802 | * MOREFRAGS bit to the frame control |
| 806 | */ | 803 | */ |
| 807 | if (i != nr_frags - 1) { | 804 | if (i != nr_frags - 1) { |
| 808 | frag_hdr->frame_ctl = cpu_to_le16( | 805 | frag_hdr->frame_ctl = cpu_to_le16(fc | |
| 809 | fc | RTLLIB_FCTL_MOREFRAGS); | 806 | RTLLIB_FCTL_MOREFRAGS); |
| 810 | bytes = bytes_per_frag; | 807 | bytes = bytes_per_frag; |
| 811 | 808 | ||
| 812 | } else { | 809 | } else { |
| @@ -816,18 +813,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 3 unmodified lines | |||
| 816 | if ((qos_activated) && (!bIsMulticast)) { | 813 | if ((qos_activated) && (!bIsMulticast)) { |
| 817 | frag_hdr->seq_ctl = | 814 | frag_hdr->seq_ctl = |
| 818 | cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag, | 815 | cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag, |
| 819 | header.addr1)); | 816 | header.addr1)); |
| 820 | frag_hdr->seq_ctl = | 817 | frag_hdr->seq_ctl = |
| 821 | cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl)<<4 | i); | 818 | cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl) << 4 | i); |
| 822 | } else { | 819 | } else { |
| 823 | frag_hdr->seq_ctl = | 820 | frag_hdr->seq_ctl = |
| 824 | cpu_to_le16(ieee->seq_ctrl[0]<<4 | i); | 821 | cpu_to_le16(ieee->seq_ctrl[0] << 4 | i); |
| 825 | } | 822 | } |
| 826 | /* Put a SNAP header on the first fragment */ | 823 | /* Put a SNAP header on the first fragment */ |
| 827 | if (i == 0) { | 824 | if (i == 0) { |
| 828 | rtllib_put_snap( | 825 | rtllib_put_snap(skb_put(skb_frag, |
| 829 | skb_put(skb_frag, SNAP_SIZE + | 826 | SNAP_SIZE + |
| 830 | sizeof(u16)), ether_type); | 827 | sizeof(u16)), ether_type); |
| 831 | bytes -= SNAP_SIZE + sizeof(u16); | 828 | bytes -= SNAP_SIZE + sizeof(u16); |
| 832 | } | 829 | } |
| 833 | 830 | ||
| @@ -885,19 +882,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 51 unmodified lines | |||
| 885 | tcb_desc->priority = skb->priority; | 882 | tcb_desc->priority = skb->priority; |
| 886 | 883 | ||
| 887 | if (ether_type == ETH_P_PAE) { | 884 | if (ether_type == ETH_P_PAE) { |
| 888 | if (ieee->pHTInfo->iot_action & | 885 | if (ieee->ht_info->iot_action & |
| 889 | HT_IOT_ACT_WA_IOT_Broadcom) { | 886 | HT_IOT_ACT_WA_IOT_Broadcom) { |
| 890 | tcb_desc->data_rate = | 887 | tcb_desc->data_rate = |
| 891 | MgntQuery_TxRateExcludeCCKRates(ieee); | 888 | MgntQuery_TxRateExcludeCCKRates(ieee); |
| 892 | tcb_desc->bTxDisableRateFallBack = false; | 889 | tcb_desc->tx_dis_rate_fallback = false; |
| 893 | } else { | 890 | } else { |
| 894 | tcb_desc->data_rate = ieee->basic_rate; | 891 | tcb_desc->data_rate = ieee->basic_rate; |
| 895 | tcb_desc->bTxDisableRateFallBack = 1; | 892 | tcb_desc->tx_dis_rate_fallback = 1; |
| 896 | } | 893 | } |
| 897 | 894 | ||
| 898 | |||
| 899 | tcb_desc->RATRIndex = 7; | 895 | tcb_desc->RATRIndex = 7; |
| 900 | tcb_desc->bTxUseDriverAssingedRate = 1; | 896 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 901 | } else { | 897 | } else { |
| 902 | if (is_multicast_ether_addr(header.addr1)) | 898 | if (is_multicast_ether_addr(header.addr1)) |
| 903 | tcb_desc->bMulticast = 1; | 899 | tcb_desc->bMulticast = 1; |
| @@ -910,19 +906,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 6 unmodified lines | |||
| 910 | tcb_desc->data_rate = rtllib_current_rate(ieee); | 906 | tcb_desc->data_rate = rtllib_current_rate(ieee); |
| 911 | 907 | ||
| 912 | if (bdhcp) { | 908 | if (bdhcp) { |
| 913 | if (ieee->pHTInfo->iot_action & | 909 | if (ieee->ht_info->iot_action & |
| 914 | HT_IOT_ACT_WA_IOT_Broadcom) { | 910 | HT_IOT_ACT_WA_IOT_Broadcom) { |
| 915 | tcb_desc->data_rate = | 911 | tcb_desc->data_rate = |
| 916 | MgntQuery_TxRateExcludeCCKRates(ieee); | 912 | MgntQuery_TxRateExcludeCCKRates(ieee); |
| 917 | tcb_desc->bTxDisableRateFallBack = false; | 913 | tcb_desc->tx_dis_rate_fallback = false; |
| 918 | } else { | 914 | } else { |
| 919 | tcb_desc->data_rate = MGN_1M; | 915 | tcb_desc->data_rate = MGN_1M; |
| 920 | tcb_desc->bTxDisableRateFallBack = 1; | 916 | tcb_desc->tx_dis_rate_fallback = 1; |
| 921 | } | 917 | } |
| 922 | 918 | ||
| 923 | |||
| 924 | tcb_desc->RATRIndex = 7; | 919 | tcb_desc->RATRIndex = 7; |
| 925 | tcb_desc->bTxUseDriverAssingedRate = 1; | 920 | tcb_desc->tx_use_drv_assinged_rate = 1; |
| 926 | tcb_desc->bdhcp = 1; | 921 | tcb_desc->bdhcp = 1; |
| 927 | } | 922 | } |
| 928 | 923 | ||
| @@ -959,7 +954,6 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 30 unmodified lines | |||
| 959 | netif_stop_queue(dev); | 954 | netif_stop_queue(dev); |
| 960 | stats->tx_errors++; | 955 | stats->tx_errors++; |
| 961 | return 1; | 956 | return 1; |
| 962 | |||
| 963 | } | 957 | } |
| 964 | 958 | ||
| 965 | netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev) | 959 | netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev) |
| @@ -217,7 +217,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee, · 216 unmodified lines | |||
| 217 | p = custom; | 217 | p = custom; |
| 218 | p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), | 218 | p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), |
| 219 | " Last beacon: %lums ago", | 219 | " Last beacon: %lums ago", |
| 220 | (jiffies - network->last_scanned) / (HZ / 100)); | 220 | (100 * (jiffies - network->last_scanned)) / HZ); |
| 221 | iwe.u.data.length = p - custom; | 221 | iwe.u.data.length = p - custom; |
| 222 | if (iwe.u.data.length) | 222 | if (iwe.u.data.length) |
| 223 | start = iwe_stream_add_point_rsl(info, start, stop, | 223 | start = iwe_stream_add_point_rsl(info, start, stop, |
| @@ -258,8 +258,8 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee, · 34 unmodified lines | |||
| 258 | escape_essid(network->ssid, | 258 | escape_essid(network->ssid, |
| 259 | network->ssid_len), | 259 | network->ssid_len), |
| 260 | network->bssid, | 260 | network->bssid, |
| 261 | (jiffies - network->last_scanned) / | 261 | (100 * (jiffies - network->last_scanned)) / |
| 262 | (HZ / 100)); | 262 | HZ); |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | spin_unlock_irqrestore(&ieee->lock, flags); | 265 | spin_unlock_irqrestore(&ieee->lock, flags); |
| @@ -0,0 +1,16 @@ | |||
| 1 | To-do list: | ||
| 2 | |||
| 3 | * Correct the coding style according to Linux guidelines; please read the document | ||
| 4 | at https://www.kernel.org/doc/html/latest/process/coding-style.html. | ||
| 5 | * Remove unnecessary debugging/printing macros; for those that are still needed | ||
| 6 | use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). | ||
| 7 | * Remove dead code such as unusued functions, variables, fields, etc.. | ||
| 8 | * Use in-kernel API and remove unnecessary wrappers where possible. | ||
| 9 | * Fix bugs due to code that sleeps in atomic context. | ||
| 10 | * Remove the HAL layer and migrate its functionality into the relevant parts of | ||
| 11 | the driver. | ||
| 12 | * Switch to use LIB80211. | ||
| 13 | * Switch to use MAC80211. | ||
| 14 | * Switch to use CFG80211. | ||
| 15 | * Improve the error handling of various functions, particularly those that use | ||
| 16 | existing kernel APIs. | ||
| @@ -223,73 +223,10 @@ struct cb_desc { · 222 unmodified lines | |||
| 223 | #define MAX_IE_LEN 0xff | 223 | #define MAX_IE_LEN 0xff |
| 224 | 224 | ||
| 225 | // added for kernel conflict | 225 | // added for kernel conflict |
| 226 | #define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl | ||
| 227 | #define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl | ||
| 228 | #define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl | ||
| 229 | #define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl | ||
| 230 | #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl | ||
| 231 | #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl | ||
| 232 | |||
| 233 | #define ieee80211_ccmp_null ieee80211_ccmp_null_rsl | ||
| 234 | |||
| 235 | #define ieee80211_tkip_null ieee80211_tkip_null_rsl | ||
| 236 | |||
| 237 | #define free_ieee80211 free_ieee80211_rsl | ||
| 238 | #define alloc_ieee80211 alloc_ieee80211_rsl | ||
| 239 | |||
| 240 | #define ieee80211_rx ieee80211_rx_rsl | ||
| 241 | #define ieee80211_rx_mgt ieee80211_rx_mgt_rsl | ||
| 242 | |||
| 243 | #define ieee80211_get_beacon ieee80211_get_beacon_rsl | ||
| 244 | #define ieee80211_wake_queue ieee80211_wake_queue_rsl | 226 | #define ieee80211_wake_queue ieee80211_wake_queue_rsl |
| 245 | #define ieee80211_stop_queue ieee80211_stop_queue_rsl | 227 | #define ieee80211_stop_queue ieee80211_stop_queue_rsl |
| 246 | #define ieee80211_reset_queue ieee80211_reset_queue_rsl | ||
| 247 | #define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl | ||
| 248 | #define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl | ||
| 249 | #define ieee80211_is_shortslot ieee80211_is_shortslot_rsl | ||
| 250 | #define ieee80211_is_54g ieee80211_is_54g_rsl | ||
| 251 | #define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl | ||
| 252 | #define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl | ||
| 253 | #define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl | ||
| 254 | #define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl | ||
| 255 | #define notify_wx_assoc_event notify_wx_assoc_event_rsl | 228 | #define notify_wx_assoc_event notify_wx_assoc_event_rsl |
| 256 | #define SendDisassociation SendDisassociation_rsl | 229 | #define SendDisassociation SendDisassociation_rsl |
| 257 | #define ieee80211_disassociate ieee80211_disassociate_rsl | ||
| 258 | #define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl | ||
| 259 | #define ieee80211_stop_scan ieee80211_stop_scan_rsl | ||
| 260 | #define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl | ||
| 261 | #define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl | ||
| 262 | #define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl | ||
| 263 | |||
| 264 | #define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl | ||
| 265 | #define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl | ||
| 266 | #define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl | ||
| 267 | #define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl | ||
| 268 | #define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl | ||
| 269 | #define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl | ||
| 270 | #define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl | ||
| 271 | #define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl | ||
| 272 | #define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl | ||
| 273 | #define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl | ||
| 274 | #define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl | ||
| 275 | #define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl | ||
| 276 | #define ieee80211_wx_get_name ieee80211_wx_get_name_rsl | ||
| 277 | #define ieee80211_wx_set_power ieee80211_wx_set_power_rsl | ||
| 278 | #define ieee80211_wx_get_power ieee80211_wx_get_power_rsl | ||
| 279 | #define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl | ||
| 280 | #define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl | ||
| 281 | #define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl | ||
| 282 | |||
| 283 | #define ieee80211_txb_free ieee80211_txb_free_rsl | ||
| 284 | |||
| 285 | #define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl | ||
| 286 | #define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl | ||
| 287 | #define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl | ||
| 288 | #define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl | ||
| 289 | #define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl | ||
| 290 | #define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl | ||
| 291 | #define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl | ||
| 292 | #define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl | ||
| 293 | 230 | ||
| 294 | 231 | ||
| 295 | struct ieee_param { | 232 | struct ieee_param { |
| @@ -2256,7 +2193,6 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success); · 1960 unmodified lines | |||
| 2256 | void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); | 2193 | void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); |
| 2257 | 2194 | ||
| 2258 | /* ieee80211_crypt_ccmp&tkip&wep.c */ | 2195 | /* ieee80211_crypt_ccmp&tkip&wep.c */ |
| 2259 | void ieee80211_tkip_null(void); | ||
| 2260 | 2196 | ||
| 2261 | int ieee80211_crypto_init(void); | 2197 | int ieee80211_crypto_init(void); |
| 2262 | void ieee80211_crypto_deinit(void); | 2198 | void ieee80211_crypto_deinit(void); |
| @@ -716,9 +716,3 @@ void ieee80211_crypto_tkip_exit(void) · 715 unmodified lines | |||
| 716 | { | 716 | { |
| 717 | ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip); | 717 | ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip); |
| 718 | } | 718 | } |
| 719 | |||
| 720 | void ieee80211_tkip_null(void) | ||
| 721 | { | ||
| 722 | // printk("============>%s()\n", __func__); | ||
| 723 | return; | ||
| 724 | } | ||
| @@ -159,9 +159,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) · 158 unmodified lines | |||
| 159 | ieee->last_packet_time[i] = 0; | 159 | ieee->last_packet_time[i] = 0; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | /* These function were added to load crypte module autoly */ | ||
| 163 | ieee80211_tkip_null(); | ||
| 164 | |||
| 165 | return dev; | 162 | return dev; |
| 166 | 163 | ||
| 167 | failed: | 164 | failed: |
| @@ -951,9 +951,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · 950 unmodified lines | |||
| 951 | #endif | 951 | #endif |
| 952 | 952 | ||
| 953 | if (ieee->iw_mode == IW_MODE_MONITOR) { | 953 | if (ieee->iw_mode == IW_MODE_MONITOR) { |
| 954 | unsigned int len = skb->len; | ||
| 955 | |||
| 954 | ieee80211_monitor_rx(ieee, skb, rx_stats); | 956 | ieee80211_monitor_rx(ieee, skb, rx_stats); |
| 955 | stats->rx_packets++; | 957 | stats->rx_packets++; |
| 956 | stats->rx_bytes += skb->len; | 958 | stats->rx_bytes += len; |
| 957 | return 1; | 959 | return 1; |
| 958 | } | 960 | } |
| 959 | 961 | ||
| @@ -1806,7 +1808,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, · 846 unmodified lines | |||
| 1806 | info_element->data[0] == 0x00 && | 1808 | info_element->data[0] == 0x00 && |
| 1807 | info_element->data[1] == 0x13 && | 1809 | info_element->data[1] == 0x13 && |
| 1808 | info_element->data[2] == 0x74)) { | 1810 | info_element->data[2] == 0x74)) { |
| 1809 | netdev_dbg(ieee->dev, "========> athros AP is exist\n"); | 1811 | netdev_dbg(ieee->dev, "========> Atheros AP exists\n"); |
| 1810 | network->atheros_cap_exist = true; | 1812 | network->atheros_cap_exist = true; |
| 1811 | } else | 1813 | } else |
| 1812 | network->atheros_cap_exist = false; | 1814 | network->atheros_cap_exist = false; |
| @@ -304,25 +304,42 @@ int r8712_init_drv_sw(struct _adapter *padapter) · 303 unmodified lines | |||
| 304 | padapter->cmdpriv.padapter = padapter; | 304 | padapter->cmdpriv.padapter = padapter; |
| 305 | ret = r8712_init_evt_priv(&padapter->evtpriv); | 305 | ret = r8712_init_evt_priv(&padapter->evtpriv); |
| 306 | if (ret) | 306 | if (ret) |
| 307 | return ret; | 307 | goto free_cmd; |
| 308 | ret = r8712_init_mlme_priv(padapter); | 308 | ret = r8712_init_mlme_priv(padapter); |
| 309 | if (ret) | 309 | if (ret) |
| 310 | return ret; | 310 | goto free_evt; |
| 311 | _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); | 311 | ret = _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); |
| 312 | _r8712_init_recv_priv(&padapter->recvpriv, padapter); | 312 | if (ret) |
| 313 | goto free_mlme; | ||
| 314 | ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter); | ||
| 315 | if (ret) | ||
| 316 | goto free_xmit; | ||
| 313 | memset((unsigned char *)&padapter->securitypriv, 0, | 317 | memset((unsigned char *)&padapter->securitypriv, 0, |
| 314 | sizeof(struct security_priv)); | 318 | sizeof(struct security_priv)); |
| 315 | timer_setup(&padapter->securitypriv.tkip_timer, | 319 | timer_setup(&padapter->securitypriv.tkip_timer, |
| 316 | r8712_use_tkipkey_handler, 0); | 320 | r8712_use_tkipkey_handler, 0); |
| 317 | ret = _r8712_init_sta_priv(&padapter->stapriv); | 321 | ret = _r8712_init_sta_priv(&padapter->stapriv); |
| 318 | if (ret) | 322 | if (ret) |
| 319 | return ret; | 323 | goto free_recv; |
| 320 | padapter->stapriv.padapter = padapter; | 324 | padapter->stapriv.padapter = padapter; |
| 321 | r8712_init_bcmc_stainfo(padapter); | 325 | r8712_init_bcmc_stainfo(padapter); |
| 322 | r8712_init_pwrctrl_priv(padapter); | 326 | r8712_init_pwrctrl_priv(padapter); |
| 323 | mp871xinit(padapter); | 327 | mp871xinit(padapter); |
| 324 | init_default_value(padapter); | 328 | init_default_value(padapter); |
| 325 | r8712_InitSwLeds(padapter); | 329 | r8712_InitSwLeds(padapter); |
| 330 | |||
| 331 | return 0; | ||
| 332 | |||
| 333 | free_recv: | ||
| 334 | _r8712_free_recv_priv(&padapter->recvpriv); | ||
| 335 | free_xmit: | ||
| 336 | _free_xmit_priv(&padapter->xmitpriv); | ||
| 337 | free_mlme: | ||
| 338 | r8712_free_mlme_priv(&padapter->mlmepriv); | ||
| 339 | free_evt: | ||
| 340 | r8712_free_evt_priv(&padapter->evtpriv); | ||
| 341 | free_cmd: | ||
| 342 | r8712_free_cmd_priv(&padapter->cmdpriv); | ||
| 326 | return ret; | 343 | return ret; |
| 327 | } | 344 | } |
| 328 | 345 | ||
| @@ -18,15 +18,15 @@ · 17 unmodified lines | |||
| 18 | #include "drv_types.h" | 18 | #include "drv_types.h" |
| 19 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
| 20 | 20 | ||
| 21 | void _r8712_init_recv_priv(struct recv_priv *precvpriv, | 21 | int _r8712_init_recv_priv(struct recv_priv *precvpriv, |
| 22 | struct _adapter *padapter); | 22 | struct _adapter *padapter); |
| 23 | void _r8712_free_recv_priv(struct recv_priv *precvpriv); | 23 | void _r8712_free_recv_priv(struct recv_priv *precvpriv); |
| 24 | void r8712_recv_entry(union recv_frame *precv_frame); | 24 | void r8712_recv_entry(union recv_frame *precv_frame); |
| 25 | void r8712_recv_indicatepkt(struct _adapter *adapter, | 25 | void r8712_recv_indicatepkt(struct _adapter *adapter, |
| 26 | union recv_frame *precv_frame); | 26 | union recv_frame *precv_frame); |
| 27 | void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup); | 27 | void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup); |
| 28 | void r8712_init_recv_priv(struct recv_priv *precvpriv, | 28 | int r8712_init_recv_priv(struct recv_priv *precvpriv, |
| 29 | struct _adapter *padapter); | 29 | struct _adapter *padapter); |
| 30 | void r8712_free_recv_priv(struct recv_priv *precvpriv); | 30 | void r8712_free_recv_priv(struct recv_priv *precvpriv); |
| 31 | void r8712_os_recv_resource_alloc(struct _adapter *padapter, | 31 | void r8712_os_recv_resource_alloc(struct _adapter *padapter, |
| 32 | union recv_frame *precvframe); | 32 | union recv_frame *precvframe); |
| @@ -30,8 +30,8 @@ · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | static void recv_tasklet(struct tasklet_struct *t); | 31 | static void recv_tasklet(struct tasklet_struct *t); |
| 32 | 32 | ||
| 33 | void r8712_init_recv_priv(struct recv_priv *precvpriv, | 33 | int r8712_init_recv_priv(struct recv_priv *precvpriv, |
| 34 | struct _adapter *padapter) | 34 | struct _adapter *padapter) |
| 35 | { | 35 | { |
| 36 | int i; | 36 | int i; |
| 37 | struct recv_buf *precvbuf; | 37 | struct recv_buf *precvbuf; |
| @@ -44,7 +44,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, · 6 unmodified lines | |||
| 44 | precvpriv->pallocated_recv_buf = | 44 | precvpriv->pallocated_recv_buf = |
| 45 | kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); | 45 | kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); |
| 46 | if (!precvpriv->pallocated_recv_buf) | 46 | if (!precvpriv->pallocated_recv_buf) |
| 47 | return; | 47 | return -ENOMEM; |
| 48 | precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - | 48 | precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - |
| 49 | ((addr_t)(precvpriv->pallocated_recv_buf) & 3); | 49 | ((addr_t)(precvpriv->pallocated_recv_buf) & 3); |
| 50 | precvbuf = (struct recv_buf *)precvpriv->precv_buf; | 50 | precvbuf = (struct recv_buf *)precvpriv->precv_buf; |
| @@ -75,6 +75,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, · 24 unmodified lines | |||
| 75 | } | 75 | } |
| 76 | pskb = NULL; | 76 | pskb = NULL; |
| 77 | } | 77 | } |
| 78 | return 0; | ||
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | void r8712_free_recv_priv(struct recv_priv *precvpriv) | 81 | void r8712_free_recv_priv(struct recv_priv *precvpriv) |
| @@ -601,7 +601,7 @@ int r8712_xmitframe_complete(struct _adapter *padapter, · 600 unmodified lines | |||
| 601 | #ifdef CONFIG_R8712_TX_AGGR | 601 | #ifdef CONFIG_R8712_TX_AGGR |
| 602 | struct xmit_frame *p2ndxmitframe = NULL; | 602 | struct xmit_frame *p2ndxmitframe = NULL; |
| 603 | #else | 603 | #else |
| 604 | int res = _SUCCESS, xcnt = 0; | 604 | int res = _SUCCESS; |
| 605 | #endif | 605 | #endif |
| 606 | 606 | ||
| 607 | phwxmits = pxmitpriv->hwxmits; | 607 | phwxmits = pxmitpriv->hwxmits; |
| @@ -673,7 +673,6 @@ int r8712_xmitframe_complete(struct _adapter *padapter, · 65 unmodified lines | |||
| 673 | dump_xframe(padapter, pxmitframe); | 673 | dump_xframe(padapter, pxmitframe); |
| 674 | else | 674 | else |
| 675 | r8712_free_xmitframe_ex(pxmitpriv, pxmitframe); | 675 | r8712_free_xmitframe_ex(pxmitpriv, pxmitframe); |
| 676 | xcnt++; | ||
| 677 | #endif | 676 | #endif |
| 678 | 677 | ||
| 679 | } else { /* pxmitframe == NULL && p2ndxmitframe == NULL */ | 678 | } else { /* pxmitframe == NULL && p2ndxmitframe == NULL */ |
| @@ -17,9 +17,7 @@ · 16 unmodified lines | |||
| 17 | #define _RTL871X_RECV_C_ | 17 | #define _RTL871X_RECV_C_ |
| 18 | 18 | ||
| 19 | #include <linux/ip.h> | 19 | #include <linux/ip.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/if_ether.h> | 20 | #include <linux/if_ether.h> |
| 22 | #include <linux/kmemleak.h> | ||
| 23 | #include <linux/etherdevice.h> | 21 | #include <linux/etherdevice.h> |
| 24 | #include <linux/ieee80211.h> | 22 | #include <linux/ieee80211.h> |
| 25 | #include <net/cfg80211.h> | 23 | #include <net/cfg80211.h> |
| @@ -44,9 +42,10 @@ void _r8712_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) · 18 unmodified lines | |||
| 44 | _init_queue(&psta_recvpriv->defrag_q); | 42 | _init_queue(&psta_recvpriv->defrag_q); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | void _r8712_init_recv_priv(struct recv_priv *precvpriv, | 45 | int _r8712_init_recv_priv(struct recv_priv *precvpriv, |
| 48 | struct _adapter *padapter) | 46 | struct _adapter *padapter) |
| 49 | { | 47 | { |
| 48 | int ret; | ||
| 50 | sint i; | 49 | sint i; |
| 51 | union recv_frame *precvframe; | 50 | union recv_frame *precvframe; |
| 52 | 51 | ||
| @@ -60,8 +59,7 @@ void _r8712_init_recv_priv(struct recv_priv *precvpriv, · 7 unmodified lines | |||
| 60 | sizeof(union recv_frame) + RXFRAME_ALIGN_SZ, | 59 | sizeof(union recv_frame) + RXFRAME_ALIGN_SZ, |
| 61 | GFP_ATOMIC); | 60 | GFP_ATOMIC); |
| 62 | if (!precvpriv->pallocated_frame_buf) | 61 | if (!precvpriv->pallocated_frame_buf) |
| 63 | return; | 62 | return -ENOMEM; |
| 64 | kmemleak_not_leak(precvpriv->pallocated_frame_buf); | ||
| 65 | precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + | 63 | precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + |
| 66 | RXFRAME_ALIGN_SZ - | 64 | RXFRAME_ALIGN_SZ - |
| 67 | ((addr_t)(precvpriv->pallocated_frame_buf) & | 65 | ((addr_t)(precvpriv->pallocated_frame_buf) & |
| @@ -76,7 +74,11 @@ void _r8712_init_recv_priv(struct recv_priv *precvpriv, · 8 unmodified lines | |||
| 76 | precvframe++; | 74 | precvframe++; |
| 77 | } | 75 | } |
| 78 | precvpriv->rx_pending_cnt = 1; | 76 | precvpriv->rx_pending_cnt = 1; |
| 79 | r8712_init_recv_priv(precvpriv, padapter); | 77 | ret = r8712_init_recv_priv(precvpriv, padapter); |
| 78 | if (ret) | ||
| 79 | kfree(precvpriv->pallocated_frame_buf); | ||
| 80 | |||
| 81 | return ret; | ||
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | void _r8712_free_recv_priv(struct recv_priv *precvpriv) | 84 | void _r8712_free_recv_priv(struct recv_priv *precvpriv) |
| @@ -282,7 +282,7 @@ u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoT · 281 unmodified lines | |||
| 282 | { | 282 | { |
| 283 | u8 tmpidx = 0; | 283 | u8 tmpidx = 0; |
| 284 | u8 bResult = false; | 284 | u8 bResult = false; |
| 285 | u32 efuseValue = 0; | 285 | u32 efuseValue; |
| 286 | 286 | ||
| 287 | if (bPseudoTest) | 287 | if (bPseudoTest) |
| 288 | return Efuse_Write1ByteToFakeContent(addr, data); | 288 | return Efuse_Write1ByteToFakeContent(addr, data); |
| @@ -1063,18 +1063,18 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) · 1062 unmodified lines | |||
| 1063 | /* parsing HT_CAP_IE */ | 1063 | /* parsing HT_CAP_IE */ |
| 1064 | p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); | 1064 | p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); |
| 1065 | if (p && len > 0) { | 1065 | if (p && len > 0) { |
| 1066 | pht_cap = (struct ieee80211_ht_cap *)(p + 2); | 1066 | pht_cap = (struct ieee80211_ht_cap *)(p + 2); |
| 1067 | pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info); | 1067 | pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info); |
| 1068 | } else { | 1068 | } else { |
| 1069 | pnetwork->bcn_info.ht_cap_info = 0; | 1069 | pnetwork->bcn_info.ht_cap_info = 0; |
| 1070 | } | 1070 | } |
| 1071 | /* parsing HT_INFO_IE */ | 1071 | /* parsing HT_INFO_IE */ |
| 1072 | p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); | 1072 | p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); |
| 1073 | if (p && len > 0) { | 1073 | if (p && len > 0) { |
| 1074 | pht_info = (struct HT_info_element *)(p + 2); | 1074 | pht_info = (struct HT_info_element *)(p + 2); |
| 1075 | pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0]; | 1075 | pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0]; |
| 1076 | } else { | 1076 | } else { |
| 1077 | pnetwork->bcn_info.ht_info_infos_0 = 0; | 1077 | pnetwork->bcn_info.ht_info_infos_0 = 0; |
| 1078 | } | 1078 | } |
| 1079 | } | 1079 | } |
| 1080 | 1080 | ||
| @@ -78,6 +78,7 @@ u8 rtw_do_join(struct adapter *padapter) · 77 unmodified lines | |||
| 78 | goto exit; | 78 | goto exit; |
| 79 | } else { | 79 | } else { |
| 80 | int select_ret; | 80 | int select_ret; |
| 81 | |||
| 81 | spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); | 82 | spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); |
| 82 | select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); | 83 | select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); |
| 83 | if (select_ret == _SUCCESS) { | 84 | if (select_ret == _SUCCESS) { |
| @@ -159,7 +160,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) · 75 unmodified lines | |||
| 159 | if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { | 160 | if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { |
| 160 | if ((pmlmepriv->assoc_ssid.ssid_length == ssid->ssid_length) && | 161 | if ((pmlmepriv->assoc_ssid.ssid_length == ssid->ssid_length) && |
| 161 | (!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_length))) { | 162 | (!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_length))) { |
| 162 | if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) { | 163 | if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) { |
| 163 | if (rtw_is_same_ibss(padapter, pnetwork) == false) { | 164 | if (rtw_is_same_ibss(padapter, pnetwork) == false) { |
| 164 | /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ | 165 | /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ |
| 165 | rtw_disassoc_cmd(padapter, 0, true); | 166 | rtw_disassoc_cmd(padapter, 0, true); |
| @@ -311,7 +312,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 145 unmodified lines | |||
| 311 | if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { | 312 | if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { |
| 312 | if (check_fwstate(pmlmepriv, _FW_LINKED) == true) | 313 | if (check_fwstate(pmlmepriv, _FW_LINKED) == true) |
| 313 | rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ | 314 | rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ |
| 314 | } | 315 | } |
| 315 | 316 | ||
| 316 | *pold_state = networktype; | 317 | *pold_state = networktype; |
| 317 | 318 | ||
| @@ -367,7 +368,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) · 49 unmodified lines | |||
| 367 | 368 | ||
| 368 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) | 369 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) |
| 369 | { | 370 | { |
| 370 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | 371 | struct mlme_priv *pmlmepriv = &padapter->mlmepriv; |
| 371 | u8 res = true; | 372 | u8 res = true; |
| 372 | 373 | ||
| 373 | if (!padapter) { | 374 | if (!padapter) { |
| @@ -462,11 +463,11 @@ exit: · 88 unmodified lines | |||
| 462 | } | 463 | } |
| 463 | 464 | ||
| 464 | /* | 465 | /* |
| 465 | * rtw_get_cur_max_rate - | 466 | * rtw_get_cur_max_rate - |
| 466 | * @adapter: pointer to struct adapter structure | 467 | * @adapter: pointer to struct adapter structure |
| 467 | * | 468 | * |
| 468 | * Return 0 or 100Kbps | 469 | * Return 0 or 100Kbps |
| 469 | */ | 470 | */ |
| 470 | u16 rtw_get_cur_max_rate(struct adapter *adapter) | 471 | u16 rtw_get_cur_max_rate(struct adapter *adapter) |
| 471 | { | 472 | { |
| 472 | int i = 0; | 473 | int i = 0; |
| @@ -389,7 +389,7 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea · 388 unmodified lines | |||
| 389 | __le16 tmps, tmpd; | 389 | __le16 tmps, tmpd; |
| 390 | 390 | ||
| 391 | if (rtw_bug_check(dst, src, &s_cap, &d_cap) == false) | 391 | if (rtw_bug_check(dst, src, &s_cap, &d_cap) == false) |
| 392 | return false; | 392 | return false; |
| 393 | 393 | ||
| 394 | memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->ies), 2); | 394 | memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->ies), 2); |
| 395 | memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->ies), 2); | 395 | memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->ies), 2); |
| @@ -669,7 +669,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor · 273 unmodified lines | |||
| 669 | uint ie_len = 0; | 669 | uint ie_len = 0; |
| 670 | 670 | ||
| 671 | if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0)) | 671 | if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0)) |
| 672 | bselected = false; | 672 | bselected = false; |
| 673 | 673 | ||
| 674 | if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { | 674 | if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { |
| 675 | p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_)); | 675 | p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_)); |
| @@ -795,7 +795,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) · 119 unmodified lines | |||
| 795 | pmlmepriv->to_join = false; | 795 | pmlmepriv->to_join = false; |
| 796 | s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); | 796 | s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); |
| 797 | if (s_ret == _SUCCESS) { | 797 | if (s_ret == _SUCCESS) { |
| 798 | _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); | 798 | _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); |
| 799 | } else if (s_ret == 2) {/* there is no need to wait for join */ | 799 | } else if (s_ret == 2) {/* there is no need to wait for join */ |
| 800 | _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); | 800 | _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); |
| 801 | rtw_indicate_connect(adapter); | 801 | rtw_indicate_connect(adapter); |
| @@ -2010,8 +2010,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ · 1208 unmodified lines | |||
| 2010 | 2010 | ||
| 2011 | if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */ | 2011 | if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */ |
| 2012 | for (j = i; j < i + 9; j++) { | 2012 | for (j = i; j < i + 9; j++) { |
| 2013 | out_ie[ielength] = in_ie[j]; | 2013 | out_ie[ielength] = in_ie[j]; |
| 2014 | ielength++; | 2014 | ielength++; |
| 2015 | } | 2015 | } |
| 2016 | out_ie[initial_out_len + 1] = 0x07; | 2016 | out_ie[initial_out_len + 1] = 0x07; |
| 2017 | out_ie[initial_out_len + 6] = 0x00; | 2017 | out_ie[initial_out_len + 6] = 0x00; |
| @@ -2064,15 +2064,13 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie · 46 unmodified lines | |||
| 2064 | 2064 | ||
| 2065 | if (ie[13] <= 20) { | 2065 | if (ie[13] <= 20) { |
| 2066 | /* The RSN IE didn't include the PMK ID, append the PMK information */ | 2066 | /* The RSN IE didn't include the PMK ID, append the PMK information */ |
| 2067 | ie[ie_len] = 1; | 2067 | ie[ie_len] = 1; |
| 2068 | ie_len++; | 2068 | ie_len++; |
| 2069 | ie[ie_len] = 0; /* PMKID count = 0x0100 */ | 2069 | ie[ie_len] = 0; /* PMKID count = 0x0100 */ |
| 2070 | ie_len++; | 2070 | ie_len++; |
| 2071 | memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); | 2071 | memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); |
| 2072 | 2072 | ie_len += 16; | |
| 2073 | ie_len += 16; | 2073 | ie[13] += 18;/* PMKID length = 2+16 */ |
| 2074 | ie[13] += 18;/* PMKID length = 2+16 */ | ||
| 2075 | |||
| 2076 | } | 2074 | } |
| 2077 | return ie_len; | 2075 | return ie_len; |
| 2078 | } | 2076 | } |
| @@ -2091,9 +2089,9 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u · 12 unmodified lines | |||
| 2091 | memcpy(out_ie, in_ie, 12); | 2089 | memcpy(out_ie, in_ie, 12); |
| 2092 | ielength = 12; | 2090 | ielength = 12; |
| 2093 | if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) | 2091 | if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) |
| 2094 | authmode = WLAN_EID_VENDOR_SPECIFIC; | 2092 | authmode = WLAN_EID_VENDOR_SPECIFIC; |
| 2095 | if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) | 2093 | if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) |
| 2096 | authmode = WLAN_EID_RSN; | 2094 | authmode = WLAN_EID_RSN; |
| 2097 | 2095 | ||
| 2098 | if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { | 2096 | if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { |
| 2099 | memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); | 2097 | memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); |
| @@ -5447,7 +5447,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) · 5446 unmodified lines | |||
| 5447 | u8 val8; | 5447 | u8 val8; |
| 5448 | 5448 | ||
| 5449 | if (is_client_associated_to_ap(padapter)) | 5449 | if (is_client_associated_to_ap(padapter)) |
| 5450 | issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); | 5450 | issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); |
| 5451 | 5451 | ||
| 5452 | if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) { | 5452 | if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) { |
| 5453 | /* Stop BCN */ | 5453 | /* Stop BCN */ |
| @@ -161,7 +161,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_ · 160 unmodified lines | |||
| 161 | 161 | ||
| 162 | if (padapter) { | 162 | if (padapter) { |
| 163 | if (pfree_recv_queue == &precvpriv->free_recv_queue) | 163 | if (pfree_recv_queue == &precvpriv->free_recv_queue) |
| 164 | precvpriv->free_recvframe_cnt++; | 164 | precvpriv->free_recvframe_cnt++; |
| 165 | } | 165 | } |
| 166 | spin_unlock_bh(&pfree_recv_queue->lock); | 166 | spin_unlock_bh(&pfree_recv_queue->lock); |
| 167 | return _SUCCESS; | 167 | return _SUCCESS; |
| @@ -691,8 +691,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame * · 523 unmodified lines | |||
| 691 | if (bmcast) { | 691 | if (bmcast) { |
| 692 | /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ | 692 | /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ |
| 693 | if (!IS_MCAST(pattrib->bssid)) { | 693 | if (!IS_MCAST(pattrib->bssid)) { |
| 694 | ret = _FAIL; | 694 | ret = _FAIL; |
| 695 | goto exit; | 695 | goto exit; |
| 696 | } | 696 | } |
| 697 | } else { /* not mc-frame */ | 697 | } else { /* not mc-frame */ |
| 698 | /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ | 698 | /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ |
| @@ -551,7 +551,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) · 550 unmodified lines | |||
| 551 | else if (pacl_list->mode == 2)/* deny unless in accept list */ | 551 | else if (pacl_list->mode == 2)/* deny unless in accept list */ |
| 552 | res = match; | 552 | res = match; |
| 553 | else | 553 | else |
| 554 | res = true; | 554 | res = true; |
| 555 | 555 | ||
| 556 | return res; | 556 | return res; |
| 557 | } | 557 | } |
| @@ -986,15 +986,11 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE) · 985 unmodified lines | |||
| 986 | pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]); | 986 | pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]); |
| 987 | } else { | 987 | } else { |
| 988 | /* modify from fw by Thomas 2010/11/17 */ | 988 | /* modify from fw by Thomas 2010/11/17 */ |
| 989 | if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3)) | 989 | max_AMPDU_len = min(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3, |
| 990 | max_AMPDU_len = (pIE->data[i] & 0x3); | 990 | pIE->data[i] & 0x3); |
| 991 | else | ||
| 992 | max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3); | ||
| 993 | 991 | ||
| 994 | if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c)) | 992 | min_MPDU_spacing = max(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c, |
| 995 | min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c); | 993 | pIE->data[i] & 0x1c); |
| 996 | else | ||
| 997 | min_MPDU_spacing = (pIE->data[i] & 0x1c); | ||
| 998 | 994 | ||
| 999 | pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing; | 995 | pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing; |
| 1000 | } | 996 | } |
| @@ -244,8 +244,8 @@ void ODM_TxPwrTrackSetPwr_8723B( · 243 unmodified lines | |||
| 244 | Final_CCK_Swing_Index = 0; | 244 | Final_CCK_Swing_Index = 0; |
| 245 | 245 | ||
| 246 | setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, | 246 | setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, |
| 247 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], | 247 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], |
| 248 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); | 248 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); |
| 249 | 249 | ||
| 250 | setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); | 250 | setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); |
| 251 | 251 | ||
| @@ -257,8 +257,8 @@ void ODM_TxPwrTrackSetPwr_8723B( · 5 unmodified lines | |||
| 257 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM; | 257 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM; |
| 258 | 258 | ||
| 259 | setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath, | 259 | setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath, |
| 260 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], | 260 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], |
| 261 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); | 261 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); |
| 262 | 262 | ||
| 263 | pDM_Odm->Modify_TxAGC_Flag_PathA = true; | 263 | pDM_Odm->Modify_TxAGC_Flag_PathA = true; |
| 264 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); | 264 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); |
| @@ -267,16 +267,16 @@ void ODM_TxPwrTrackSetPwr_8723B( · 2 unmodified lines | |||
| 267 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; | 267 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; |
| 268 | 268 | ||
| 269 | setIqkMatrix_8723B(pDM_Odm, 0, RFPath, | 269 | setIqkMatrix_8723B(pDM_Odm, 0, RFPath, |
| 270 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], | 270 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], |
| 271 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); | 271 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); |
| 272 | 272 | ||
| 273 | pDM_Odm->Modify_TxAGC_Flag_PathA = true; | 273 | pDM_Odm->Modify_TxAGC_Flag_PathA = true; |
| 274 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); | 274 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); |
| 275 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); | 275 | PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); |
| 276 | } else { | 276 | } else { |
| 277 | setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, | 277 | setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, |
| 278 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], | 278 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], |
| 279 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); | 279 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); |
| 280 | 280 | ||
| 281 | if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */ | 281 | if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */ |
| 282 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; | 282 | pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; |
| @@ -1759,9 +1759,8 @@ void PHY_IQCalibrate_8723B( · 1476 unmodified lines | |||
| 1759 | /* To Fix BSOD when final_candidate is 0xff */ | 1759 | /* To Fix BSOD when final_candidate is 0xff */ |
| 1760 | /* by sherry 20120321 */ | 1760 | /* by sherry 20120321 */ |
| 1761 | if (final_candidate < 4) { | 1761 | if (final_candidate < 4) { |
| 1762 | for (i = 0; i < IQK_Matrix_REG_NUM; i++) | 1762 | for (i = 0; i < IQK_MATRIX_REG_NUM; i++) |
| 1763 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i]; | 1763 | pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[0][i] = result[final_candidate][i]; |
| 1764 | pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true; | ||
| 1765 | } | 1764 | } |
| 1766 | 1765 | ||
| 1767 | _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); | 1766 | _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); |
| @@ -193,8 +193,8 @@ struct odm_rate_adaptive { · 192 unmodified lines | |||
| 193 | #define HP_THERMAL_NUM 8 | 193 | #define HP_THERMAL_NUM 8 |
| 194 | 194 | ||
| 195 | #define AVG_THERMAL_NUM 8 | 195 | #define AVG_THERMAL_NUM 8 |
| 196 | #define IQK_Matrix_REG_NUM 8 | 196 | #define IQK_MATRIX_REG_NUM 8 |
| 197 | #define IQK_Matrix_Settings_NUM 14 /* Channels_2_4G_NUM */ | 197 | #define IQK_MATRIX_SETTINGS_NUM 14 /* Channels_2_4G_NUM */ |
| 198 | 198 | ||
| 199 | #define DM_Type_ByFW 0 | 199 | #define DM_Type_ByFW 0 |
| 200 | #define DM_Type_ByDriver 1 | 200 | #define DM_Type_ByDriver 1 |
| @@ -479,12 +479,6 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */ · 278 unmodified lines | |||
| 479 | TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) | 479 | TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) |
| 480 | }; | 480 | }; |
| 481 | 481 | ||
| 482 | struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */ | ||
| 483 | bool bIQKDone; | ||
| 484 | s32 Value[3][IQK_Matrix_REG_NUM]; | ||
| 485 | bool bBWIqkResultSaved[3]; | ||
| 486 | }; | ||
| 487 | |||
| 488 | /* Remove PATHDIV_PARA struct to odm_PathDiv.h */ | 482 | /* Remove PATHDIV_PARA struct to odm_PathDiv.h */ |
| 489 | 483 | ||
| 490 | struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ | 484 | struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ |
| @@ -530,7 +524,7 @@ struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ · 39 unmodified lines | |||
| 530 | 524 | ||
| 531 | u8 ThermalValue_HP[HP_THERMAL_NUM]; | 525 | u8 ThermalValue_HP[HP_THERMAL_NUM]; |
| 532 | u8 ThermalValue_HP_index; | 526 | u8 ThermalValue_HP_index; |
| 533 | struct iqk_matrix_regs_setting IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; | 527 | s32 iqk_matrix_regs_setting_value[IQK_MATRIX_SETTINGS_NUM][IQK_MATRIX_REG_NUM]; |
| 534 | bool bNeedIQK; | 528 | bool bNeedIQK; |
| 535 | bool bIQKInProgress; | 529 | bool bIQKInProgress; |
| 536 | u8 Delta_IQK; | 530 | u8 Delta_IQK; |
| @@ -598,10 +598,7 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) · 597 unmodified lines | |||
| 598 | /* Lower bound checking */ | 598 | /* Lower bound checking */ |
| 599 | 599 | ||
| 600 | /* RSSI Lower bound check */ | 600 | /* RSSI Lower bound check */ |
| 601 | if ((pDM_Odm->RSSI_Min-10) > DM_DIG_MIN_NIC) | 601 | RSSI_Lower = max(pDM_Odm->RSSI_Min - 10, DM_DIG_MIN_NIC); |
| 602 | RSSI_Lower = pDM_Odm->RSSI_Min-10; | ||
| 603 | else | ||
| 604 | RSSI_Lower = DM_DIG_MIN_NIC; | ||
| 605 | 602 | ||
| 606 | /* Upper and Lower Bound checking */ | 603 | /* Upper and Lower Bound checking */ |
| 607 | if (CurrentIGI > DM_DIG_MAX_NIC) | 604 | if (CurrentIGI > DM_DIG_MAX_NIC) |
| @@ -1551,7 +1551,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel · 1550 unmodified lines | |||
| 1551 | 1551 | ||
| 1552 | wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen); | 1552 | wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen); |
| 1553 | if (wps_ie && wps_ielen > 0) { | 1553 | if (wps_ie && wps_ielen > 0) { |
| 1554 | padapter->securitypriv.wps_ie_len = wps_ielen < MAX_WPS_IE_LEN ? wps_ielen : MAX_WPS_IE_LEN; | 1554 | padapter->securitypriv.wps_ie_len = min_t(uint, wps_ielen, MAX_WPS_IE_LEN); |
| 1555 | memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len); | 1555 | memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len); |
| 1556 | set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); | 1556 | set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); |
| 1557 | } else { | 1557 | } else { |
| @@ -4506,7 +4506,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) · 4505 unmodified lines | |||
| 4506 | if (CHK_SD(sd_card)) { | 4506 | if (CHK_SD(sd_card)) { |
| 4507 | retval = reset_sd(chip); | 4507 | retval = reset_sd(chip); |
| 4508 | if (retval != STATUS_SUCCESS) { | 4508 | if (retval != STATUS_SUCCESS) { |
| 4509 | sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); | 4509 | sd_card->sd_lock_status &= |
| 4510 | ~(SD_UNLOCK_POW_ON | SD_SDR_RST); | ||
| 4510 | goto sd_execute_write_cmd_failed; | 4511 | goto sd_execute_write_cmd_failed; |
| 4511 | } | 4512 | } |
| 4512 | } | 4513 | } |
| @@ -9,7 +9,7 @@ config FB_SM750 · 8 unmodified lines | |||
| 9 | select VIDEO_NOMODESET | 9 | select VIDEO_NOMODESET |
| 10 | help | 10 | help |
| 11 | Frame buffer driver for the Silicon Motion SM750 chip | 11 | Frame buffer driver for the Silicon Motion SM750 chip |
| 12 | with 2D accelearion and dual head support. | 12 | with 2D acceleration and dual head support. |
| 13 | 13 | ||
| 14 | This driver is also available as a module. The module will be | 14 | This driver is also available as a module. The module will be |
| 15 | called sm750fb. If you want to compile it as a module, say M | 15 | called sm750fb. If you want to compile it as a module, say M |
| @@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = { · 86 unmodified lines | |||
| 87 | .depth = 12, | 87 | .depth = 12, |
| 88 | .mmal_component = COMP_CAMERA, | 88 | .mmal_component = COMP_CAMERA, |
| 89 | .ybbp = 1, | 89 | .ybbp = 1, |
| 90 | .remove_padding = 1, | 90 | .remove_padding = true, |
| 91 | }, { | 91 | }, { |
| 92 | .fourcc = V4L2_PIX_FMT_YUYV, | 92 | .fourcc = V4L2_PIX_FMT_YUYV, |
| 93 | .mmal = MMAL_ENCODING_YUYV, | 93 | .mmal = MMAL_ENCODING_YUYV, |
| 94 | .depth = 16, | 94 | .depth = 16, |
| 95 | .mmal_component = COMP_CAMERA, | 95 | .mmal_component = COMP_CAMERA, |
| 96 | .ybbp = 2, | 96 | .ybbp = 2, |
| 97 | .remove_padding = 0, | 97 | .remove_padding = false, |
| 98 | }, { | 98 | }, { |
| 99 | .fourcc = V4L2_PIX_FMT_RGB24, | 99 | .fourcc = V4L2_PIX_FMT_RGB24, |
| 100 | .mmal = MMAL_ENCODING_RGB24, | 100 | .mmal = MMAL_ENCODING_RGB24, |
| 101 | .depth = 24, | 101 | .depth = 24, |
| 102 | .mmal_component = COMP_CAMERA, | 102 | .mmal_component = COMP_CAMERA, |
| 103 | .ybbp = 3, | 103 | .ybbp = 3, |
| 104 | .remove_padding = 0, | 104 | .remove_padding = false, |
| 105 | }, { | 105 | }, { |
| 106 | .fourcc = V4L2_PIX_FMT_JPEG, | 106 | .fourcc = V4L2_PIX_FMT_JPEG, |
| 107 | .flags = V4L2_FMT_FLAG_COMPRESSED, | 107 | .flags = V4L2_FMT_FLAG_COMPRESSED, |
| @@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = { · 1 unmodified line | |||
| 109 | .depth = 8, | 109 | .depth = 8, |
| 110 | .mmal_component = COMP_IMAGE_ENCODE, | 110 | .mmal_component = COMP_IMAGE_ENCODE, |
| 111 | .ybbp = 0, | 111 | .ybbp = 0, |
| 112 | .remove_padding = 0, | 112 | .remove_padding = false, |
| 113 | }, { | 113 | }, { |
| 114 | .fourcc = V4L2_PIX_FMT_H264, | 114 | .fourcc = V4L2_PIX_FMT_H264, |
| 115 | .flags = V4L2_FMT_FLAG_COMPRESSED, | 115 | .flags = V4L2_FMT_FLAG_COMPRESSED, |
| @@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = { · 1 unmodified line | |||
| 117 | .depth = 8, | 117 | .depth = 8, |
| 118 | .mmal_component = COMP_VIDEO_ENCODE, | 118 | .mmal_component = COMP_VIDEO_ENCODE, |
| 119 | .ybbp = 0, | 119 | .ybbp = 0, |
| 120 | .remove_padding = 0, | 120 | .remove_padding = false, |
| 121 | }, { | 121 | }, { |
| 122 | .fourcc = V4L2_PIX_FMT_MJPEG, | 122 | .fourcc = V4L2_PIX_FMT_MJPEG, |
| 123 | .flags = V4L2_FMT_FLAG_COMPRESSED, | 123 | .flags = V4L2_FMT_FLAG_COMPRESSED, |
| @@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = { · 1 unmodified line | |||
| 125 | .depth = 8, | 125 | .depth = 8, |
| 126 | .mmal_component = COMP_VIDEO_ENCODE, | 126 | .mmal_component = COMP_VIDEO_ENCODE, |
| 127 | .ybbp = 0, | 127 | .ybbp = 0, |
| 128 | .remove_padding = 0, | 128 | .remove_padding = false, |
| 129 | }, { | 129 | }, { |
| 130 | .fourcc = V4L2_PIX_FMT_YVYU, | 130 | .fourcc = V4L2_PIX_FMT_YVYU, |
| 131 | .mmal = MMAL_ENCODING_YVYU, | 131 | .mmal = MMAL_ENCODING_YVYU, |
| 132 | .depth = 16, | 132 | .depth = 16, |
| 133 | .mmal_component = COMP_CAMERA, | 133 | .mmal_component = COMP_CAMERA, |
| 134 | .ybbp = 2, | 134 | .ybbp = 2, |
| 135 | .remove_padding = 0, | 135 | .remove_padding = false, |
| 136 | }, { | 136 | }, { |
| 137 | .fourcc = V4L2_PIX_FMT_VYUY, | 137 | .fourcc = V4L2_PIX_FMT_VYUY, |
| 138 | .mmal = MMAL_ENCODING_VYUY, | 138 | .mmal = MMAL_ENCODING_VYUY, |
| 139 | .depth = 16, | 139 | .depth = 16, |
| 140 | .mmal_component = COMP_CAMERA, | 140 | .mmal_component = COMP_CAMERA, |
| 141 | .ybbp = 2, | 141 | .ybbp = 2, |
| 142 | .remove_padding = 0, | 142 | .remove_padding = false, |
| 143 | }, { | 143 | }, { |
| 144 | .fourcc = V4L2_PIX_FMT_UYVY, | 144 | .fourcc = V4L2_PIX_FMT_UYVY, |
| 145 | .mmal = MMAL_ENCODING_UYVY, | 145 | .mmal = MMAL_ENCODING_UYVY, |
| 146 | .depth = 16, | 146 | .depth = 16, |
| 147 | .mmal_component = COMP_CAMERA, | 147 | .mmal_component = COMP_CAMERA, |
| 148 | .ybbp = 2, | 148 | .ybbp = 2, |
| 149 | .remove_padding = 0, | 149 | .remove_padding = false, |
| 150 | }, { | 150 | }, { |
| 151 | .fourcc = V4L2_PIX_FMT_NV12, | 151 | .fourcc = V4L2_PIX_FMT_NV12, |
| 152 | .mmal = MMAL_ENCODING_NV12, | 152 | .mmal = MMAL_ENCODING_NV12, |
| 153 | .depth = 12, | 153 | .depth = 12, |
| 154 | .mmal_component = COMP_CAMERA, | 154 | .mmal_component = COMP_CAMERA, |
| 155 | .ybbp = 1, | 155 | .ybbp = 1, |
| 156 | .remove_padding = 1, | 156 | .remove_padding = true, |
| 157 | }, { | 157 | }, { |
| 158 | .fourcc = V4L2_PIX_FMT_BGR24, | 158 | .fourcc = V4L2_PIX_FMT_BGR24, |
| 159 | .mmal = MMAL_ENCODING_BGR24, | 159 | .mmal = MMAL_ENCODING_BGR24, |
| 160 | .depth = 24, | 160 | .depth = 24, |
| 161 | .mmal_component = COMP_CAMERA, | 161 | .mmal_component = COMP_CAMERA, |
| 162 | .ybbp = 3, | 162 | .ybbp = 3, |
| 163 | .remove_padding = 0, | 163 | .remove_padding = false, |
| 164 | }, { | 164 | }, { |
| 165 | .fourcc = V4L2_PIX_FMT_YVU420, | 165 | .fourcc = V4L2_PIX_FMT_YVU420, |
| 166 | .mmal = MMAL_ENCODING_YV12, | 166 | .mmal = MMAL_ENCODING_YV12, |
| 167 | .depth = 12, | 167 | .depth = 12, |
| 168 | .mmal_component = COMP_CAMERA, | 168 | .mmal_component = COMP_CAMERA, |
| 169 | .ybbp = 1, | 169 | .ybbp = 1, |
| 170 | .remove_padding = 1, | 170 | .remove_padding = true, |
| 171 | }, { | 171 | }, { |
| 172 | .fourcc = V4L2_PIX_FMT_NV21, | 172 | .fourcc = V4L2_PIX_FMT_NV21, |
| 173 | .mmal = MMAL_ENCODING_NV21, | 173 | .mmal = MMAL_ENCODING_NV21, |
| 174 | .depth = 12, | 174 | .depth = 12, |
| 175 | .mmal_component = COMP_CAMERA, | 175 | .mmal_component = COMP_CAMERA, |
| 176 | .ybbp = 1, | 176 | .ybbp = 1, |
| 177 | .remove_padding = 1, | 177 | .remove_padding = true, |
| 178 | }, { | 178 | }, { |
| 179 | .fourcc = V4L2_PIX_FMT_BGR32, | 179 | .fourcc = V4L2_PIX_FMT_BGR32, |
| 180 | .mmal = MMAL_ENCODING_BGRA, | 180 | .mmal = MMAL_ENCODING_BGRA, |
| 181 | .depth = 32, | 181 | .depth = 32, |
| 182 | .mmal_component = COMP_CAMERA, | 182 | .mmal_component = COMP_CAMERA, |
| 183 | .ybbp = 4, | 183 | .ybbp = 4, |
| 184 | .remove_padding = 0, | 184 | .remove_padding = false, |
| 185 | }, | 185 | }, |
| 186 | }; | 186 | }; |
| 187 | 187 | ||
| @@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev, · 959 unmodified lines | |||
| 1147 | struct vchiq_mmal_port *port = NULL, *camera_port = NULL; | 1147 | struct vchiq_mmal_port *port = NULL, *camera_port = NULL; |
| 1148 | struct vchiq_mmal_component *encode_component = NULL; | 1148 | struct vchiq_mmal_component *encode_component = NULL; |
| 1149 | struct mmal_fmt *mfmt = get_format(f); | 1149 | struct mmal_fmt *mfmt = get_format(f); |
| 1150 | u32 remove_padding; | 1150 | bool remove_padding; |
| 1151 | 1151 | ||
| 1152 | if (!mfmt) | 1152 | if (!mfmt) |
| 1153 | return -EINVAL; | 1153 | return -EINVAL; |
| @@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance, · 862 unmodified lines | |||
| 863 | goto release_msg; | 863 | goto release_msg; |
| 864 | 864 | ||
| 865 | if (rmsg->u.port_info_get_reply.port.is_enabled == 0) | 865 | if (rmsg->u.port_info_get_reply.port.is_enabled == 0) |
| 866 | port->enabled = 0; | 866 | port->enabled = false; |
| 867 | else | 867 | else |
| 868 | port->enabled = 1; | 868 | port->enabled = true; |
| 869 | 869 | ||
| 870 | /* copy the values out of the message */ | 870 | /* copy the values out of the message */ |
| 871 | port->handle = rmsg->u.port_info_get_reply.port_handle; | 871 | port->handle = rmsg->u.port_info_get_reply.port_handle; |
| @@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance, · 432 unmodified lines | |||
| 1304 | if (!port->enabled) | 1304 | if (!port->enabled) |
| 1305 | return 0; | 1305 | return 0; |
| 1306 | 1306 | ||
| 1307 | port->enabled = 0; | 1307 | port->enabled = false; |
| 1308 | 1308 | ||
| 1309 | ret = port_action_port(instance, port, | 1309 | ret = port_action_port(instance, port, |
| 1310 | MMAL_MSG_PORT_ACTION_TYPE_DISABLE); | 1310 | MMAL_MSG_PORT_ACTION_TYPE_DISABLE); |
| @@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance, · 48 unmodified lines | |||
| 1359 | if (ret) | 1359 | if (ret) |
| 1360 | goto done; | 1360 | goto done; |
| 1361 | 1361 | ||
| 1362 | port->enabled = 1; | 1362 | port->enabled = true; |
| 1363 | 1363 | ||
| 1364 | if (port->buffer_cb) { | 1364 | if (port->buffer_cb) { |
| 1365 | /* send buffer headers to videocore */ | 1365 | /* send buffer headers to videocore */ |
| @@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, · 165 unmodified lines | |||
| 1531 | pr_err("failed disconnecting src port\n"); | 1531 | pr_err("failed disconnecting src port\n"); |
| 1532 | goto release_unlock; | 1532 | goto release_unlock; |
| 1533 | } | 1533 | } |
| 1534 | src->connected->enabled = 0; | 1534 | src->connected->enabled = false; |
| 1535 | src->connected = NULL; | 1535 | src->connected = NULL; |
| 1536 | } | 1536 | } |
| 1537 | 1537 | ||
| @@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, · 110 unmodified lines | |||
| 1648 | for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) { | 1648 | for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) { |
| 1649 | if (!instance->component[idx].in_use) { | 1649 | if (!instance->component[idx].in_use) { |
| 1650 | component = &instance->component[idx]; | 1650 | component = &instance->component[idx]; |
| 1651 | component->in_use = 1; | 1651 | component->in_use = true; |
| 1652 | break; | 1652 | break; |
| 1653 | } | 1653 | } |
| 1654 | } | 1654 | } |
| @@ -1724,7 +1724,7 @@ release_component: · 69 unmodified lines | |||
| 1724 | destroy_component(instance, component); | 1724 | destroy_component(instance, component); |
| 1725 | unlock: | 1725 | unlock: |
| 1726 | if (component) | 1726 | if (component) |
| 1727 | component->in_use = 0; | 1727 | component->in_use = false; |
| 1728 | mutex_unlock(&instance->vchiq_mutex); | 1728 | mutex_unlock(&instance->vchiq_mutex); |
| 1729 | 1729 | ||
| 1730 | return ret; | 1730 | return ret; |
| @@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, · 16 unmodified lines | |||
| 1747 | 1747 | ||
| 1748 | ret = destroy_component(instance, component); | 1748 | ret = destroy_component(instance, component); |
| 1749 | 1749 | ||
| 1750 | component->in_use = 0; | 1750 | component->in_use = false; |
| 1751 | 1751 | ||
| 1752 | mutex_unlock(&instance->vchiq_mutex); | 1752 | mutex_unlock(&instance->vchiq_mutex); |
| 1753 | 1753 | ||
| @@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance, · 45 unmodified lines | |||
| 1799 | 1799 | ||
| 1800 | ret = disable_component(instance, component); | 1800 | ret = disable_component(instance, component); |
| 1801 | if (ret == 0) | 1801 | if (ret == 0) |
| 1802 | component->enabled = 0; | 1802 | component->enabled = false; |
| 1803 | 1803 | ||
| 1804 | mutex_unlock(&instance->vchiq_mutex); | 1804 | mutex_unlock(&instance->vchiq_mutex); |
| 1805 | 1805 | ||
| @@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)( · 47 unmodified lines | |||
| 48 | int status, struct mmal_buffer *buffer); | 48 | int status, struct mmal_buffer *buffer); |
| 49 | 49 | ||
| 50 | struct vchiq_mmal_port { | 50 | struct vchiq_mmal_port { |
| 51 | u32 enabled:1; | 51 | bool enabled; |
| 52 | u32 handle; | 52 | u32 handle; |
| 53 | u32 type; /* port type, cached to use on port info set */ | 53 | u32 type; /* port type, cached to use on port info set */ |
| 54 | u32 index; /* port index, cached to use on port info set */ | 54 | u32 index; /* port index, cached to use on port info set */ |
| @@ -82,8 +82,8 @@ struct vchiq_mmal_port { · 27 unmodified lines | |||
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | struct vchiq_mmal_component { | 84 | struct vchiq_mmal_component { |
| 85 | u32 in_use:1; | 85 | bool in_use; |
| 86 | u32 enabled:1; | 86 | bool enabled; |
| 87 | u32 handle; /* VideoCore handle for component */ | 87 | u32 handle; /* VideoCore handle for component */ |
| 88 | u32 inputs; /* Number of input ports */ | 88 | u32 inputs; /* Number of input ports */ |
| 89 | u32 outputs; /* Number of output ports */ | 89 | u32 outputs; /* Number of output ports */ |
| @@ -27,7 +27,6 @@ enum vme_resource_type { · 26 unmodified lines | |||
| 27 | #define VME_A64_MAX 0x10000000000000000ULL | 27 | #define VME_A64_MAX 0x10000000000000000ULL |
| 28 | #define VME_CRCSR_MAX 0x1000000ULL | 28 | #define VME_CRCSR_MAX 0x1000000ULL |
| 29 | 29 | ||
| 30 | |||
| 31 | /* VME Cycle Types */ | 30 | /* VME Cycle Types */ |
| 32 | #define VME_SCT 0x1 | 31 | #define VME_SCT 0x1 |
| 33 | #define VME_BLT 0x2 | 32 | #define VME_BLT 0x2 |
| @@ -185,6 +184,5 @@ int vme_bus_num(struct vme_dev *); · 151 unmodified lines | |||
| 185 | int vme_register_driver(struct vme_driver *, unsigned int); | 184 | int vme_register_driver(struct vme_driver *, unsigned int); |
| 186 | void vme_unregister_driver(struct vme_driver *); | 185 | void vme_unregister_driver(struct vme_driver *); |
| 187 | 186 | ||
| 188 | |||
| 189 | #endif /* _VME_H_ */ | 187 | #endif /* _VME_H_ */ |
| 190 | 188 | ||
| @@ -356,7 +356,6 @@ static int __fake_master_get(struct vme_master_resource *image, int *enabled, · 355 unmodified lines | |||
| 356 | return 0; | 356 | return 0; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | |||
| 360 | static int fake_master_get(struct vme_master_resource *image, int *enabled, | 359 | static int fake_master_get(struct vme_master_resource *image, int *enabled, |
| 361 | unsigned long long *vme_base, unsigned long long *size, | 360 | unsigned long long *vme_base, unsigned long long *size, |
| 362 | u32 *aspace, u32 *cycle, u32 *dwidth) | 361 | u32 *aspace, u32 *cycle, u32 *dwidth) |
| @@ -373,7 +372,6 @@ static int fake_master_get(struct vme_master_resource *image, int *enabled, · 10 unmodified lines | |||
| 373 | return retval; | 372 | return retval; |
| 374 | } | 373 | } |
| 375 | 374 | ||
| 376 | |||
| 377 | static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, | 375 | static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, |
| 378 | u32 aspace, u32 cycle) | 376 | u32 aspace, u32 cycle) |
| 379 | { | 377 | { |
| @@ -1060,7 +1058,6 @@ static void fake_crcsr_exit(struct vme_bridge *fake_bridge) · 680 unmodified lines | |||
| 1060 | kfree(bridge->crcsr_kernel); | 1058 | kfree(bridge->crcsr_kernel); |
| 1061 | } | 1059 | } |
| 1062 | 1060 | ||
| 1063 | |||
| 1064 | static int __init fake_init(void) | 1061 | static int __init fake_init(void) |
| 1065 | { | 1062 | { |
| 1066 | int retval, i; | 1063 | int retval, i; |
| @@ -1072,7 +1069,9 @@ static int __init fake_init(void) · 5 unmodified lines | |||
| 1072 | struct vme_lm_resource *lm; | 1069 | struct vme_lm_resource *lm; |
| 1073 | 1070 | ||
| 1074 | /* We need a fake parent device */ | 1071 | /* We need a fake parent device */ |
| 1075 | vme_root = __root_device_register("vme", THIS_MODULE); | 1072 | vme_root = root_device_register("vme"); |
| 1073 | if (IS_ERR(vme_root)) | ||
| 1074 | return PTR_ERR(vme_root); | ||
| 1076 | 1075 | ||
| 1077 | /* If we want to support more than one bridge at some point, we need to | 1076 | /* If we want to support more than one bridge at some point, we need to |
| 1078 | * dynamically allocate this so we get one per device. | 1077 | * dynamically allocate this so we get one per device. |
| @@ -1238,7 +1237,6 @@ err_struct: · 159 unmodified lines | |||
| 1238 | 1237 | ||
| 1239 | } | 1238 | } |
| 1240 | 1239 | ||
| 1241 | |||
| 1242 | static void __exit fake_exit(void) | 1240 | static void __exit fake_exit(void) |
| 1243 | { | 1241 | { |
| 1244 | struct list_head *pos = NULL; | 1242 | struct list_head *pos = NULL; |
| @@ -1294,7 +1292,6 @@ static void __exit fake_exit(void) · 49 unmodified lines | |||
| 1294 | root_device_unregister(vme_root); | 1292 | root_device_unregister(vme_root); |
| 1295 | } | 1293 | } |
| 1296 | 1294 | ||
| 1297 | |||
| 1298 | MODULE_PARM_DESC(geoid, "Set geographical addressing"); | 1295 | MODULE_PARM_DESC(geoid, "Set geographical addressing"); |
| 1299 | module_param(geoid, int, 0); | 1296 | module_param(geoid, int, 0); |
| 1300 | 1297 | ||
| @@ -34,7 +34,6 @@ · 33 unmodified lines | |||
| 34 | static int tsi148_probe(struct pci_dev *, const struct pci_device_id *); | 34 | static int tsi148_probe(struct pci_dev *, const struct pci_device_id *); |
| 35 | static void tsi148_remove(struct pci_dev *); | 35 | static void tsi148_remove(struct pci_dev *); |
| 36 | 36 | ||
| 37 | |||
| 38 | /* Module parameter */ | 37 | /* Module parameter */ |
| 39 | static bool err_chk; | 38 | static bool err_chk; |
| 40 | static int geoid; | 39 | static int geoid; |
| @@ -673,7 +672,6 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled, · 632 unmodified lines | |||
| 673 | /* Need granularity before we set the size */ | 672 | /* Need granularity before we set the size */ |
| 674 | *size = (unsigned long long)((vme_bound - *vme_base) + granularity); | 673 | *size = (unsigned long long)((vme_bound - *vme_base) + granularity); |
| 675 | 674 | ||
| 676 | |||
| 677 | if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160) | 675 | if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160) |
| 678 | *cycle |= VME_2eSST160; | 676 | *cycle |= VME_2eSST160; |
| 679 | if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267) | 677 | if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267) |
| @@ -1142,7 +1140,6 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled, · 462 unmodified lines | |||
| 1142 | return 0; | 1140 | return 0; |
| 1143 | } | 1141 | } |
| 1144 | 1142 | ||
| 1145 | |||
| 1146 | static int tsi148_master_get(struct vme_master_resource *image, int *enabled, | 1143 | static int tsi148_master_get(struct vme_master_resource *image, int *enabled, |
| 1147 | unsigned long long *vme_base, unsigned long long *size, u32 *aspace, | 1144 | unsigned long long *vme_base, unsigned long long *size, u32 *aspace, |
| 1148 | u32 *cycle, u32 *dwidth) | 1145 | u32 *cycle, u32 *dwidth) |
| @@ -1244,7 +1241,6 @@ out: · 95 unmodified lines | |||
| 1244 | return retval; | 1241 | return retval; |
| 1245 | } | 1242 | } |
| 1246 | 1243 | ||
| 1247 | |||
| 1248 | static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf, | 1244 | static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf, |
| 1249 | size_t count, loff_t offset) | 1245 | size_t count, loff_t offset) |
| 1250 | { | 1246 | { |
| @@ -1751,6 +1747,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list, · 500 unmodified lines | |||
| 1751 | return 0; | 1747 | return 0; |
| 1752 | 1748 | ||
| 1753 | err_dma: | 1749 | err_dma: |
| 1750 | list_del(&entry->list); | ||
| 1754 | err_dest: | 1751 | err_dest: |
| 1755 | err_source: | 1752 | err_source: |
| 1756 | err_align: | 1753 | err_align: |
| @@ -1999,7 +1996,6 @@ static int tsi148_lm_get(struct vme_lm_resource *lm, · 242 unmodified lines | |||
| 1999 | if ((lm_ctl & TSI148_LCSR_LMAT_AS_M) == TSI148_LCSR_LMAT_AS_A64) | 1996 | if ((lm_ctl & TSI148_LCSR_LMAT_AS_M) == TSI148_LCSR_LMAT_AS_A64) |
| 2000 | *aspace |= VME_A64; | 1997 | *aspace |= VME_A64; |
| 2001 | 1998 | ||
| 2002 | |||
| 2003 | if (lm_ctl & TSI148_LCSR_LMAT_SUPR) | 1999 | if (lm_ctl & TSI148_LCSR_LMAT_SUPR) |
| 2004 | *cycle |= VME_SUPER; | 2000 | *cycle |= VME_SUPER; |
| 2005 | if (lm_ctl & TSI148_LCSR_LMAT_NPRIV) | 2001 | if (lm_ctl & TSI148_LCSR_LMAT_NPRIV) |
| @@ -2550,7 +2546,6 @@ static void tsi148_remove(struct pci_dev *pdev) · 544 unmodified lines | |||
| 2550 | 2546 | ||
| 2551 | bridge = tsi148_bridge->driver_priv; | 2547 | bridge = tsi148_bridge->driver_priv; |
| 2552 | 2548 | ||
| 2553 | |||
| 2554 | dev_dbg(&pdev->dev, "Driver is being unloaded.\n"); | 2549 | dev_dbg(&pdev->dev, "Driver is being unloaded.\n"); |
| 2555 | 2550 | ||
| 2556 | /* | 2551 | /* |
| @@ -87,7 +87,6 @@ struct tsi148_dma_entry { · 86 unmodified lines | |||
| 87 | * Control and Status Registers | 87 | * Control and Status Registers |
| 88 | */ | 88 | */ |
| 89 | 89 | ||
| 90 | |||
| 91 | /* | 90 | /* |
| 92 | * Command/Status Registers (CRG + $004) | 91 | * Command/Status Registers (CRG + $004) |
| 93 | */ | 92 | */ |
| @@ -342,7 +341,6 @@ static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1, · 248 unmodified lines | |||
| 342 | #define TSI148_LCSR_IT7_ITOFL 0x3F4 | 341 | #define TSI148_LCSR_IT7_ITOFL 0x3F4 |
| 343 | #define TSI148_LCSR_IT7_ITAT 0x3F8 | 342 | #define TSI148_LCSR_IT7_ITAT 0x3F8 |
| 344 | 343 | ||
| 345 | |||
| 346 | #define TSI148_LCSR_IT0 0x300 | 344 | #define TSI148_LCSR_IT0 0x300 |
| 347 | #define TSI148_LCSR_IT1 0x320 | 345 | #define TSI148_LCSR_IT1 0x320 |
| 348 | #define TSI148_LCSR_IT2 0x340 | 346 | #define TSI148_LCSR_IT2 0x340 |
| @@ -464,7 +462,6 @@ static const int TSI148_LCSR_IT[8] = { TSI148_LCSR_IT0, TSI148_LCSR_IT1, · 115 unmodified lines | |||
| 464 | #define TSI148_LCSR_DMA0 0x500 | 462 | #define TSI148_LCSR_DMA0 0x500 |
| 465 | #define TSI148_LCSR_DMA1 0x580 | 463 | #define TSI148_LCSR_DMA1 0x580 |
| 466 | 464 | ||
| 467 | |||
| 468 | static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0, | 465 | static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0, |
| 469 | TSI148_LCSR_DMA1 }; | 466 | TSI148_LCSR_DMA1 }; |
| 470 | 467 | ||
| @@ -532,9 +529,6 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, · 61 unmodified lines | |||
| 532 | #define TSI148_CSRBSR 0xFF8 | 529 | #define TSI148_CSRBSR 0xFF8 |
| 533 | #define TSI148_CBAR 0xFFC | 530 | #define TSI148_CBAR 0xFFC |
| 534 | 531 | ||
| 535 | |||
| 536 | |||
| 537 | |||
| 538 | /* | 532 | /* |
| 539 | * TSI148 Register Bit Definitions | 533 | * TSI148 Register Bit Definitions |
| 540 | */ | 534 | */ |
| @@ -828,7 +822,6 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, · 287 unmodified lines | |||
| 828 | #define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */ | 822 | #define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */ |
| 829 | #define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */ | 823 | #define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */ |
| 830 | 824 | ||
| 831 | |||
| 832 | /* | 825 | /* |
| 833 | * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280 | 826 | * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280 |
| 834 | */ | 827 | */ |
| @@ -54,17 +54,17 @@ · 53 unmodified lines | |||
| 54 | */ | 54 | */ |
| 55 | #define CRITICAL_PACKET_LEN 256 | 55 | #define CRITICAL_PACKET_LEN 256 |
| 56 | 56 | ||
| 57 | static const unsigned short wTimeStampOff[2][MAX_RATE] = { | 57 | static const unsigned short time_stamp_off[2][MAX_RATE] = { |
| 58 | {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, /* Long Preamble */ | 58 | {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, /* Long Preamble */ |
| 59 | {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, /* Short Preamble */ | 59 | {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, /* Short Preamble */ |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | static const unsigned short wFB_Opt0[2][5] = { | 62 | static const unsigned short fb_opt0[2][5] = { |
| 63 | {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */ | 63 | {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */ |
| 64 | {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */ | 64 | {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */ |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | static const unsigned short wFB_Opt1[2][5] = { | 67 | static const unsigned short fb_opt1[2][5] = { |
| 68 | {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */ | 68 | {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */ |
| 69 | {RATE_6M, RATE_6M, RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */ | 69 | {RATE_6M, RATE_6M, RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */ |
| 70 | }; | 70 | }; |
| @@ -142,7 +142,7 @@ s_uFillDataHead( · 71 unmodified lines | |||
| 142 | 142 | ||
| 143 | static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate) | 143 | static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate) |
| 144 | { | 144 | { |
| 145 | return cpu_to_le16(wTimeStampOff[priv->preamble_type % 2] | 145 | return cpu_to_le16(time_stamp_off[priv->preamble_type % 2] |
| 146 | [rate % MAX_RATE]); | 146 | [rate % MAX_RATE]); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| @@ -310,9 +310,9 @@ s_uGetDataDuration( · 161 unmodified lines | |||
| 310 | wRate -= RATE_18M; | 310 | wRate -= RATE_18M; |
| 311 | 311 | ||
| 312 | if (byFBOption == AUTO_FB_0) | 312 | if (byFBOption == AUTO_FB_0) |
| 313 | wRate = wFB_Opt0[FB_RATE0][wRate]; | 313 | wRate = fb_opt0[FB_RATE0][wRate]; |
| 314 | else | 314 | else |
| 315 | wRate = wFB_Opt1[FB_RATE0][wRate]; | 315 | wRate = fb_opt1[FB_RATE0][wRate]; |
| 316 | 316 | ||
| 317 | uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, | 317 | uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, |
| 318 | len, wRate, bNeedAck); | 318 | len, wRate, bNeedAck); |
| @@ -365,52 +365,52 @@ s_uGetRTSCTSDuration( · 46 unmodified lines | |||
| 365 | case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */ | 365 | case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */ |
| 366 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); | 366 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); |
| 367 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 367 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 368 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); | 368 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 369 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 369 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 370 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); | 370 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 371 | 371 | ||
| 372 | break; | 372 | break; |
| 373 | 373 | ||
| 374 | case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */ | 374 | case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */ |
| 375 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); | 375 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); |
| 376 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 376 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 377 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); | 377 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 378 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 378 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 379 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); | 379 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 380 | 380 | ||
| 381 | break; | 381 | break; |
| 382 | 382 | ||
| 383 | case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */ | 383 | case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */ |
| 384 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); | 384 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); |
| 385 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 385 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 386 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); | 386 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 387 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 387 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 388 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); | 388 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 389 | 389 | ||
| 390 | break; | 390 | break; |
| 391 | 391 | ||
| 392 | case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */ | 392 | case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */ |
| 393 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); | 393 | uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); |
| 394 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 394 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 395 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); | 395 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 396 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 396 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 397 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); | 397 | uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 398 | 398 | ||
| 399 | break; | 399 | break; |
| 400 | 400 | ||
| 401 | case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */ | 401 | case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */ |
| 402 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 402 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 403 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); | 403 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 404 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 404 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 405 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); | 405 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); |
| 406 | 406 | ||
| 407 | break; | 407 | break; |
| 408 | 408 | ||
| 409 | case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */ | 409 | case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */ |
| 410 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 410 | if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 411 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); | 411 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 412 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) | 412 | else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) |
| 413 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); | 413 | uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); |
| 414 | 414 | ||
| 415 | break; | 415 | break; |
| 416 | 416 | ||
| @@ -0,0 +1,16 @@ | |||
| 1 | To-do list: | ||
| 2 | |||
| 3 | * Correct the coding style according to Linux guidelines; please read the document | ||
| 4 | at https://www.kernel.org/doc/html/latest/process/coding-style.html. | ||
| 5 | * Remove unnecessary debugging/printing macros; for those that are still needed | ||
| 6 | use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). | ||
| 7 | * Remove dead code such as unusued functions, variables, fields, etc.. | ||
| 8 | * Use in-kernel API and remove unnecessary wrappers where possible. | ||
| 9 | * Fix bugs due to code that sleeps in atomic context. | ||
| 10 | * Remove the HAL layer and migrate its functionality into the relevant parts of | ||
| 11 | the driver. | ||
| 12 | * Switch to use LIB80211. | ||
| 13 | * Switch to use MAC80211. | ||
| 14 | * Switch to use CFG80211. | ||
| 15 | * Improve the error handling of various functions, particularly those that use | ||
| 16 | existing kernel APIs. | ||
| @@ -217,305 +217,4 @@ · 216 unmodified lines | |||
| 217 | #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6) | 217 | #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6) |
| 218 | #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7) | 218 | #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7) |
| 219 | 219 | ||
| 220 | /*-- Information Element Types --------------------*/ | ||
| 221 | /* prototype structure, all IEs start with these members */ | ||
| 222 | |||
| 223 | struct wlan_ie { | ||
| 224 | u8 eid; | ||
| 225 | u8 len; | ||
| 226 | } __packed; | ||
| 227 | |||
| 228 | /*-- Service Set Identity (SSID) -----------------*/ | ||
| 229 | struct wlan_ie_ssid { | ||
| 230 | u8 eid; | ||
| 231 | u8 len; | ||
| 232 | u8 ssid[1]; /* may be zero, ptrs may overlap */ | ||
| 233 | } __packed; | ||
| 234 | |||
| 235 | /*-- Supported Rates -----------------------------*/ | ||
| 236 | struct wlan_ie_supp_rates { | ||
| 237 | u8 eid; | ||
| 238 | u8 len; | ||
| 239 | u8 rates[1]; /* had better be at LEAST one! */ | ||
| 240 | } __packed; | ||
| 241 | |||
| 242 | /*-- FH Parameter Set ----------------------------*/ | ||
| 243 | struct wlan_ie_fh_parms { | ||
| 244 | u8 eid; | ||
| 245 | u8 len; | ||
| 246 | u16 dwell; | ||
| 247 | u8 hopset; | ||
| 248 | u8 hoppattern; | ||
| 249 | u8 hopindex; | ||
| 250 | } __packed; | ||
| 251 | |||
| 252 | /*-- DS Parameter Set ----------------------------*/ | ||
| 253 | struct wlan_ie_ds_parms { | ||
| 254 | u8 eid; | ||
| 255 | u8 len; | ||
| 256 | u8 curr_ch; | ||
| 257 | } __packed; | ||
| 258 | |||
| 259 | /*-- CF Parameter Set ----------------------------*/ | ||
| 260 | |||
| 261 | struct wlan_ie_cf_parms { | ||
| 262 | u8 eid; | ||
| 263 | u8 len; | ||
| 264 | u8 cfp_cnt; | ||
| 265 | u8 cfp_period; | ||
| 266 | u16 cfp_maxdur; | ||
| 267 | u16 cfp_durremaining; | ||
| 268 | } __packed; | ||
| 269 | |||
| 270 | /*-- TIM ------------------------------------------*/ | ||
| 271 | struct wlan_ie_tim { | ||
| 272 | u8 eid; | ||
| 273 | u8 len; | ||
| 274 | u8 dtim_cnt; | ||
| 275 | u8 dtim_period; | ||
| 276 | u8 bitmap_ctl; | ||
| 277 | u8 virt_bm[1]; | ||
| 278 | } __packed; | ||
| 279 | |||
| 280 | /*-- IBSS Parameter Set ---------------------------*/ | ||
| 281 | struct wlan_ie_ibss_parms { | ||
| 282 | u8 eid; | ||
| 283 | u8 len; | ||
| 284 | u16 atim_win; | ||
| 285 | } __packed; | ||
| 286 | |||
| 287 | /*-- Challenge Text ------------------------------*/ | ||
| 288 | struct wlan_ie_challenge { | ||
| 289 | u8 eid; | ||
| 290 | u8 len; | ||
| 291 | u8 challenge[1]; | ||
| 292 | } __packed; | ||
| 293 | |||
| 294 | /*-------------------------------------------------*/ | ||
| 295 | /* Frame Types */ | ||
| 296 | |||
| 297 | /* prototype structure, all mgmt frame types will start with these members */ | ||
| 298 | struct wlan_fr_mgmt { | ||
| 299 | u16 type; | ||
| 300 | u16 len; /* DOES NOT include CRC !!!! */ | ||
| 301 | u8 *buf; | ||
| 302 | struct p80211_hdr *hdr; | ||
| 303 | /* used for target specific data, skb in Linux */ | ||
| 304 | void *priv; | ||
| 305 | /*-- fixed fields -----------*/ | ||
| 306 | /*-- info elements ----------*/ | ||
| 307 | }; | ||
| 308 | |||
| 309 | /*-- Beacon ---------------------------------------*/ | ||
| 310 | struct wlan_fr_beacon { | ||
| 311 | u16 type; | ||
| 312 | u16 len; | ||
| 313 | u8 *buf; | ||
| 314 | struct p80211_hdr *hdr; | ||
| 315 | /* used for target specific data, skb in Linux */ | ||
| 316 | void *priv; | ||
| 317 | /*-- fixed fields -----------*/ | ||
| 318 | u64 *ts; | ||
| 319 | u16 *bcn_int; | ||
| 320 | u16 *cap_info; | ||
| 321 | /*-- info elements ----------*/ | ||
| 322 | struct wlan_ie_ssid *ssid; | ||
| 323 | struct wlan_ie_supp_rates *supp_rates; | ||
| 324 | struct wlan_ie_fh_parms *fh_parms; | ||
| 325 | struct wlan_ie_ds_parms *ds_parms; | ||
| 326 | struct wlan_ie_cf_parms *cf_parms; | ||
| 327 | struct wlan_ie_ibss_parms *ibss_parms; | ||
| 328 | struct wlan_ie_tim *tim; | ||
| 329 | |||
| 330 | }; | ||
| 331 | |||
| 332 | /*-- IBSS ATIM ------------------------------------*/ | ||
| 333 | struct wlan_fr_ibssatim { | ||
| 334 | u16 type; | ||
| 335 | u16 len; | ||
| 336 | u8 *buf; | ||
| 337 | struct p80211_hdr *hdr; | ||
| 338 | /* used for target specific data, skb in Linux */ | ||
| 339 | void *priv; | ||
| 340 | |||
| 341 | /*-- fixed fields -----------*/ | ||
| 342 | /*-- info elements ----------*/ | ||
| 343 | |||
| 344 | /* this frame type has a null body */ | ||
| 345 | |||
| 346 | }; | ||
| 347 | |||
| 348 | /*-- Disassociation -------------------------------*/ | ||
| 349 | struct wlan_fr_disassoc { | ||
| 350 | u16 type; | ||
| 351 | u16 len; | ||
| 352 | u8 *buf; | ||
| 353 | struct p80211_hdr *hdr; | ||
| 354 | /* used for target specific data, skb in Linux */ | ||
| 355 | void *priv; | ||
| 356 | /*-- fixed fields -----------*/ | ||
| 357 | u16 *reason; | ||
| 358 | |||
| 359 | /*-- info elements ----------*/ | ||
| 360 | |||
| 361 | }; | ||
| 362 | |||
| 363 | /*-- Association Request --------------------------*/ | ||
| 364 | struct wlan_fr_assocreq { | ||
| 365 | u16 type; | ||
| 366 | u16 len; | ||
| 367 | u8 *buf; | ||
| 368 | struct p80211_hdr *hdr; | ||
| 369 | /* used for target specific data, skb in Linux */ | ||
| 370 | void *priv; | ||
| 371 | /*-- fixed fields -----------*/ | ||
| 372 | u16 *cap_info; | ||
| 373 | u16 *listen_int; | ||
| 374 | /*-- info elements ----------*/ | ||
| 375 | struct wlan_ie_ssid *ssid; | ||
| 376 | struct wlan_ie_supp_rates *supp_rates; | ||
| 377 | |||
| 378 | }; | ||
| 379 | |||
| 380 | /*-- Association Response -------------------------*/ | ||
| 381 | struct wlan_fr_assocresp { | ||
| 382 | u16 type; | ||
| 383 | u16 len; | ||
| 384 | u8 *buf; | ||
| 385 | struct p80211_hdr *hdr; | ||
| 386 | /* used for target specific data, skb in Linux */ | ||
| 387 | void *priv; | ||
| 388 | /*-- fixed fields -----------*/ | ||
| 389 | u16 *cap_info; | ||
| 390 | u16 *status; | ||
| 391 | u16 *aid; | ||
| 392 | /*-- info elements ----------*/ | ||
| 393 | struct wlan_ie_supp_rates *supp_rates; | ||
| 394 | |||
| 395 | }; | ||
| 396 | |||
| 397 | /*-- Reassociation Request ------------------------*/ | ||
| 398 | struct wlan_fr_reassocreq { | ||
| 399 | u16 type; | ||
| 400 | u16 len; | ||
| 401 | u8 *buf; | ||
| 402 | struct p80211_hdr *hdr; | ||
| 403 | /* used for target specific data, skb in Linux */ | ||
| 404 | void *priv; | ||
| 405 | /*-- fixed fields -----------*/ | ||
| 406 | u16 *cap_info; | ||
| 407 | u16 *listen_int; | ||
| 408 | u8 *curr_ap; | ||
| 409 | /*-- info elements ----------*/ | ||
| 410 | struct wlan_ie_ssid *ssid; | ||
| 411 | struct wlan_ie_supp_rates *supp_rates; | ||
| 412 | |||
| 413 | }; | ||
| 414 | |||
| 415 | /*-- Reassociation Response -----------------------*/ | ||
| 416 | struct wlan_fr_reassocresp { | ||
| 417 | u16 type; | ||
| 418 | u16 len; | ||
| 419 | u8 *buf; | ||
| 420 | struct p80211_hdr *hdr; | ||
| 421 | /* used for target specific data, skb in Linux */ | ||
| 422 | void *priv; | ||
| 423 | /*-- fixed fields -----------*/ | ||
| 424 | u16 *cap_info; | ||
| 425 | u16 *status; | ||
| 426 | u16 *aid; | ||
| 427 | /*-- info elements ----------*/ | ||
| 428 | struct wlan_ie_supp_rates *supp_rates; | ||
| 429 | |||
| 430 | }; | ||
| 431 | |||
| 432 | /*-- Probe Request --------------------------------*/ | ||
| 433 | struct wlan_fr_probereq { | ||
| 434 | u16 type; | ||
| 435 | u16 len; | ||
| 436 | u8 *buf; | ||
| 437 | struct p80211_hdr *hdr; | ||
| 438 | /* used for target specific data, skb in Linux */ | ||
| 439 | void *priv; | ||
| 440 | /*-- fixed fields -----------*/ | ||
| 441 | /*-- info elements ----------*/ | ||
| 442 | struct wlan_ie_ssid *ssid; | ||
| 443 | struct wlan_ie_supp_rates *supp_rates; | ||
| 444 | |||
| 445 | }; | ||
| 446 | |||
| 447 | /*-- Probe Response -------------------------------*/ | ||
| 448 | struct wlan_fr_proberesp { | ||
| 449 | u16 type; | ||
| 450 | u16 len; | ||
| 451 | u8 *buf; | ||
| 452 | struct p80211_hdr *hdr; | ||
| 453 | /* used for target specific data, skb in Linux */ | ||
| 454 | void *priv; | ||
| 455 | /*-- fixed fields -----------*/ | ||
| 456 | u64 *ts; | ||
| 457 | u16 *bcn_int; | ||
| 458 | u16 *cap_info; | ||
| 459 | /*-- info elements ----------*/ | ||
| 460 | struct wlan_ie_ssid *ssid; | ||
| 461 | struct wlan_ie_supp_rates *supp_rates; | ||
| 462 | struct wlan_ie_fh_parms *fh_parms; | ||
| 463 | struct wlan_ie_ds_parms *ds_parms; | ||
| 464 | struct wlan_ie_cf_parms *cf_parms; | ||
| 465 | struct wlan_ie_ibss_parms *ibss_parms; | ||
| 466 | }; | ||
| 467 | |||
| 468 | /*-- Authentication -------------------------------*/ | ||
| 469 | struct wlan_fr_authen { | ||
| 470 | u16 type; | ||
| 471 | u16 len; | ||
| 472 | u8 *buf; | ||
| 473 | struct p80211_hdr *hdr; | ||
| 474 | /* used for target specific data, skb in Linux */ | ||
| 475 | void *priv; | ||
| 476 | /*-- fixed fields -----------*/ | ||
| 477 | u16 *auth_alg; | ||
| 478 | u16 *auth_seq; | ||
| 479 | u16 *status; | ||
| 480 | /*-- info elements ----------*/ | ||
| 481 | struct wlan_ie_challenge *challenge; | ||
| 482 | |||
| 483 | }; | ||
| 484 | |||
| 485 | /*-- Deauthenication -----------------------------*/ | ||
| 486 | struct wlan_fr_deauthen { | ||
| 487 | u16 type; | ||
| 488 | u16 len; | ||
| 489 | u8 *buf; | ||
| 490 | struct p80211_hdr *hdr; | ||
| 491 | /* used for target specific data, skb in Linux */ | ||
| 492 | void *priv; | ||
| 493 | /*-- fixed fields -----------*/ | ||
| 494 | u16 *reason; | ||
| 495 | |||
| 496 | /*-- info elements ----------*/ | ||
| 497 | |||
| 498 | }; | ||
| 499 | |||
| 500 | void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f); | ||
| 501 | void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f); | ||
| 502 | void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f); | ||
| 503 | void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f); | ||
| 504 | void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f); | ||
| 505 | void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f); | ||
| 506 | void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f); | ||
| 507 | void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f); | ||
| 508 | void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f); | ||
| 509 | void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f); | ||
| 510 | void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f); | ||
| 511 | void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f); | ||
| 512 | void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f); | ||
| 513 | void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f); | ||
| 514 | void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f); | ||
| 515 | void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f); | ||
| 516 | void wlan_mgmt_encode_authen(struct wlan_fr_authen *f); | ||
| 517 | void wlan_mgmt_decode_authen(struct wlan_fr_authen *f); | ||
| 518 | void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f); | ||
| 519 | void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f); | ||
| 520 | |||
| 521 | #endif /* _P80211MGMT_H */ | 220 | #endif /* _P80211MGMT_H */ |
| @@ -881,55 +881,42 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 880 unmodified lines | |||
| 881 | wlandev->rx.mgmt++; | 881 | wlandev->rx.mgmt++; |
| 882 | switch (fstype) { | 882 | switch (fstype) { |
| 883 | case WLAN_FSTYPE_ASSOCREQ: | 883 | case WLAN_FSTYPE_ASSOCREQ: |
| 884 | /* printk("assocreq"); */ | ||
| 885 | wlandev->rx.assocreq++; | 884 | wlandev->rx.assocreq++; |
| 886 | break; | 885 | break; |
| 887 | case WLAN_FSTYPE_ASSOCRESP: | 886 | case WLAN_FSTYPE_ASSOCRESP: |
| 888 | /* printk("assocresp"); */ | ||
| 889 | wlandev->rx.assocresp++; | 887 | wlandev->rx.assocresp++; |
| 890 | break; | 888 | break; |
| 891 | case WLAN_FSTYPE_REASSOCREQ: | 889 | case WLAN_FSTYPE_REASSOCREQ: |
| 892 | /* printk("reassocreq"); */ | ||
| 893 | wlandev->rx.reassocreq++; | 890 | wlandev->rx.reassocreq++; |
| 894 | break; | 891 | break; |
| 895 | case WLAN_FSTYPE_REASSOCRESP: | 892 | case WLAN_FSTYPE_REASSOCRESP: |
| 896 | /* printk("reassocresp"); */ | ||
| 897 | wlandev->rx.reassocresp++; | 893 | wlandev->rx.reassocresp++; |
| 898 | break; | 894 | break; |
| 899 | case WLAN_FSTYPE_PROBEREQ: | 895 | case WLAN_FSTYPE_PROBEREQ: |
| 900 | /* printk("probereq"); */ | ||
| 901 | wlandev->rx.probereq++; | 896 | wlandev->rx.probereq++; |
| 902 | break; | 897 | break; |
| 903 | case WLAN_FSTYPE_PROBERESP: | 898 | case WLAN_FSTYPE_PROBERESP: |
| 904 | /* printk("proberesp"); */ | ||
| 905 | wlandev->rx.proberesp++; | 899 | wlandev->rx.proberesp++; |
| 906 | break; | 900 | break; |
| 907 | case WLAN_FSTYPE_BEACON: | 901 | case WLAN_FSTYPE_BEACON: |
| 908 | /* printk("beacon"); */ | ||
| 909 | wlandev->rx.beacon++; | 902 | wlandev->rx.beacon++; |
| 910 | break; | 903 | break; |
| 911 | case WLAN_FSTYPE_ATIM: | 904 | case WLAN_FSTYPE_ATIM: |
| 912 | /* printk("atim"); */ | ||
| 913 | wlandev->rx.atim++; | 905 | wlandev->rx.atim++; |
| 914 | break; | 906 | break; |
| 915 | case WLAN_FSTYPE_DISASSOC: | 907 | case WLAN_FSTYPE_DISASSOC: |
| 916 | /* printk("disassoc"); */ | ||
| 917 | wlandev->rx.disassoc++; | 908 | wlandev->rx.disassoc++; |
| 918 | break; | 909 | break; |
| 919 | case WLAN_FSTYPE_AUTHEN: | 910 | case WLAN_FSTYPE_AUTHEN: |
| 920 | /* printk("authen"); */ | ||
| 921 | wlandev->rx.authen++; | 911 | wlandev->rx.authen++; |
| 922 | break; | 912 | break; |
| 923 | case WLAN_FSTYPE_DEAUTHEN: | 913 | case WLAN_FSTYPE_DEAUTHEN: |
| 924 | /* printk("deauthen"); */ | ||
| 925 | wlandev->rx.deauthen++; | 914 | wlandev->rx.deauthen++; |
| 926 | break; | 915 | break; |
| 927 | default: | 916 | default: |
| 928 | /* printk("unknown"); */ | ||
| 929 | wlandev->rx.mgmt_unknown++; | 917 | wlandev->rx.mgmt_unknown++; |
| 930 | break; | 918 | break; |
| 931 | } | 919 | } |
| 932 | /* printk("\n"); */ | ||
| 933 | drop = 2; | 920 | drop = 2; |
| 934 | break; | 921 | break; |
| 935 | 922 | ||
| @@ -943,35 +930,27 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 7 unmodified lines | |||
| 943 | wlandev->rx.ctl++; | 930 | wlandev->rx.ctl++; |
| 944 | switch (fstype) { | 931 | switch (fstype) { |
| 945 | case WLAN_FSTYPE_PSPOLL: | 932 | case WLAN_FSTYPE_PSPOLL: |
| 946 | /* printk("pspoll"); */ | ||
| 947 | wlandev->rx.pspoll++; | 933 | wlandev->rx.pspoll++; |
| 948 | break; | 934 | break; |
| 949 | case WLAN_FSTYPE_RTS: | 935 | case WLAN_FSTYPE_RTS: |
| 950 | /* printk("rts"); */ | ||
| 951 | wlandev->rx.rts++; | 936 | wlandev->rx.rts++; |
| 952 | break; | 937 | break; |
| 953 | case WLAN_FSTYPE_CTS: | 938 | case WLAN_FSTYPE_CTS: |
| 954 | /* printk("cts"); */ | ||
| 955 | wlandev->rx.cts++; | 939 | wlandev->rx.cts++; |
| 956 | break; | 940 | break; |
| 957 | case WLAN_FSTYPE_ACK: | 941 | case WLAN_FSTYPE_ACK: |
| 958 | /* printk("ack"); */ | ||
| 959 | wlandev->rx.ack++; | 942 | wlandev->rx.ack++; |
| 960 | break; | 943 | break; |
| 961 | case WLAN_FSTYPE_CFEND: | 944 | case WLAN_FSTYPE_CFEND: |
| 962 | /* printk("cfend"); */ | ||
| 963 | wlandev->rx.cfend++; | 945 | wlandev->rx.cfend++; |
| 964 | break; | 946 | break; |
| 965 | case WLAN_FSTYPE_CFENDCFACK: | 947 | case WLAN_FSTYPE_CFENDCFACK: |
| 966 | /* printk("cfendcfack"); */ | ||
| 967 | wlandev->rx.cfendcfack++; | 948 | wlandev->rx.cfendcfack++; |
| 968 | break; | 949 | break; |
| 969 | default: | 950 | default: |
| 970 | /* printk("unknown"); */ | ||
| 971 | wlandev->rx.ctl_unknown++; | 951 | wlandev->rx.ctl_unknown++; |
| 972 | break; | 952 | break; |
| 973 | } | 953 | } |
| 974 | /* printk("\n"); */ | ||
| 975 | drop = 2; | 954 | drop = 2; |
| 976 | break; | 955 | break; |
| 977 | 956 | ||
| @@ -1007,7 +986,6 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 29 unmodified lines | |||
| 1007 | wlandev->rx.cfack_cfpoll++; | 986 | wlandev->rx.cfack_cfpoll++; |
| 1008 | break; | 987 | break; |
| 1009 | default: | 988 | default: |
| 1010 | /* printk("unknown"); */ | ||
| 1011 | wlandev->rx.data_unknown++; | 989 | wlandev->rx.data_unknown++; |
| 1012 | break; | 990 | break; |
| 1013 | } | 991 | } |
| @@ -231,12 +231,6 @@ struct p80211pstr32 { · 230 unmodified lines | |||
| 231 | u8 data[MAXLEN_PSTR32]; | 231 | u8 data[MAXLEN_PSTR32]; |
| 232 | } __packed; | 232 | } __packed; |
| 233 | 233 | ||
| 234 | /* MAC address array */ | ||
| 235 | struct p80211macarray { | ||
| 236 | u32 cnt; | ||
| 237 | u8 data[1][MAXLEN_PSTR6]; | ||
| 238 | } __packed; | ||
| 239 | |||
| 240 | /* prototype template */ | 234 | /* prototype template */ |
| 241 | struct p80211item { | 235 | struct p80211item { |
| 242 | u32 did; | 236 | u32 did; |