Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
"Here is the 'big' set of staging driver changes for 6.18-rc1. Nothing
really exciting in here they pretty much consist of:

- minor coding style changes and cleanups

- some api layer removals where not needed

Overall a quiet development cycle.

All have been in linux-next for a while with no reported issues"

* tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (63 commits)
staging: rtl8723bs: xmit: rephrase comment and drop extra space
staging: sm750fb: rename camel case variable
staging: rtl8723bs: hal: put return type and function name on one line
staging: rtl8723bs: fix typo in comment
staging: sm750fb: rename snake case variables
staging: sm750fb: remove unnecessary volatile qualifiers
staging: rtl8723bs: rtw_efuse.h: simplify copyright banner
staging: rtl8723bs: remove unused tables
staging: rtl8723bs: Hal_EfuseParseAntennaDiversity_8723B is empty
staging: rtl8723bs: remove REG_EFUSE_ACCESS_8723 and EFUSE_ACCESS_ON_8723
staging: rtl8723bs: remove bWrite from Hal_EfusePowerSwitch
staging: rtl8723bs: remove wrapper Efuse_PowerSwitch
staging: octeon: Clean up dead code in ethernet-tx.c
staging: rtl8723bs: fix fortify warnings by using struct_group
staging: gpib: use int type to store negative error codes
staging: rtl8723bs: remove include/recv_osdep.h
staging: rtl8723bs: remove os_dep/recv_linux.c
staging: rtl8723bs: rename rtw_os_recv_indicate_pkt
staging: rtl8723bs: move rtw_os_recv_indicate_pkt to rtw_recv.c
staging: rtl8723bs: rename rtw_os_alloc_msdu_pkt
...

+858 -1686
+19 -18
drivers/staging/axis-fifo/axis-fifo.c
··· 107 107 static long read_timeout = 1000; /* ms to wait before read() times out */ 108 108 static long write_timeout = 1000; /* ms to wait before write() times out */ 109 109 110 + static DEFINE_IDA(axis_fifo_ida); 111 + 110 112 /* ---------------------------- 111 113 * module command-line arguments 112 114 * ---------------------------- ··· 125 123 */ 126 124 127 125 struct axis_fifo { 126 + int id; 128 127 int irq; /* interrupt */ 129 128 void __iomem *base_addr; /* kernel space memory */ 130 129 ··· 696 693 697 694 /* get iospace for the device and request physical memory */ 698 695 fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); 699 - if (IS_ERR(fifo->base_addr)) { 700 - rc = PTR_ERR(fifo->base_addr); 701 - goto err_initial; 702 - } 696 + if (IS_ERR(fifo->base_addr)) 697 + return PTR_ERR(fifo->base_addr); 703 698 704 699 dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr); 705 - 706 - /* create unique device name */ 707 - snprintf(device_name, 32, "%s_%pa", DRIVER_NAME, &r_mem->start); 708 - dev_dbg(fifo->dt_device, "device name [%s]\n", device_name); 709 700 710 701 /* ---------------------------- 711 702 * init IP ··· 708 711 709 712 rc = axis_fifo_parse_dt(fifo); 710 713 if (rc) 711 - goto err_initial; 714 + return rc; 712 715 713 716 reset_ip_core(fifo); 714 717 ··· 720 723 /* get IRQ resource */ 721 724 rc = platform_get_irq(pdev, 0); 722 725 if (rc < 0) 723 - goto err_initial; 726 + return rc; 724 727 725 728 /* request IRQ */ 726 729 fifo->irq = rc; ··· 729 732 if (rc) { 730 733 dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n", 731 734 fifo->irq); 732 - goto err_initial; 735 + return rc; 733 736 } 734 737 735 738 /* ---------------------------- 736 739 * init char device 737 740 * ---------------------------- 738 741 */ 742 + fifo->id = ida_alloc(&axis_fifo_ida, GFP_KERNEL); 743 + if (fifo->id < 0) 744 + return fifo->id; 745 + 746 + snprintf(device_name, 32, "%s%d", DRIVER_NAME, fifo->id); 739 747 740 748 /* create character device */ 741 749 fifo->miscdev.fops = &fops; ··· 748 746 fifo->miscdev.name = device_name; 749 747 fifo->miscdev.parent = dev; 750 748 rc = misc_register(&fifo->miscdev); 751 - if (rc < 0) 752 - goto err_initial; 749 + if (rc < 0) { 750 + ida_free(&axis_fifo_ida, fifo->id); 751 + return rc; 752 + } 753 753 754 754 axis_fifo_debugfs_init(fifo); 755 755 756 756 return 0; 757 - 758 - err_initial: 759 - dev_set_drvdata(dev, NULL); 760 - return rc; 761 757 } 762 758 763 759 static void axis_fifo_remove(struct platform_device *pdev) ··· 765 765 766 766 debugfs_remove(fifo->debugfs_dir); 767 767 misc_deregister(&fifo->miscdev); 768 - dev_set_drvdata(dev, NULL); 768 + ida_free(&axis_fifo_ida, fifo->id); 769 769 } 770 770 771 771 static const struct of_device_id axis_fifo_of_match[] = { ··· 805 805 static void __exit axis_fifo_exit(void) 806 806 { 807 807 platform_driver_unregister(&axis_fifo_driver); 808 + ida_destroy(&axis_fifo_ida); 808 809 } 809 810 810 811 module_exit(axis_fifo_exit);
+9 -9
drivers/staging/gpib/agilent_82357a/agilent_82357a.c
··· 449 449 if (!out_data) 450 450 return -ENOMEM; 451 451 out_data[i++] = DATA_PIPE_CMD_READ; 452 - out_data[i++] = 0; //primary address when ARF_NO_ADDR is not set 453 - out_data[i++] = 0; //secondary address when ARF_NO_ADDR is not set 452 + out_data[i++] = 0; // primary address when ARF_NO_ADDR is not set 453 + out_data[i++] = 0; // secondary address when ARF_NO_ADDR is not set 454 454 out_data[i] = ARF_NO_ADDRESS | ARF_END_ON_EOI; 455 455 if (a_priv->eos_mode & REOS) 456 456 out_data[i] |= ARF_END_ON_EOS_CHAR; ··· 532 532 */ 533 533 agilent_82357a_take_control_internal(board, 0); 534 534 535 - //FIXME check trailing flags for error 535 + // FIXME check trailing flags for error 536 536 return retval; 537 537 } 538 538 ··· 966 966 dev_err(&usb_dev->dev, "write_registers() returned error\n"); 967 967 return retval; 968 968 } 969 - udelay(2); //silly, since usb write will take way longer 969 + udelay(2); // silly, since usb write will take way longer 970 970 read.address = CPTR; 971 971 retval = agilent_82357a_read_registers(a_priv, &read, 1, 1); 972 972 if (retval) { ··· 989 989 990 990 static void agilent_82357a_parallel_poll_configure(struct gpib_board *board, u8 config) 991 991 { 992 - //board can only be system controller 992 + // board can only be system controller 993 993 return;// 0; 994 994 } 995 995 996 996 static void agilent_82357a_parallel_poll_response(struct gpib_board *board, int ist) 997 997 { 998 - //board can only be system controller 998 + // board can only be system controller 999 999 return;// 0; 1000 1000 } 1001 1001 1002 1002 static void agilent_82357a_serial_poll_response(struct gpib_board *board, u8 status) 1003 1003 { 1004 - //board can only be system controller 1004 + // board can only be system controller 1005 1005 return;// 0; 1006 1006 } 1007 1007 1008 1008 static u8 agilent_82357a_serial_poll_status(struct gpib_board *board) 1009 1009 { 1010 - //board can only be system controller 1010 + // board can only be system controller 1011 1011 return 0; 1012 1012 } 1013 1013 1014 1014 static void agilent_82357a_return_to_local(struct gpib_board *board) 1015 1015 { 1016 - //board can only be system controller 1016 + // board can only be system controller 1017 1017 return;// 0; 1018 1018 } 1019 1019
+5 -5
drivers/staging/gpib/agilent_82357a/agilent_82357a.h
··· 20 20 enum usb_device_ids { 21 21 USB_DEVICE_ID_AGILENT_82357A = 0x0107, 22 22 USB_DEVICE_ID_AGILENT_82357A_PREINIT = 0x0007, // device id before firmware is loaded 23 - USB_DEVICE_ID_AGILENT_82357B = 0x0718, // device id before firmware is loaded 23 + USB_DEVICE_ID_AGILENT_82357B = 0x0718, // device id before firmware is loaded 24 24 USB_DEVICE_ID_AGILENT_82357B_PREINIT = 0x0518, // device id before firmware is loaded 25 25 }; 26 26 ··· 129 129 struct urb *bulk_urb; 130 130 struct urb *interrupt_urb; 131 131 u8 *interrupt_buffer; 132 - struct mutex bulk_transfer_lock; // bulk transfer lock 133 - struct mutex bulk_alloc_lock; // bulk transfer allocation lock 134 - struct mutex interrupt_alloc_lock; // interrupt allocation lock 135 - struct mutex control_alloc_lock; // control message allocation lock 132 + struct mutex bulk_transfer_lock; // bulk transfer lock 133 + struct mutex bulk_alloc_lock; // bulk transfer allocation lock 134 + struct mutex interrupt_alloc_lock; // interrupt allocation lock 135 + struct mutex control_alloc_lock; // control message allocation lock 136 136 struct timer_list bulk_timer; 137 137 struct agilent_82357a_urb_ctx context; 138 138 unsigned int bulk_out_endpoint;
+2 -2
drivers/staging/gpib/cb7210/cb7210.h
··· 56 56 }; 57 57 58 58 enum hs_regs { 59 - //write registers 59 + // write registers 60 60 HS_MODE = 0x8, /* HS_MODE register */ 61 61 HS_INT_LEVEL = 0x9, /* HS_INT_LEVEL register */ 62 - //read registers 62 + // read registers 63 63 HS_STATUS = 0x8, /* HS_STATUS register */ 64 64 }; 65 65
+1 -1
drivers/staging/gpib/cec/cec_gpib.c
··· 206 206 .parallel_poll_configure = cec_parallel_poll_configure, 207 207 .parallel_poll_response = cec_parallel_poll_response, 208 208 .local_parallel_poll_mode = NULL, // XXX 209 - .line_status = NULL, //XXX 209 + .line_status = NULL, // XXX 210 210 .update_status = cec_update_status, 211 211 .primary_address = cec_primary_address, 212 212 .secondary_address = cec_secondary_address,
+1 -1
drivers/staging/gpib/common/gpib_os.c
··· 326 326 cmd_string[i++] = MLA(board->pad); /* controller's listen address */ 327 327 if (board->sad >= 0) 328 328 cmd_string[i++] = MSA(board->sad); 329 - cmd_string[i++] = SPE; //serial poll enable 329 + cmd_string[i++] = SPE; // serial poll enable 330 330 331 331 ret = board->interface->command(board, cmd_string, i, &bytes_written); 332 332 if (ret < 0 || bytes_written < i) {
+1 -1
drivers/staging/gpib/common/iblib.c
··· 608 608 *status = temp_status; 609 609 return 1; 610 610 } 611 - //XXX does wait for END work? 611 + // XXX does wait for END work? 612 612 return 0; 613 613 } 614 614
+1 -1
drivers/staging/gpib/eastwood/fluke_gpib.c
··· 507 507 } 508 508 if (retval < 0) 509 509 return retval; 510 - //handle sending of last byte with eoi 510 + // handle sending of last byte with eoi 511 511 if (send_eoi) { 512 512 size_t num_bytes; 513 513
+1 -1
drivers/staging/gpib/fmh_gpib/fmh_gpib.c
··· 523 523 } 524 524 if (retval < 0) 525 525 return retval; 526 - //handle sending of last byte with eoi 526 + // handle sending of last byte with eoi 527 527 if (send_eoi) { 528 528 size_t num_bytes; 529 529
+8 -8
drivers/staging/gpib/gpio/gpib_bitbang.c
··· 277 277 int ndac_mode; /* nrfd interrupt mode 0/1 -> edge/levels */ 278 278 int dav_tx; /* keep trace of DAV status while sending */ 279 279 int dav_rx; /* keep trace of DAV status while receiving */ 280 - u8 eos; // eos character 281 - short eos_flags; // eos mode 280 + u8 eos; /* eos character */ 281 + short eos_flags; /* eos mode */ 282 282 short eos_check; /* eos check required in current operation ... */ 283 283 short eos_check_8; /* ... with byte comparison */ 284 284 short eos_mask_7; /* ... with 7 bit masked character */ ··· 290 290 u8 *rbuf; 291 291 u8 *wbuf; 292 292 int end_flag; 293 - int r_busy; /* 0==idle 1==busy */ 293 + int r_busy; /* 0==idle 1==busy */ 294 294 int w_busy; 295 295 int write_done; 296 - int cmd; /* 1 = cmd write in progress */ 296 + int cmd; /* 1 = cmd write in progress */ 297 297 size_t w_cnt; 298 298 size_t length; 299 299 u8 *w_buf; 300 - spinlock_t rw_lock; // protect mods to rw_lock 300 + spinlock_t rw_lock; /* protect mods to rw_lock */ 301 301 int phase; 302 302 int ndac_idle; 303 303 int ndac_seq; ··· 726 726 static int bb_command(struct gpib_board *board, u8 *buffer, 727 727 size_t length, size_t *bytes_written) 728 728 { 729 - size_t ret; 729 + int ret; 730 730 struct bb_priv *priv = board->private_data; 731 731 int i; 732 732 ··· 1462 1462 gpiod_set_value(TE, 0); /* set NDAC and NRFD to transmit and DAV to receive */ 1463 1463 } 1464 1464 1465 - gpiod_direction_output(NRFD, 0); // hold off the talker 1466 - gpiod_direction_output(NDAC, 0); // data not accepted 1465 + gpiod_direction_output(NRFD, 0); /* hold off the talker */ 1466 + gpiod_direction_output(NDAC, 0); /* data not accepted */ 1467 1467 1468 1468 priv->direction = DIR_READ; 1469 1469 }
+6 -6
drivers/staging/gpib/hp_82341/hp_82341.c
··· 38 38 unsigned short event_status; 39 39 int i; 40 40 int num_fifo_bytes; 41 - //hardware doesn't support checking for end-of-string character when using fifo 41 + // hardware doesn't support checking for end-of-string character when using fifo 42 42 if (tms_priv->eos_flags & REOS) 43 43 return tms9914_read(board, tms_priv, buffer, length, end, bytes_read); 44 44 ··· 49 49 *bytes_read = 0; 50 50 if (length == 0) 51 51 return 0; 52 - //disable fifo for the moment 52 + // disable fifo for the moment 53 53 outb(DIRECTION_GPIB_TO_HOST_BIT, hp_priv->iobase[3] + BUFFER_CONTROL_REG); 54 54 /* 55 55 * Handle corner case of board not in holdoff and one byte has slipped in already. ··· 154 154 while (1) { 155 155 int status; 156 156 157 - //restart doesn't work if data holdoff is in effect 157 + // restart doesn't work if data holdoff is in effect 158 158 status = tms9914_line_status(board, tms_priv); 159 159 if ((status & BUS_NRFD) == 0) { 160 160 outb(RESTART_STREAM_BIT, hp_priv->iobase[0] + STREAM_STATUS_REG); ··· 764 764 ENABLE_TI_INTERRUPT_EVENT_BIT, hp_priv->iobase[0] + EVENT_ENABLE_REG); 765 765 outb(ENABLE_BUFFER_END_INTERRUPT_BIT | ENABLE_TERMINAL_COUNT_INTERRUPT_BIT | 766 766 ENABLE_TI_INTERRUPT_BIT, hp_priv->iobase[0] + INTERRUPT_ENABLE_REG); 767 - //write clear event register 767 + // write clear event register 768 768 outb((TI_INTERRUPT_EVENT_BIT | POINTERS_EQUAL_EVENT_BIT | 769 769 BUFFER_END_EVENT_BIT | TERMINAL_COUNT_EVENT_BIT), 770 770 hp_priv->iobase[0] + EVENT_STATUS_REG); ··· 867 867 event_status = inb(hp_priv->iobase[0] + EVENT_STATUS_REG); 868 868 if (event_status & INTERRUPT_PENDING_EVENT_BIT) 869 869 retval = IRQ_HANDLED; 870 - //write-clear status bits 870 + // write-clear status bits 871 871 if (event_status & (TI_INTERRUPT_EVENT_BIT | POINTERS_EQUAL_EVENT_BIT | 872 872 BUFFER_END_EVENT_BIT | TERMINAL_COUNT_EVENT_BIT)) { 873 873 outb(event_status & (TI_INTERRUPT_EVENT_BIT | POINTERS_EQUAL_EVENT_BIT | ··· 901 901 902 902 outb(complement & 0xff, hp_priv->iobase[1] + TRANSFER_COUNT_LOW_REG); 903 903 outb((complement >> 8) & 0xff, hp_priv->iobase[1] + TRANSFER_COUNT_MID_REG); 904 - //I don't think the hi count reg is even used, but oh well 904 + // I don't think the hi count reg is even used, but oh well 905 905 outb((complement >> 16) & 0xf, hp_priv->iobase[1] + TRANSFER_COUNT_HIGH_REG); 906 906 } 907 907
+20 -20
drivers/staging/gpib/hp_82341/hp_82341.h
··· 65 65 IRQ_SELECT_MASK = 0x7, 66 66 DMA_CONFIG_MASK = 0x18, 67 67 ENABLE_DMA_CONFIG_BIT = 0x20, 68 - XILINX_READY_BIT = 0x40, //read only 68 + XILINX_READY_BIT = 0x40, // read only 69 69 DONE_PGL_BIT = 0x80 70 70 }; 71 71 ··· 94 94 }; 95 95 96 96 enum mode_control_status_bits { 97 - SLOT8_BIT = 0x1, // read only 97 + SLOT8_BIT = 0x1, // read only 98 98 ACTIVE_CONTROLLER_BIT = 0x2, // read only 99 99 ENABLE_DMA_BIT = 0x4, 100 100 SYSTEM_CONTROLLER_BIT = 0x8, ··· 106 106 enum monitor_bits { 107 107 MONITOR_INTERRUPT_PENDING_BIT = 0x1, // read only 108 108 MONITOR_CLEAR_HOLDOFF_BIT = 0x2, // write only 109 - MONITOR_PPOLL_BIT = 0x4, // write clear 110 - MONITOR_SRQ_BIT = 0x8, // write clear 111 - MONITOR_IFC_BIT = 0x10, // write clear 112 - MONITOR_REN_BIT = 0x20, // write clear 113 - MONITOR_END_BIT = 0x40, // write clear 114 - MONITOR_DAV_BIT = 0x80 // write clear 109 + MONITOR_PPOLL_BIT = 0x4, // write clear 110 + MONITOR_SRQ_BIT = 0x8, // write clear 111 + MONITOR_IFC_BIT = 0x10, // write clear 112 + MONITOR_REN_BIT = 0x20, // write clear 113 + MONITOR_END_BIT = 0x40, // write clear 114 + MONITOR_DAV_BIT = 0x80 // write clear 115 115 }; 116 116 117 117 enum interrupt_enable_bits { ··· 123 123 }; 124 124 125 125 enum event_status_bits { 126 - TI_INTERRUPT_EVENT_BIT = 0x1, //write clear 126 + TI_INTERRUPT_EVENT_BIT = 0x1, // write clear 127 127 INTERRUPT_PENDING_EVENT_BIT = 0x2, // read only 128 - POINTERS_EQUAL_EVENT_BIT = 0x4, //write clear 129 - BUFFER_END_EVENT_BIT = 0x10, //write clear 128 + POINTERS_EQUAL_EVENT_BIT = 0x4, // write clear 129 + BUFFER_END_EVENT_BIT = 0x10, // write clear 130 130 TERMINAL_COUNT_EVENT_BIT = 0x20, // write clear 131 131 DMA_TERMINAL_COUNT_EVENT_BIT = 0x80, // write clear 132 132 }; 133 133 134 134 enum event_enable_bits { 135 - ENABLE_TI_INTERRUPT_EVENT_BIT = 0x1, //write clear 136 - ENABLE_POINTERS_EQUAL_EVENT_BIT = 0x4, //write clear 137 - ENABLE_BUFFER_END_EVENT_BIT = 0x10, //write clear 138 - ENABLE_TERMINAL_COUNT_EVENT_BIT = 0x20, // write clear 135 + ENABLE_TI_INTERRUPT_EVENT_BIT = 0x1, // write clear 136 + ENABLE_POINTERS_EQUAL_EVENT_BIT = 0x4, // write clear 137 + ENABLE_BUFFER_END_EVENT_BIT = 0x10, // write clear 138 + ENABLE_TERMINAL_COUNT_EVENT_BIT = 0x20, // write clear 139 139 ENABLE_DMA_TERMINAL_COUNT_EVENT_BIT = 0x80, // write clear 140 140 }; 141 141 142 142 enum stream_status_bits { 143 - HALTED_STATUS_BIT = 0x1, //read 144 - RESTART_STREAM_BIT = 0x1 //write 143 + HALTED_STATUS_BIT = 0x1, // read 144 + RESTART_STREAM_BIT = 0x1 // write 145 145 }; 146 146 147 147 enum buffer_control_bits { 148 148 DIRECTION_GPIB_TO_HOST_BIT = 0x20, // transfer direction (set for gpib to host) 149 - ENABLE_TI_BUFFER_BIT = 0x40, //enable fifo 150 - FAST_WR_EN_BIT = 0x80, // 350 ns t1 delay? 149 + ENABLE_TI_BUFFER_BIT = 0x40, // enable fifo 150 + FAST_WR_EN_BIT = 0x80, // 350 ns t1 delay? 151 151 }; 152 152 153 153 // registers accessible through isapnp chip on 82341d 154 154 enum hp_82341d_pnp_registers { 155 - PIO_DATA_REG = 0x20, //read/write pio data lines 155 + PIO_DATA_REG = 0x20, // read/write pio data lines 156 156 PIO_DIRECTION_REG = 0x21, // set pio data line directions (set for input) 157 157 }; 158 158
+2 -2
drivers/staging/gpib/include/amccs5933.h
··· 24 24 enum { 25 25 OUTBOX_EMPTY_INTR_BIT = 0x10, // enable outbox empty interrupt 26 26 INBOX_FULL_INTR_BIT = 0x1000, // enable inbox full interrupt 27 - INBOX_INTR_CS_BIT = 0x20000, // read, or write clear inbox full interrupt 27 + INBOX_INTR_CS_BIT = 0x20000, // read, or write clear inbox full interrupt 28 28 INTR_ASSERTED_BIT = 0x800000, // read only, interrupt asserted 29 29 }; 30 30 ··· 52 52 return (mailbox & 0x3) << 2; 53 53 }; 54 54 55 - //BMCSR bits 55 + // BMCSR bits 56 56 enum { 57 57 MBOX_FLAGS_RESET_BIT = 0x08000000, // resets mailbox empty/full flags 58 58 };
+2 -1
drivers/staging/gpib/include/gpib_types.h
··· 273 273 struct mutex big_gpib_mutex; 274 274 /* pid of last process to lock the board mutex */ 275 275 pid_t locking_pid; 276 - spinlock_t locking_pid_spinlock; // lock for setting locking pid 276 + /* lock for setting locking pid */ 277 + spinlock_t locking_pid_spinlock; 277 278 /* Spin lock for dealing with races with the interrupt handler */ 278 279 spinlock_t spinlock; 279 280 /* Watchdog timer to enable timeouts */
+13 -13
drivers/staging/gpib/include/nec7210.h
··· 22 22 u32 iobase; 23 23 #endif 24 24 void __iomem *mmiobase; 25 - unsigned int offset; // offset between successive nec7210 io addresses 25 + unsigned int offset; // offset between successive nec7210 io addresses 26 26 unsigned int dma_channel; 27 27 u8 *dma_buffer; 28 28 unsigned int dma_buffer_length; // length of dma buffer 29 29 dma_addr_t dma_buffer_addr; // bus address of board->buffer for use with dma 30 30 // software copy of bits written to registers 31 31 u8 reg_bits[8]; 32 - u8 auxa_bits; // bits written to auxiliary register A 33 - u8 auxb_bits; // bits written to auxiliary register B 32 + u8 auxa_bits; // bits written to auxiliary register A 33 + u8 auxb_bits; // bits written to auxiliary register B 34 34 // used to keep track of board's state, bit definitions given below 35 35 unsigned long state; 36 - /* lock for chips that extend the nec7210 registers by paging in alternate regs */ 36 + // lock for chips that extend the nec7210 registers by paging in alternate regs 37 37 spinlock_t register_page_lock; 38 38 // wrappers for outb, inb, readb, or writeb 39 39 u8 (*read_byte)(struct nec7210_priv *priv, unsigned int register_number); ··· 64 64 65 65 // struct nec7210_priv.state bit numbers 66 66 enum { 67 - PIO_IN_PROGRESS_BN, // pio transfer in progress 67 + PIO_IN_PROGRESS_BN, // pio transfer in progress 68 68 DMA_READ_IN_PROGRESS_BN, // dma read transfer in progress 69 69 DMA_WRITE_IN_PROGRESS_BN, // dma write transfer in progress 70 - READ_READY_BN, // board has data byte available to read 71 - WRITE_READY_BN, // board is ready to send a data byte 72 - COMMAND_READY_BN, // board is ready to send a command byte 73 - RECEIVED_END_BN, // received END 74 - BUS_ERROR_BN, // output error has occurred 75 - RFD_HOLDOFF_BN, // rfd holdoff in effect 76 - DEV_CLEAR_BN, // device clear received 77 - ADR_CHANGE_BN, // address state change occurred 70 + READ_READY_BN, // board has data byte available to read 71 + WRITE_READY_BN, // board is ready to send a data byte 72 + COMMAND_READY_BN, // board is ready to send a command byte 73 + RECEIVED_END_BN, // received END 74 + BUS_ERROR_BN, // output error has occurred 75 + RFD_HOLDOFF_BN, // rfd holdoff in effect 76 + DEV_CLEAR_BN, // device clear received 77 + ADR_CHANGE_BN, // address state change occurred 78 78 }; 79 79 80 80 // interface functions
+2 -2
drivers/staging/gpib/include/nec7210_registers.h
··· 11 11 NEC7210, // The original 12 12 TNT4882, // NI 13 13 NAT4882, // NI 14 - CB7210, // measurement computing 14 + CB7210, // measurement computing 15 15 IOT7210, // iotech 16 16 IGPIB7210, // Ines 17 17 TNT5004, // NI (minor differences to TNT4882) ··· 48 48 ADR1, // address 2 49 49 }; 50 50 51 - //bit definitions common to nec-7210 compatible registers 51 + // bit definitions common to nec-7210 compatible registers 52 52 53 53 // ISR1: interrupt status register 1 54 54 enum isr1_bits {
+4 -4
drivers/staging/gpib/include/plx9050.h
··· 23 23 PLX9050_LINTR2_STATUS_BIT = 0x20, 24 24 PLX9050_PCI_INTR_EN_BIT = 0x40, 25 25 PLX9050_SOFT_INTR_BIT = 0x80, 26 - PLX9050_LINTR1_SELECT_ENABLE_BIT = 0x100, //9052 extension 27 - PLX9050_LINTR2_SELECT_ENABLE_BIT = 0x200, //9052 extension 28 - PLX9050_LINTR1_EDGE_CLEAR_BIT = 0x400, //9052 extension 29 - PLX9050_LINTR2_EDGE_CLEAR_BIT = 0x800, //9052 extension 26 + PLX9050_LINTR1_SELECT_ENABLE_BIT = 0x100, // 9052 extension 27 + PLX9050_LINTR2_SELECT_ENABLE_BIT = 0x200, // 9052 extension 28 + PLX9050_LINTR1_EDGE_CLEAR_BIT = 0x400, // 9052 extension 29 + PLX9050_LINTR2_EDGE_CLEAR_BIT = 0x800, // 9052 extension 30 30 }; 31 31 32 32 enum plx9050_cntrl_bits {
+45 -45
drivers/staging/gpib/include/tms9914.h
··· 30 30 u8 imr0_bits, imr1_bits; 31 31 // bits written to address mode register 32 32 u8 admr_bits; 33 - u8 auxa_bits; // bits written to auxiliary register A 33 + u8 auxa_bits; // bits written to auxiliary register A 34 34 // used to keep track of board's state, bit definitions given below 35 35 unsigned long state; 36 - u8 eos; // eos character 36 + u8 eos; // eos character 37 37 short eos_flags; 38 38 u8 spoll_status; 39 39 enum tms9914_holdoff_mode holdoff_mode; ··· 67 67 68 68 // struct tms9914_priv.state bit numbers 69 69 enum { 70 - PIO_IN_PROGRESS_BN, // pio transfer in progress 70 + PIO_IN_PROGRESS_BN, // pio transfer in progress 71 71 DMA_READ_IN_PROGRESS_BN, // dma read transfer in progress 72 72 DMA_WRITE_IN_PROGRESS_BN, // dma write transfer in progress 73 - READ_READY_BN, // board has data byte available to read 74 - WRITE_READY_BN, // board is ready to send a data byte 75 - COMMAND_READY_BN, // board is ready to send a command byte 76 - RECEIVED_END_BN, // received END 77 - BUS_ERROR_BN, // bus error 78 - DEV_CLEAR_BN, // device clear received 73 + READ_READY_BN, // board has data byte available to read 74 + WRITE_READY_BN, // board is ready to send a data byte 75 + COMMAND_READY_BN, // board is ready to send a command byte 76 + RECEIVED_END_BN, // received END 77 + BUS_ERROR_BN, // bus error 78 + DEV_CLEAR_BN, // device clear received 79 79 }; 80 80 81 81 // interface functions ··· 150 150 IMR0 = 0, /* interrupt mask 0 */ 151 151 IMR1 = 1, /* interrupt mask 1 */ 152 152 AUXCR = 3, /* auxiliary command */ 153 - ADR = 4, // address register 154 - SPMR = 5, // serial poll mode register 153 + ADR = 4, /* address register */ 154 + SPMR = 5, /* serial poll mode register */ 155 155 PPR = 6, /* parallel poll */ 156 156 CDOR = 7, /* data out register */ 157 157 }; 158 158 159 159 // read registers 160 160 enum { 161 - ISR0 = 0, /* interrupt status 0 */ 162 - ISR1 = 1, /* interrupt status 1 */ 163 - ADSR = 2, /* address status */ 164 - BSR = 3, /* bus status */ 165 - CPTR = 6, /* command pass thru */ 166 - DIR = 7, /* data in register */ 161 + ISR0 = 0, /* interrupt status 0 */ 162 + ISR1 = 1, /* interrupt status 1 */ 163 + ADSR = 2, /* address status */ 164 + BSR = 3, /* bus status */ 165 + CPTR = 6, /* command pass thru */ 166 + DIR = 7, /* data in register */ 167 167 }; 168 168 169 - //bit definitions common to tms9914 compatible registers 169 + // bit definitions common to tms9914 compatible registers 170 170 171 171 /* ISR0 - Register bits */ 172 172 enum isr0_bits { ··· 248 248 /*---------------------------------------------------------*/ 249 249 250 250 enum aux_cmd_bits { 251 - AUX_CS = 0x80, /* set bit instead of clearing it, used with commands marked 'd' below */ 252 - AUX_CHIP_RESET = 0x0, /* d Chip reset */ 253 - AUX_INVAL = 0x1, // release dac holdoff, invalid command byte 254 - AUX_VAL = (AUX_INVAL | AUX_CS), // release dac holdoff, valid command byte 255 - AUX_RHDF = 0x2, /* X Release RFD holdoff */ 256 - AUX_HLDA = 0x3, /* d holdoff on all data */ 257 - AUX_HLDE = 0x4, /* d holdoff on EOI only */ 258 - AUX_NBAF = 0x5, /* X Set new byte available false */ 259 - AUX_FGET = 0x6, /* d force GET */ 260 - AUX_RTL = 0x7, /* d return to local */ 261 - AUX_SEOI = 0x8, /* X send EOI with next byte */ 262 - AUX_LON = 0x9, /* d Listen only */ 263 - AUX_TON = 0xa, /* d Talk only */ 264 - AUX_GTS = 0xb, /* X goto standby */ 265 - AUX_TCA = 0xc, /* X take control asynchronously */ 266 - AUX_TCS = 0xd, /* X take " synchronously */ 267 - AUX_RPP = 0xe, /* d Request parallel poll */ 268 - AUX_SIC = 0xf, /* d send interface clear */ 269 - AUX_SRE = 0x10, /* d send remote enable */ 270 - AUX_RQC = 0x11, /* X request control */ 271 - AUX_RLC = 0x12, /* X release control */ 272 - AUX_DAI = 0x13, /* d disable all interrupts */ 273 - AUX_PTS = 0x14, /* X pass through next secondary */ 274 - AUX_STDL = 0x15, /* d short T1 delay */ 275 - AUX_SHDW = 0x16, /* d shadow handshake */ 276 - AUX_VSTDL = 0x17, /* d very short T1 delay (smj9914 extension) */ 277 - AUX_RSV2 = 0x18, /* d request service bit 2 (smj9914 extension) */ 251 + AUX_CS = 0x80, /* set bit instead of clearing it, used with commands marked 'd' below */ 252 + AUX_CHIP_RESET = 0x0, /* d Chip reset */ 253 + AUX_INVAL = 0x1, /* release dac holdoff, invalid command byte */ 254 + AUX_VAL = (AUX_INVAL | AUX_CS), /* release dac holdoff, valid command byte */ 255 + AUX_RHDF = 0x2, /* X Release RFD holdoff */ 256 + AUX_HLDA = 0x3, /* d holdoff on all data */ 257 + AUX_HLDE = 0x4, /* d holdoff on EOI only */ 258 + AUX_NBAF = 0x5, /* X Set new byte available false */ 259 + AUX_FGET = 0x6, /* d force GET */ 260 + AUX_RTL = 0x7, /* d return to local */ 261 + AUX_SEOI = 0x8, /* X send EOI with next byte */ 262 + AUX_LON = 0x9, /* d Listen only */ 263 + AUX_TON = 0xa, /* d Talk only */ 264 + AUX_GTS = 0xb, /* X goto standby */ 265 + AUX_TCA = 0xc, /* X take control asynchronously */ 266 + AUX_TCS = 0xd, /* X take " synchronously */ 267 + AUX_RPP = 0xe, /* d Request parallel poll */ 268 + AUX_SIC = 0xf, /* d send interface clear */ 269 + AUX_SRE = 0x10, /* d send remote enable */ 270 + AUX_RQC = 0x11, /* X request control */ 271 + AUX_RLC = 0x12, /* X release control */ 272 + AUX_DAI = 0x13, /* d disable all interrupts */ 273 + AUX_PTS = 0x14, /* X pass through next secondary */ 274 + AUX_STDL = 0x15, /* d short T1 delay */ 275 + AUX_SHDW = 0x16, /* d shadow handshake */ 276 + AUX_VSTDL = 0x17, /* d very short T1 delay (smj9914 extension) */ 277 + AUX_RSV2 = 0x18, /* d request service bit 2 (smj9914 extension) */ 278 278 }; 279 279 280 280 #endif //_TMS9914_H
+11 -11
drivers/staging/gpib/include/tnt4882_registers.h
··· 32 32 CMDR = 0x1c, // command register 33 33 TIMER = 0x1e, // timer register 34 34 35 - STS1 = 0x10, /* T488 Status Register 1 */ 36 - STS2 = 0x1c, /* T488 Status Register 2 */ 35 + STS1 = 0x10, // T488 Status Register 1 36 + STS2 = 0x1c, // T488 Status Register 2 37 37 ISR0 = IMR0, 38 - ISR3 = 0x1a, /* T488 Interrupt Status Register 3 */ 39 - BCR = 0x1f, /* bus control/status register */ 38 + ISR3 = 0x1a, // T488 Interrupt Status Register 3 39 + BCR = 0x1f, // bus control/status register 40 40 BSR = BCR, 41 41 }; 42 42 ··· 107 107 108 108 /* ISR0 -- Interrupt Status Register 0 */ 109 109 enum isr0_bits { 110 - TNT_SYNC_BIT = 0x1, /* handshake sync */ 111 - TNT_TO_BIT = 0x2, /* timeout */ 112 - TNT_ATNI_BIT = 0x4, /* ATN interrupt */ 110 + TNT_SYNC_BIT = 0x1, /* handshake sync */ 111 + TNT_TO_BIT = 0x2, /* timeout */ 112 + TNT_ATNI_BIT = 0x4, /* ATN interrupt */ 113 113 TNT_IFCI_BIT = 0x8, /* interface clear interrupt */ 114 - TNT_EOS_BIT = 0x10, /* end of string */ 114 + TNT_EOS_BIT = 0x10, /* end of string */ 115 115 TNT_NL_BIT = 0x20, /* new line receive */ 116 116 TNT_STBO_BIT = 0x40, /* status byte out */ 117 117 TNT_NBA_BIT = 0x80, /* new byte available */ ··· 129 129 }; 130 130 131 131 enum keyreg_bits { 132 - MSTD = 0x20, // enable 350ns T1 delay 132 + MSTD = 0x20, /* enable 350ns T1 delay */ 133 133 }; 134 134 135 135 /* STS1 -- Status Register 1 (read only) */ ··· 157 157 AUX_9914 = 0x15, // switch to 9914 mode 158 158 AUX_REQT = 0x18, 159 159 AUX_REQF = 0x19, 160 - AUX_PAGEIN = 0x50, /* page in alternate registers */ 160 + AUX_PAGEIN = 0x50, // page in alternate registers 161 161 AUX_HLDI = 0x51, // rfd holdoff immediately 162 162 AUX_CLEAR_END = 0x55, 163 163 AUX_7210 = 0x99, // switch to 7210 mode ··· 183 183 184 184 enum sasr_bits { 185 185 ACRDY_BIT = 0x4, /* acceptor ready state */ 186 - ADHS_BIT = 0x8, /* acceptor data holdoff state */ 186 + ADHS_BIT = 0x8, /* acceptor data holdoff state */ 187 187 ANHS2_BIT = 0x10, /* acceptor not ready holdoff immediately state */ 188 188 ANHS1_BIT = 0x20, /* acceptor not ready holdoff state */ 189 189 AEHS_BIT = 0x40, /* acceptor end holdoff state */
+6 -6
drivers/staging/gpib/ines/ines.h
··· 97 97 TR3_TRIG_ENABLE_BIT = 0x1, // enable generation of trigger pulse T/R3 pin 98 98 // clear message available status bit when chip writes byte with EOI true 99 99 MAV_ENABLE_BIT = 0x2, 100 - EOS1_ENABLE_BIT = 0x4, // enable eos register 1 101 - EOS2_ENABLE_BIT = 0x8, // enable eos register 2 102 - EOIDIS_BIT = 0x10, // disable EOI interrupt when doing rfd holdoff on end? 100 + EOS1_ENABLE_BIT = 0x4, // enable eos register 1 101 + EOS2_ENABLE_BIT = 0x8, // enable eos register 2 102 + EOIDIS_BIT = 0x10, // disable EOI interrupt when doing rfd holdoff on end? 103 103 XFER_COUNTER_ENABLE_BIT = 0x20, 104 104 XFER_COUNTER_OUTPUT_BIT = 0x40, // use counter for output, clear for input 105 105 // when xfer counter hits 0, assert EOI on write or RFD holdoff on read ··· 121 121 }; 122 122 123 123 enum xdma_control_bits { 124 - DMA_OUTPUT_BIT = 0x1, // use dma for output, clear for input 124 + DMA_OUTPUT_BIT = 0x1, // use dma for output, clear for input 125 125 ENABLE_SYNC_DMA_BIT = 0x2, 126 - DMA_ACCESS_EVERY_CYCLE = 0x4,// dma accesses fifo every cycle, clear for every other cycle 127 - DMA_16BIT = 0x8, // clear for 8 bit transfers 126 + DMA_ACCESS_EVERY_CYCLE = 0x4, // dma accesses fifo every cycle, clear for every other cycle 127 + DMA_16BIT = 0x8, // clear for 8 bit transfers 128 128 }; 129 129 130 130 enum bus_control_monitor_bits {
+2 -2
drivers/staging/gpib/ines/ines_gpib.c
··· 152 152 153 153 write_byte(nec_priv, INES_RFD_HLD_IMMEDIATE, AUXMR); 154 154 155 - //clear in fifo 155 + // clear in fifo 156 156 nec7210_set_reg_bits(nec_priv, ADMR, IN_FIFO_ENABLE_BIT, 0); 157 157 nec7210_set_reg_bits(nec_priv, ADMR, IN_FIFO_ENABLE_BIT, IN_FIFO_ENABLE_BIT); 158 158 ··· 225 225 unsigned int num_bytes, i; 226 226 227 227 *bytes_written = 0; 228 - //clear out fifo 228 + // clear out fifo 229 229 nec7210_set_reg_bits(nec_priv, ADMR, OUT_FIFO_ENABLE_BIT, 0); 230 230 nec7210_set_reg_bits(nec_priv, ADMR, OUT_FIFO_ENABLE_BIT, OUT_FIFO_ENABLE_BIT); 231 231
+3 -3
drivers/staging/gpib/nec7210/nec7210.c
··· 779 779 780 780 *bytes_written = 0; 781 781 782 - clear_bit(DEV_CLEAR_BN, &priv->state); //XXX 782 + clear_bit(DEV_CLEAR_BN, &priv->state); // XXX 783 783 784 784 if (send_eoi) 785 - length-- ; /* save the last byte for sending EOI */ 785 + length-- ; // save the last byte for sending EOI 786 786 787 787 if (length > 0) { 788 788 // isa dma transfer ··· 1005 1005 nec7210_primary_address(board, priv, board->pad); 1006 1006 nec7210_secondary_address(board, priv, board->sad, board->sad >= 0); 1007 1007 1008 - // enable interrupts 1008 + /* enable interrupts */ 1009 1009 priv->reg_bits[IMR1] = HR_ERRIE | HR_DECIE | HR_ENDIE | 1010 1010 HR_DETIE | HR_CPTIE | HR_DOIE | HR_DIIE; 1011 1011 priv->reg_bits[IMR2] = IMR2_ENABLE_INTR_MASK;
+5 -5
drivers/staging/gpib/ni_usb/ni_usb_gpib.c
··· 29 29 30 30 static DEFINE_MUTEX(ni_usb_hotplug_lock); 31 31 32 - //calculates a reasonable timeout in that can be passed to usb functions 32 + // calculates a reasonable timeout in that can be passed to usb functions 33 33 static inline unsigned long ni_usb_timeout_msecs(unsigned int usec) 34 34 { 35 35 if (usec == 0) ··· 327 327 board->status &= ~clear_mask; 328 328 board->status &= ~ni_usb_ibsta_mask; 329 329 board->status |= ni_usb_ibsta & ni_usb_ibsta_mask; 330 - //FIXME should generate events on DTAS and DCAS 330 + // FIXME should generate events on DTAS and DCAS 331 331 332 332 spin_lock_irqsave(&board->spinlock, flags); 333 333 /* remove set status bits from monitored set why ?***/ ··· 569 569 mutex_unlock(&ni_priv->addressed_transfer_lock); 570 570 571 571 ni_usb_parse_reg_write_status_block(in_data, &status, &reg_writes_completed); 572 - //FIXME parse extra 09 status bits and termination 572 + // FIXME parse extra 09 status bits and termination 573 573 kfree(in_data); 574 574 if (status.id != NIUSB_REG_WRITE_ID) { 575 575 dev_err(&usb_dev->dev, "parse error, id=0x%x != NIUSB_REG_WRITE_ID\n", status.id); ··· 1106 1106 return 0; 1107 1107 } 1108 1108 1109 - //FIXME maybe the interface should have a "pulse interface clear" function that can return an error? 1109 + // FIXME maybe the interface should have a "pulse interface clear" function that can return an error? 1110 1110 static void ni_usb_interface_clear(struct gpib_board *board, int assert) 1111 1111 { 1112 1112 int retval; ··· 1363 1363 return -ENOMEM; 1364 1364 1365 1365 out_data[i++] = NIUSB_IBRPP_ID; 1366 - out_data[i++] = 0xf0; //FIXME: this should be the parallel poll timeout code 1366 + out_data[i++] = 0xf0; // FIXME: this should be the parallel poll timeout code 1367 1367 out_data[i++] = 0x0; 1368 1368 out_data[i++] = 0x0; 1369 1369 i += ni_usb_bulk_termination(&out_data[i]);
+5 -5
drivers/staging/gpib/ni_usb/ni_usb_gpib.h
··· 72 72 struct urb *bulk_urb; 73 73 struct urb *interrupt_urb; 74 74 u8 interrupt_buffer[0x11]; 75 - struct mutex addressed_transfer_lock; // protect transfer lock 76 - struct mutex bulk_transfer_lock; // protect bulk message sends 77 - struct mutex control_transfer_lock; // protect control messages 78 - struct mutex interrupt_transfer_lock; // protect interrupt messages 75 + struct mutex addressed_transfer_lock; // protect transfer lock 76 + struct mutex bulk_transfer_lock; // protect bulk message sends 77 + struct mutex control_transfer_lock; // protect control messages 78 + struct mutex interrupt_transfer_lock; // protect interrupt messages 79 79 struct timer_list bulk_timer; 80 80 struct ni_usb_urb_ctx context; 81 81 int product_id; ··· 145 145 * CIC with no listener 146 146 */ 147 147 NIUSB_NO_LISTENER_ERROR = 8, 148 - // get NIUSB_TIMEOUT_ERROR on board read/write timeout 148 + /* get NIUSB_TIMEOUT_ERROR on board read/write timeout */ 149 149 NIUSB_TIMEOUT_ERROR = 10, 150 150 }; 151 151
+2 -2
drivers/staging/gpib/pc2/pc2_gpib.c
··· 36 36 static const int pc2a_reg_offset = 0x400; 37 37 static const int pc2_reg_offset = 1; 38 38 39 - //interrupt service routine 39 + // interrupt service routine 40 40 static irqreturn_t pc2_interrupt(int irq, void *arg); 41 41 static irqreturn_t pc2a_interrupt(int irq, void *arg); 42 42 ··· 593 593 .parallel_poll_configure = pc2_parallel_poll_configure, 594 594 .parallel_poll_response = pc2_parallel_poll_response, 595 595 .local_parallel_poll_mode = NULL, // XXX 596 - .line_status = NULL, //XXX 596 + .line_status = NULL, // XXX 597 597 .update_status = pc2_update_status, 598 598 .primary_address = pc2_primary_address, 599 599 .secondary_address = pc2_secondary_address,
+5 -5
drivers/staging/gpib/tms9914/tms9914.c
··· 647 647 } else if (cmd_byte == MTA(board->pad)) { 648 648 priv->primary_talk_addressed = 1; 649 649 if (board->sad < 0) 650 - //make active talker 650 + // make active talker 651 651 write_byte(priv, AUX_TON | AUX_CS, AUXCR); 652 652 } else if (board->sad >= 0 && priv->primary_talk_addressed && 653 653 cmd_byte == MSA(board->sad)) { ··· 730 730 if (status0 & HR_SPAS) { 731 731 priv->spoll_status &= ~request_service_bit; 732 732 write_byte(priv, priv->spoll_status, SPMR); 733 - //FIXME: set SPOLL status bit 733 + // FIXME: set SPOLL status bit 734 734 } 735 735 // record service request in status 736 736 if (status1 & HR_SRQ) ··· 841 841 842 842 /* parallel poll unconfigure */ 843 843 write_byte(priv, 0, PPR); 844 - // request for data holdoff 844 + /* request for data holdoff */ 845 845 tms9914_set_holdoff_mode(priv, TMS9914_HOLDOFF_ALL); 846 846 } 847 847 EXPORT_SYMBOL_GPL(tms9914_board_reset); ··· 852 852 tms9914_primary_address(board, priv, board->pad); 853 853 tms9914_secondary_address(board, priv, board->sad, board->sad >= 0); 854 854 855 - // enable tms9914 interrupts 855 + /* enable tms9914 interrupts */ 856 856 priv->imr0_bits |= HR_MACIE | HR_RLCIE | HR_ENDIE | HR_BOIE | HR_BIIE | 857 857 HR_SPASIE; 858 858 priv->imr1_bits |= HR_MAIE | HR_SRQIE | HR_UNCIE | HR_ERRIE | HR_IFCIE | ··· 861 861 write_byte(priv, priv->imr1_bits, IMR1); 862 862 write_byte(priv, AUX_DAI, AUXCR); 863 863 864 - // turn off reset state 864 + /* turn off reset state */ 865 865 write_byte(priv, AUX_CHIP_RESET, AUXCR); 866 866 } 867 867 EXPORT_SYMBOL_GPL(tms9914_online);
+5 -5
drivers/staging/gpib/tnt4882/mite.h
··· 219 219 #define MITE_AMHOST_A24_BLOCK 0x3b 220 220 221 221 enum mite_registers { 222 - MITE_IODWBSR = 0xc0, //IO Device Window Base Size Register 223 - MITE_CSIGR = 0x460, //chip signature 224 - MITE_IODWBSR_1 = 0xc4, // IO Device Window Base Size Register 1 (used by 6602 boards) 222 + MITE_IODWBSR = 0xc0, // IO Device Window Base Size Register 223 + MITE_CSIGR = 0x460, // chip signature 224 + MITE_IODWBSR_1 = 0xc4, // IO Device Window Base Size Register 1 (used by 6602 boards) 225 225 MITE_IODWCR_1 = 0xf4 226 226 }; 227 227 228 228 enum MITE_IODWBSR_bits { 229 - WENAB = 0x80, // window enable 230 - WENAB_6602 = 0x8c // window enable for 6602 boards 229 + WENAB = 0x80, // window enable 230 + WENAB_6602 = 0x8c // window enable for 6602 boards 231 231 }; 232 232 233 233 #endif
+2 -3
drivers/staging/gpib/tnt4882/tnt4882_gpib.c
··· 570 570 571 571 if (isr0_bits & TNT_IFCI_BIT) 572 572 push_gpib_event(board, EVENT_IFC); 573 - //XXX don't need this wakeup, one below should do? 573 + // XXX don't need this wakeup, one below should do? 574 574 // wake_up_interruptible(&board->wait); 575 575 576 576 if (isr3_bits & HR_NFF) ··· 730 730 if (tnt_priv->nec7210_priv.type != NEC7210) { 731 731 tnt_priv->auxg_bits |= RPP2_BIT; 732 732 write_byte(&tnt_priv->nec7210_priv, tnt_priv->auxg_bits, AUXMR); 733 - udelay(2); //FIXME use parallel poll timeout 733 + udelay(2); // FIXME use parallel poll timeout 734 734 *result = read_byte(&tnt_priv->nec7210_priv, CPTR); 735 735 tnt_priv->auxg_bits &= ~RPP2_BIT; 736 736 write_byte(&tnt_priv->nec7210_priv, tnt_priv->auxg_bits, AUXMR); ··· 1522 1522 #include <linux/moduleparam.h> 1523 1523 #include <linux/ptrace.h> 1524 1524 #include <linux/timer.h> 1525 - #include <linux/ioport.h> 1526 1525 #include <linux/io.h> 1527 1526 1528 1527 #include <pcmcia/cistpl.h>
-40
drivers/staging/octeon/ethernet-tx.c
··· 573 573 574 574 if (skb->protocol == htons(ETH_P_IP)) { 575 575 work->word2.s.ip_offset = 14; 576 - #if 0 577 - work->word2.s.vlan_valid = 0; /* FIXME */ 578 - work->word2.s.vlan_cfi = 0; /* FIXME */ 579 - work->word2.s.vlan_id = 0; /* FIXME */ 580 - work->word2.s.dec_ipcomp = 0; /* FIXME */ 581 - #endif 582 576 work->word2.s.tcp_or_udp = 583 577 (ip_hdr(skb)->protocol == IPPROTO_TCP) || 584 578 (ip_hdr(skb)->protocol == IPPROTO_UDP); 585 - #if 0 586 - /* FIXME */ 587 - work->word2.s.dec_ipsec = 0; 588 - /* We only support IPv4 right now */ 589 - work->word2.s.is_v6 = 0; 590 - /* Hardware would set to zero */ 591 - work->word2.s.software = 0; 592 - /* No error, packet is internal */ 593 - work->word2.s.L4_error = 0; 594 - #endif 595 579 work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) || 596 580 (ip_hdr(skb)->frag_off == 597 581 cpu_to_be16(1 << 14))); 598 - #if 0 599 - /* Assume Linux is sending a good packet */ 600 - work->word2.s.IP_exc = 0; 601 - #endif 602 582 work->word2.s.is_bcast = (skb->pkt_type == PACKET_BROADCAST); 603 583 work->word2.s.is_mcast = (skb->pkt_type == PACKET_MULTICAST); 604 - #if 0 605 - /* This is an IP packet */ 606 - work->word2.s.not_IP = 0; 607 - /* No error, packet is internal */ 608 - work->word2.s.rcv_error = 0; 609 - /* No error, packet is internal */ 610 - work->word2.s.err_code = 0; 611 - #endif 612 584 613 585 /* 614 586 * When copying the data, include 4 bytes of the ··· 590 618 memcpy(work->packet_data, skb->data + 10, 591 619 sizeof(work->packet_data)); 592 620 } else { 593 - #if 0 594 - work->word2.snoip.vlan_valid = 0; /* FIXME */ 595 - work->word2.snoip.vlan_cfi = 0; /* FIXME */ 596 - work->word2.snoip.vlan_id = 0; /* FIXME */ 597 - work->word2.snoip.software = 0; /* Hardware would set to zero */ 598 - #endif 599 621 work->word2.snoip.is_rarp = skb->protocol == htons(ETH_P_RARP); 600 622 work->word2.snoip.is_arp = skb->protocol == htons(ETH_P_ARP); 601 623 work->word2.snoip.is_bcast = ··· 597 631 work->word2.snoip.is_mcast = 598 632 (skb->pkt_type == PACKET_MULTICAST); 599 633 work->word2.snoip.not_IP = 1; /* IP was done up above */ 600 - #if 0 601 - /* No error, packet is internal */ 602 - work->word2.snoip.rcv_error = 0; 603 - /* No error, packet is internal */ 604 - work->word2.snoip.err_code = 0; 605 - #endif 606 634 memcpy(work->packet_data, skb->data, sizeof(work->packet_data)); 607 635 } 608 636
+69 -67
drivers/staging/octeon/octeon-stubs.h
··· 43 43 #define CVMX_POW_WQ_INT_PC 0 44 44 45 45 union cvmx_pip_wqe_word2 { 46 - uint64_t u64; 46 + u64 u64; 47 + 47 48 struct { 48 - uint64_t bufs:8; 49 - uint64_t ip_offset:8; 50 - uint64_t vlan_valid:1; 51 - uint64_t vlan_stacked:1; 52 - uint64_t unassigned:1; 53 - uint64_t vlan_cfi:1; 54 - uint64_t vlan_id:12; 55 - uint64_t pr:4; 56 - uint64_t unassigned2:8; 57 - uint64_t dec_ipcomp:1; 58 - uint64_t tcp_or_udp:1; 59 - uint64_t dec_ipsec:1; 60 - uint64_t is_v6:1; 61 - uint64_t software:1; 62 - uint64_t L4_error:1; 63 - uint64_t is_frag:1; 64 - uint64_t IP_exc:1; 65 - uint64_t is_bcast:1; 66 - uint64_t is_mcast:1; 67 - uint64_t not_IP:1; 68 - uint64_t rcv_error:1; 69 - uint64_t err_code:8; 49 + u64 bufs : 8; 50 + u64 ip_offset : 8; 51 + u64 vlan_valid : 1; 52 + u64 vlan_stacked : 1; 53 + u64 unassigned : 1; 54 + u64 vlan_cfi : 1; 55 + u64 vlan_id : 12; 56 + u64 pr : 4; 57 + u64 unassigned2 : 8; 58 + u64 dec_ipcomp : 1; 59 + u64 tcp_or_udp : 1; 60 + u64 dec_ipsec : 1; 61 + u64 is_v6 : 1; 62 + u64 software : 1; 63 + u64 L4_error : 1; 64 + u64 is_frag : 1; 65 + u64 IP_exc : 1; 66 + u64 is_bcast : 1; 67 + u64 is_mcast : 1; 68 + u64 not_IP : 1; 69 + u64 rcv_error : 1; 70 + u64 err_code : 8; 70 71 } s; 72 + 71 73 struct { 72 - uint64_t bufs:8; 73 - uint64_t ip_offset:8; 74 - uint64_t vlan_valid:1; 75 - uint64_t vlan_stacked:1; 76 - uint64_t unassigned:1; 77 - uint64_t vlan_cfi:1; 78 - uint64_t vlan_id:12; 79 - uint64_t port:12; 80 - uint64_t dec_ipcomp:1; 81 - uint64_t tcp_or_udp:1; 82 - uint64_t dec_ipsec:1; 83 - uint64_t is_v6:1; 84 - uint64_t software:1; 85 - uint64_t L4_error:1; 86 - uint64_t is_frag:1; 87 - uint64_t IP_exc:1; 88 - uint64_t is_bcast:1; 89 - uint64_t is_mcast:1; 90 - uint64_t not_IP:1; 91 - uint64_t rcv_error:1; 92 - uint64_t err_code:8; 74 + u64 bufs : 8; 75 + u64 ip_offset : 8; 76 + u64 vlan_valid : 1; 77 + u64 vlan_stacked : 1; 78 + u64 unassigned : 1; 79 + u64 vlan_cfi : 1; 80 + u64 vlan_id : 12; 81 + u64 port : 12; 82 + u64 dec_ipcomp : 1; 83 + u64 tcp_or_udp : 1; 84 + u64 dec_ipsec : 1; 85 + u64 is_v6 : 1; 86 + u64 software : 1; 87 + u64 L4_error : 1; 88 + u64 is_frag : 1; 89 + u64 IP_exc : 1; 90 + u64 is_bcast : 1; 91 + u64 is_mcast : 1; 92 + u64 not_IP : 1; 93 + u64 rcv_error : 1; 94 + u64 err_code : 8; 93 95 } s_cn68xx; 94 96 95 97 struct { 96 - uint64_t unused1:16; 97 - uint64_t vlan:16; 98 - uint64_t unused2:32; 98 + u64 unused1 : 16; 99 + u64 vlan : 16; 100 + u64 unused2 : 32; 99 101 } svlan; 100 - struct { 101 - uint64_t bufs:8; 102 - uint64_t unused:8; 103 - uint64_t vlan_valid:1; 104 - uint64_t vlan_stacked:1; 105 - uint64_t unassigned:1; 106 - uint64_t vlan_cfi:1; 107 - uint64_t vlan_id:12; 108 - uint64_t pr:4; 109 - uint64_t unassigned2:12; 110 - uint64_t software:1; 111 - uint64_t unassigned3:1; 112 - uint64_t is_rarp:1; 113 - uint64_t is_arp:1; 114 - uint64_t is_bcast:1; 115 - uint64_t is_mcast:1; 116 - uint64_t not_IP:1; 117 - uint64_t rcv_error:1; 118 - uint64_t err_code:8; 119 - } snoip; 120 102 103 + struct { 104 + u64 bufs : 8; 105 + u64 unused : 8; 106 + u64 vlan_valid : 1; 107 + u64 vlan_stacked : 1; 108 + u64 unassigned : 1; 109 + u64 vlan_cfi : 1; 110 + u64 vlan_id : 12; 111 + u64 pr : 4; 112 + u64 unassigned2 : 12; 113 + u64 software : 1; 114 + u64 unassigned3 : 1; 115 + u64 is_rarp : 1; 116 + u64 is_arp : 1; 117 + u64 is_bcast : 1; 118 + u64 is_mcast : 1; 119 + u64 not_IP : 1; 120 + u64 rcv_error : 1; 121 + u64 err_code : 8; 122 + } snoip; 121 123 }; 122 124 123 125 union cvmx_pip_wqe_word0 {
-2
drivers/staging/rtl8723bs/Makefile
··· 48 48 hal/HalHWImg8723B_RF.o \ 49 49 hal/HalPhyRf_8723B.o \ 50 50 os_dep/ioctl_cfg80211.o \ 51 - os_dep/mlme_linux.o \ 52 51 os_dep/osdep_service.o \ 53 52 os_dep/os_intfs.o \ 54 - os_dep/recv_linux.o \ 55 53 os_dep/sdio_intf.o \ 56 54 os_dep/sdio_ops_linux.o \ 57 55 os_dep/wifi_regd.o \
+3 -5
drivers/staging/rtl8723bs/core/rtw_ap.c
··· 258 258 } else { 259 259 /* TODO: Aging mechanism to digest frames in sleep_q to */ 260 260 /* avoid running out of xmitframe */ 261 - if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt) 262 - && padapter->xmitpriv.free_xmitframe_cnt < (( 263 - NR_XMITFRAME / pstapriv->asoc_list_cnt 264 - ) / 2) 265 - ) 261 + if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt) && 262 + padapter->xmitpriv.free_xmitframe_cnt < 263 + ((NR_XMITFRAME / pstapriv->asoc_list_cnt) / 2)) 266 264 wakeup_sta_to_xmit(padapter, psta); 267 265 } 268 266 }
+10 -159
drivers/staging/rtl8723bs/core/rtw_efuse.c
··· 29 29 #define REG_EFUSE_CTRL 0x0030 30 30 #define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */ 31 31 32 - static bool 33 - Efuse_Read1ByteFromFakeContent(u16 Offset, u8 *Value) 34 - { 35 - if (Offset >= EFUSE_MAX_HW_SIZE) 36 - return false; 37 - if (fakeEfuseBank == 0) 38 - *Value = fakeEfuseContent[Offset]; 39 - else 40 - *Value = fakeBTEfuseContent[fakeEfuseBank - 1][Offset]; 41 - return true; 42 - } 43 - 44 - static bool 45 - Efuse_Write1ByteToFakeContent(u16 Offset, u8 Value) 46 - { 47 - if (Offset >= EFUSE_MAX_HW_SIZE) 48 - return false; 49 - if (fakeEfuseBank == 0) 50 - fakeEfuseContent[Offset] = Value; 51 - else 52 - fakeBTEfuseContent[fakeEfuseBank - 1][Offset] = Value; 53 - return true; 54 - } 55 - 56 - /*----------------------------------------------------------------------------- 57 - * Function: Efuse_PowerSwitch 58 - * 59 - * Overview: When we want to enable write operation, we should change to 60 - * pwr on state. When we stop write, we should switch to 500k mode 61 - * and disable LDO 2.5V. 62 - * 63 - * Input: NONE 64 - * 65 - * Output: NONE 66 - * 67 - * Return: NONE 68 - * 69 - * Revised History: 70 - * When Who Remark 71 - * 11/17/2008 MHC Create Version 0. 72 - * 73 - */ 74 - void 75 - Efuse_PowerSwitch( 76 - struct adapter *padapter, 77 - u8 bWrite, 78 - u8 PwrState) 79 - { 80 - Hal_EfusePowerSwitch(padapter, bWrite, PwrState); 81 - } 82 - 83 32 /* 11/16/2008 MH Add description. Get current efuse area enabled word!!. */ 84 33 u8 85 34 Efuse_CalculateWordCnts(u8 word_en) ··· 44 95 if (!(word_en & BIT(3))) 45 96 word_cnts++; 46 97 return word_cnts; 47 - } 48 - 49 - /* */ 50 - /* Description: */ 51 - /* 1. Execute E-Fuse read byte operation according as map offset and */ 52 - /* save to E-Fuse table. */ 53 - /* 2. Referred from SD1 Richard. */ 54 - /* */ 55 - /* Assumption: */ 56 - /* 1. Boot from E-Fuse and successfully auto-load. */ 57 - /* 2. PASSIVE_LEVEL (USB interface) */ 58 - /* */ 59 - /* Created by Roger, 2008.10.21. */ 60 - /* */ 61 - /* 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description. */ 62 - /* 2. Add efuse utilization collect. */ 63 - /* 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1 */ 64 - /* write addr must be after sec5. */ 65 - /* */ 66 - 67 - void 68 - efuse_ReadEFuse( 69 - struct adapter *Adapter, 70 - u8 efuseType, 71 - u16 _offset, 72 - u16 _size_byte, 73 - u8 *pbuf, 74 - bool bPseudoTest 75 - ); 76 - void 77 - efuse_ReadEFuse( 78 - struct adapter *Adapter, 79 - u8 efuseType, 80 - u16 _offset, 81 - u16 _size_byte, 82 - u8 *pbuf, 83 - bool bPseudoTest 84 - ) 85 - { 86 - Hal_ReadEFuse(Adapter, efuseType, _offset, _size_byte, pbuf, bPseudoTest); 87 - } 88 - 89 - void 90 - EFUSE_GetEfuseDefinition( 91 - struct adapter *padapter, 92 - u8 efuseType, 93 - u8 type, 94 - void *pOut, 95 - bool bPseudoTest 96 - ) 97 - { 98 - Hal_GetEfuseDefinition(padapter, efuseType, type, pOut, bPseudoTest); 99 98 } 100 99 101 100 /*----------------------------------------------------------------------------- ··· 72 175 u32 k = 0; 73 176 u16 contentLen = 0; 74 177 75 - EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false); 178 + Hal_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen); 76 179 77 180 if (Address < contentLen) {/* E-fuse 512Byte */ 78 181 /* Write E-fuse Register address bit0~7 */ ··· 107 210 efuse_OneByteRead( 108 211 struct adapter *padapter, 109 212 u16 addr, 110 - u8 *data, 111 - bool bPseudoTest) 213 + u8 *data) 112 214 { 113 215 u32 tmpidx = 0; 114 216 u8 bResult; 115 217 u8 readbyte; 116 - 117 - if (bPseudoTest) 118 - return Efuse_Read1ByteFromFakeContent(addr, data); 119 218 120 219 /* <20130121, Kordan> For SMIC EFUSE specificatoin. */ 121 220 /* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */ ··· 144 251 return bResult; 145 252 } 146 253 147 - /* 11/16/2008 MH Write one byte to reald Efuse. */ 148 - u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoTest) 149 - { 150 - u8 tmpidx = 0; 151 - u8 bResult = false; 152 - 153 - if (bPseudoTest) 154 - return Efuse_Write1ByteToFakeContent(addr, data); 155 - 156 - /* -----------------e-fuse reg ctrl --------------------------------- */ 157 - /* address */ 158 - 159 - /* <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut. */ 160 - 161 - /* <20130121, Kordan> For SMIC EFUSE specificatoin. */ 162 - /* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */ 163 - /* PHY_SetMacReg(padapter, 0x34, BIT11, 1); */ 164 - rtw_write16(padapter, 0x34, rtw_read16(padapter, 0x34) | (BIT11)); 165 - rtw_write32(padapter, EFUSE_CTRL, 0x90600000 | ((addr << 8 | data))); 166 - 167 - while ((0x80 & rtw_read8(padapter, EFUSE_CTRL + 3)) && (tmpidx < 100)) { 168 - mdelay(1); 169 - tmpidx++; 170 - } 171 - 172 - if (tmpidx < 100) 173 - bResult = true; 174 - else 175 - bResult = false; 176 - 177 - /* disable Efuse program enable */ 178 - PHY_SetMacReg(padapter, EFUSE_TEST, BIT(11), 0); 179 - 180 - return bResult; 181 - } 182 - 183 254 /*----------------------------------------------------------------------------- 184 255 * Function: Efuse_ReadAllMap 185 256 * ··· 160 303 * 11/11/2008 MHC Create Version 0. 161 304 * 162 305 */ 163 - void 164 - Efuse_ReadAllMap( 165 - struct adapter *padapter, 166 - u8 efuseType, 167 - u8 *Efuse, 168 - bool bPseudoTest); 169 - void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse, bool bPseudoTest) 306 + static void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse) 170 307 { 171 308 u16 mapLen = 0; 172 309 173 - Efuse_PowerSwitch(padapter, false, true); 310 + Hal_EfusePowerSwitch(padapter, true); 174 311 175 - EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest); 312 + Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen); 176 313 177 - efuse_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse, bPseudoTest); 314 + Hal_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse); 178 315 179 - Efuse_PowerSwitch(padapter, false, false); 316 + Hal_EfusePowerSwitch(padapter, false); 180 317 } 181 318 182 319 /*----------------------------------------------------------------------------- ··· 237 386 * 11/13/2008 MHC Create Version 0. 238 387 * 239 388 */ 240 - void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType, bool bPseudoTest) 389 + void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType) 241 390 { 242 391 struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); 243 392 u16 mapLen = 0; 244 393 245 - EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest); 394 + Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen); 246 395 247 396 if (pEEPROM->bautoload_fail_flag) 248 397 memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen); 249 398 else 250 - Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest); 399 + Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data); 251 400 252 401 /* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */ 253 402 /* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */
+172 -59
drivers/staging/rtl8723bs/core/rtw_mlme.c
··· 9 9 #include <hal_btcoex.h> 10 10 #include <linux/jiffies.h> 11 11 12 + static void _dynamic_check_timer_handler(struct timer_list *t) 13 + { 14 + struct adapter *adapter = 15 + timer_container_of(adapter, t, mlmepriv.dynamic_chk_timer); 16 + 17 + rtw_dynamic_check_timer_handler(adapter); 18 + 19 + _set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000); 20 + } 21 + 22 + static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t) 23 + { 24 + struct adapter *adapter = 25 + timer_container_of(adapter, t, mlmepriv.set_scan_deny_timer); 26 + 27 + rtw_clear_scan_deny(adapter); 28 + } 29 + 30 + static void rtw_init_mlme_timer(struct adapter *padapter) 31 + { 32 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 33 + 34 + timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0); 35 + timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0); 36 + timer_setup(&pmlmepriv->dynamic_chk_timer, 37 + _dynamic_check_timer_handler, 0); 38 + timer_setup(&pmlmepriv->set_scan_deny_timer, 39 + _rtw_set_scan_deny_timer_hdl, 0); 40 + } 41 + 12 42 int rtw_init_mlme_priv(struct adapter *padapter) 13 43 { 14 44 int i; ··· 200 170 201 171 void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) 202 172 { 203 - 204 173 struct __queue *free_queue = &pmlmepriv->free_bss_pool; 205 174 206 175 if (!pnetwork) ··· 254 225 255 226 phead = get_list_head(scanned_queue); 256 227 list_for_each_safe(plist, tmp, phead) { 257 - 258 228 pnetwork = list_entry(plist, struct wlan_network, list); 259 229 260 230 _rtw_free_network(pmlmepriv, pnetwork, isfreeall); 261 - 262 231 } 263 232 264 233 spin_unlock_bh(&scanned_queue->lock); ··· 345 318 ret = true; 346 319 347 320 return ret; 348 - 349 321 } 350 322 351 323 inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b) ··· 374 348 (d_cap & WLAN_CAPABILITY_IBSS)) && 375 349 ((s_cap & WLAN_CAPABILITY_ESS) == 376 350 (d_cap & WLAN_CAPABILITY_ESS)); 377 - 378 351 } 379 352 380 353 struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network) ··· 405 380 phead = get_list_head(scanned_queue); 406 381 407 382 list_for_each(plist, phead) { 408 - 409 383 pwlan = list_entry(plist, struct wlan_network, list); 410 384 411 385 if (!pwlan->fixed) { ··· 413 389 } 414 390 } 415 391 return oldest; 416 - 417 392 } 418 393 419 394 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, ··· 447 424 sq_final = dst->phy_info.signal_quality; 448 425 rssi_final = dst->rssi; 449 426 } 450 - 451 427 } 452 428 453 429 if (update_ie) { ··· 508 486 509 487 if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned)) 510 488 oldest = pnetwork; 511 - 512 489 } 513 490 514 491 /* If we didn't find a match, then get a new network slot to initialize ··· 551 530 pnetwork->network.phy_info.signal_quality = 0; 552 531 553 532 list_add_tail(&pnetwork->list, &queue->queue); 554 - 555 533 } 556 534 } else { 557 535 /* we have an entry and we are going to update it. But this entry may ··· 587 567 rtw_update_scanned_network(adapter, pnetwork); 588 568 } 589 569 590 - /* select the desired network based on the capability of the (i)bss. */ 591 - /* check items: (1) security */ 592 - /* (2) network_type */ 593 - /* (3) WMM */ 594 - /* (4) HT */ 595 - /* (5) others */ 570 + /* select the desired network based on the capability of the (i)bss. 571 + * check items: 572 + * (1) security 573 + * (2) network_type 574 + * (3) WMM 575 + * (4) HT 576 + * (5) others 577 + */ 596 578 int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork); 597 579 int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork) 598 580 { ··· 613 591 return true; 614 592 else 615 593 return false; 616 - 617 594 } 618 595 if (adapter->registrypriv.wifi_spec == 1) { /* for correct flow of 8021X to do.... */ 619 596 u8 *p = NULL; ··· 889 868 pmlmepriv->to_join = false; 890 869 891 870 if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { 892 - 893 871 set_fwstate(pmlmepriv, _FW_LINKED); 894 872 895 - rtw_os_indicate_connect(padapter); 873 + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || 874 + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { 875 + rtw_cfg80211_ibss_indicate_connect(padapter); 876 + } else { 877 + rtw_cfg80211_indicate_connect(padapter); 878 + } 879 + 880 + netif_carrier_on(padapter->pnetdev); 881 + 882 + if (padapter->pid[2] != 0) 883 + rtw_signal_process(padapter->pid[2], SIGALRM); 896 884 } 897 885 898 886 rtw_set_to_roam(padapter, 0); 899 887 rtw_set_scan_deny(padapter, 3000); 900 - 901 888 } 902 889 903 890 /* ··· 920 891 if (rtw_to_roam(padapter) > 0) 921 892 _clr_fwstate_(pmlmepriv, _FW_LINKED); 922 893 923 - if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) 924 - || (rtw_to_roam(padapter) <= 0) 925 - ) { 926 - rtw_os_indicate_disconnect(padapter); 894 + if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) || rtw_to_roam(padapter) <= 0) { 895 + /* Do it first for tx broadcast pkt after disconnection issue! */ 896 + netif_carrier_off(padapter->pnetdev); 897 + 898 + rtw_cfg80211_indicate_disconnect(padapter); 899 + 900 + /* modify for CONFIG_IEEE80211W, none 11w also can use the same command */ 901 + rtw_reset_securitypriv_cmd(padapter); 927 902 928 903 /* set ips_deny_time to avoid enter IPS before LPS leave */ 929 904 rtw_set_ips_deny(padapter, 3000); ··· 942 909 943 910 inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted) 944 911 { 945 - rtw_os_indicate_scan_done(padapter, aborted); 912 + rtw_cfg80211_indicate_scan_done(padapter, aborted); 946 913 947 914 if ((!adapter_to_pwrctl(padapter)->bInSuspend) && 948 915 (!check_fwstate(&padapter->mlmepriv, ··· 962 929 pmlmeext->scan_abort = true; 963 930 while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) 964 931 && jiffies_to_msecs(start) <= 200) { 965 - 966 932 if (adapter->bDriverStopped || adapter->bSurpriseRemoved) 967 933 break; 968 934 ··· 1054 1022 } 1055 1023 1056 1024 return psta; 1057 - 1058 1025 } 1059 1026 1060 1027 /* pnetwork : returns from rtw_joinbss_event_callback */ ··· 1102 1071 (cur_network->network.ie_length)); 1103 1072 1104 1073 rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config); 1074 + } 1075 + 1076 + static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE]; 1077 + void rtw_reset_securitypriv(struct adapter *adapter) 1078 + { 1079 + u8 backupPMKIDIndex = 0; 1080 + u8 backupTKIPCountermeasure = 0x00; 1081 + u32 backupTKIPcountermeasure_time = 0; 1082 + /* add for CONFIG_IEEE80211W, none 11w also can use */ 1083 + struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; 1084 + 1085 + spin_lock_bh(&adapter->security_key_mutex); 1086 + 1087 + if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { 1088 + /* 802.1x */ 1089 + /* Added by Albert 2009/02/18 */ 1090 + /* We have to backup the PMK information for WiFi PMK Caching test item. */ 1091 + /* */ 1092 + /* Backup the btkip_countermeasure information. */ 1093 + /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ 1094 + 1095 + memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE); 1096 + backupPMKIDIndex = adapter->securitypriv.PMKIDIndex; 1097 + backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure; 1098 + backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time; 1099 + 1100 + /* reset RX BIP packet number */ 1101 + pmlmeext->mgnt_80211w_IPN_rx = 0; 1102 + 1103 + memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); 1104 + 1105 + /* Added by Albert 2009/02/18 */ 1106 + /* Restore the PMK information to securitypriv structure for the following connection. */ 1107 + memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE); 1108 + adapter->securitypriv.PMKIDIndex = backupPMKIDIndex; 1109 + adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure; 1110 + adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time; 1111 + 1112 + adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; 1113 + adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; 1114 + 1115 + } else { 1116 + /* reset values in securitypriv */ 1117 + /* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */ 1118 + /* */ 1119 + struct security_priv *psec_priv = &adapter->securitypriv; 1120 + 1121 + psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */ 1122 + psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_; 1123 + psec_priv->dot11PrivacyKeyIndex = 0; 1124 + 1125 + psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_; 1126 + psec_priv->dot118021XGrpKeyid = 1; 1127 + 1128 + psec_priv->ndisauthtype = Ndis802_11AuthModeOpen; 1129 + psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled; 1130 + /* */ 1131 + } 1132 + /* add for CONFIG_IEEE80211W, none 11w also can use */ 1133 + spin_unlock_bh(&adapter->security_key_mutex); 1105 1134 } 1106 1135 1107 1136 /* Notes: the function could be > passive_level (the same context as Rx tasklet) */ ··· 1488 1397 1489 1398 if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || 1490 1399 check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { 1491 - 1492 1400 rtw_free_stainfo(adapter, psta); 1493 1401 1494 1402 if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */ 1495 1403 u8 ret = _SUCCESS; 1404 + 1496 1405 spin_lock_bh(&pmlmepriv->scanned_queue.lock); 1497 1406 /* free old ibss network */ 1498 1407 pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address); ··· 1522 1431 if (ret != _SUCCESS) 1523 1432 goto unlock; 1524 1433 } 1525 - 1526 1434 } 1527 1435 1528 1436 unlock: ··· 1580 1490 1581 1491 /* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */ 1582 1492 rtw_cfg80211_indicate_disconnect(adapter); 1583 - 1584 1493 } 1585 1494 1586 1495 spin_unlock_bh(&pmlmepriv->lock); ··· 1629 1540 1630 1541 if (pmlmepriv->auto_scan_int_ms != 0 1631 1542 && jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) { 1632 - 1633 1543 if (!padapter->registrypriv.wifi_spec) { 1634 1544 if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) 1635 1545 goto exit; ··· 1761 1673 phead = get_list_head(queue); 1762 1674 1763 1675 list_for_each(mlme->pscanned, phead) { 1764 - 1765 1676 pnetwork = list_entry(mlme->pscanned, struct wlan_network, 1766 1677 list); 1767 1678 1768 1679 rtw_check_roaming_candidate(mlme, &candidate, pnetwork); 1769 - 1770 1680 } 1771 1681 1772 1682 if (!candidate) { ··· 1856 1770 1857 1771 phead = get_list_head(queue); 1858 1772 list_for_each(pmlmepriv->pscanned, phead) { 1859 - 1860 1773 pnetwork = list_entry(pmlmepriv->pscanned, 1861 1774 struct wlan_network, list); 1862 1775 1863 1776 rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); 1864 - 1865 1777 } 1866 1778 1867 1779 if (!candidate) { ··· 1925 1841 signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, signed int keyid, u8 set_tx, bool enqueue) 1926 1842 { 1927 1843 u8 keylen; 1928 - struct cmd_obj *pcmd; 1844 + struct cmd_obj *pcmd; 1929 1845 struct setkey_parm *psetkeyparm; 1930 - struct cmd_priv *pcmdpriv = &adapter->cmdpriv; 1846 + struct cmd_priv *pcmdpriv = &adapter->cmdpriv; 1931 1847 signed int res = _SUCCESS; 1932 1848 1933 1849 psetkeyparm = rtw_zmalloc(sizeof(struct setkey_parm)); ··· 1947 1863 adapter->securitypriv.key_mask |= BIT(psetkeyparm->keyid); 1948 1864 1949 1865 switch (psetkeyparm->algorithm) { 1950 - 1951 1866 case _WEP40_: 1952 1867 keylen = 5; 1953 1868 memcpy(&psetkeyparm->key[0], &psecuritypriv->dot11DefKey[keyid].skey[0], keylen); ··· 2022 1939 } 2023 1940 2024 1941 return ielength; 2025 - 2026 1942 } 2027 1943 2028 - /* */ 2029 - /* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */ 2030 - /* Added by Annie, 2006-05-07. */ 2031 - /* */ 2032 - /* Search by BSSID, */ 2033 - /* Return Value: */ 2034 - /* -1 :if there is no pre-auth key in the table */ 2035 - /* >= 0 :if there is pre-auth key, and return the entry id */ 2036 - /* */ 2037 - /* */ 2038 - 1944 + /* Ported from 8185: IsInPreAuthKeyList(). 1945 + * (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) 1946 + * Added by Annie, 2006-05-07. 1947 + * 1948 + * Search by BSSID, 1949 + * 1950 + * Return Value: 1951 + * -1: if there is no pre-auth key in the table 1952 + * >=0: if there is pre-auth key, and return the entry id 1953 + */ 2039 1954 static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid) 2040 1955 { 2041 1956 struct security_priv *p = &Adapter->securitypriv; ··· 2069 1988 ie[13] += 18;/* PMKID length = 2+16 */ 2070 1989 } 2071 1990 return ie_len; 1991 + } 1992 + 1993 + static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) 1994 + { 1995 + uint len; 1996 + u8 *buff, *p, i; 1997 + union iwreq_data wrqu; 1998 + 1999 + buff = NULL; 2000 + if (authmode == WLAN_EID_VENDOR_SPECIFIC) { 2001 + buff = rtw_zmalloc(IW_CUSTOM_MAX); 2002 + if (!buff) 2003 + return; 2004 + 2005 + p = buff; 2006 + 2007 + p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs ="); 2008 + 2009 + len = sec_ie[1] + 2; 2010 + len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX; 2011 + 2012 + for (i = 0; i < len; i++) 2013 + p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]); 2014 + 2015 + p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")"); 2016 + 2017 + memset(&wrqu, 0, sizeof(wrqu)); 2018 + 2019 + wrqu.data.length = p - buff; 2020 + 2021 + wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX; 2022 + 2023 + kfree(buff); 2024 + } 2072 2025 } 2073 2026 2074 2027 signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len) ··· 2214 2099 u8 threshold; 2215 2100 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2216 2101 2217 - struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2102 + struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2218 2103 2219 2104 /* todo: if you want to do something io/reg/hw setting before join_bss, please add code here */ 2220 2105 ··· 2240 2125 2241 2126 void rtw_ht_use_default_setting(struct adapter *padapter) 2242 2127 { 2243 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2244 - struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2128 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2129 + struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2245 2130 struct registry_priv *pregistrypriv = &padapter->registrypriv; 2246 2131 bool bHwLDPCSupport = false, bHwSTBCSupport = false; 2247 2132 bool bHwSupportBeamformer = false, bHwSupportBeamformee = false; ··· 2315 2200 u8 cbw40_enable = 0, stbc_rx_enable = 0, operation_bw = 0; 2316 2201 struct registry_priv *pregistrypriv = &padapter->registrypriv; 2317 2202 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2318 - struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2203 + struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2319 2204 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 2320 2205 2321 2206 phtpriv->ht_option = false; ··· 2426 2311 } 2427 2312 2428 2313 return phtpriv->ht_option; 2429 - 2430 2314 } 2431 2315 2432 2316 /* the function is > passive_level (in critical_section) */ ··· 2435 2321 int len; 2436 2322 struct ieee80211_ht_cap *pht_capie; 2437 2323 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2438 - struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2324 + struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2439 2325 struct registry_priv *pregistrypriv = &padapter->registrypriv; 2440 2326 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 2441 2327 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; ··· 2460 2346 max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */ 2461 2347 2462 2348 phtpriv->rx_ampdu_maxlen = max_ampdu_sz; 2463 - 2464 2349 } 2465 2350 2466 2351 len = 0; ··· 2550 2437 rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra); 2551 2438 } 2552 2439 } 2553 - 2554 2440 } 2555 2441 2556 2442 void rtw_append_exented_cap(struct adapter *padapter, u8 *out_ie, uint *pout_len) 2557 2443 { 2558 2444 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2559 - struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2445 + struct ht_priv *phtpriv = &pmlmepriv->htpriv; 2560 2446 u8 cap_content[8] = {0}; 2561 2447 2562 2448 if (phtpriv->bss_coexist) ··· 2590 2478 _rtw_roaming(padapter, tgt_network); 2591 2479 spin_unlock_bh(&pmlmepriv->lock); 2592 2480 } 2481 + 2593 2482 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network) 2594 2483 { 2595 2484 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+66 -64
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
··· 374 374 return chanset_size; 375 375 } 376 376 377 + static void init_mlme_ext_timer(struct adapter *padapter) 378 + { 379 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 380 + 381 + timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0); 382 + timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0); 383 + timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0); 384 + } 385 + 377 386 void init_mlme_ext_priv(struct adapter *padapter) 378 387 { 379 388 struct registry_priv *pregistrypriv = &padapter->registrypriv; ··· 946 937 u16 capab_info; 947 938 struct rtw_ieee802_11_elems elems; 948 939 struct sta_info *pstat; 949 - unsigned char *p, *pos, *wpa_ie; 940 + unsigned char *p, *pos, *wpa_ie; 950 941 unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01}; 951 942 int i, ie_len, wpa_ie_len, left; 952 - unsigned char supportRate[16]; 943 + unsigned char supportRate[16]; 953 944 int supportRateNum; 954 945 unsigned short status = WLAN_STATUS_SUCCESS; 955 946 unsigned short frame_type, ie_offset = 0; ··· 1131 1122 if (!wpa_ie) { 1132 1123 if (elems.wps_ie) { 1133 1124 pstat->flags |= WLAN_STA_WPS; 1134 - /* wpabuf_free(sta->wps_ie); */ 1135 - /* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */ 1136 - /* elems.wps_ie_len - 4); */ 1137 1125 } else { 1138 1126 pstat->flags |= WLAN_STA_MAYBE_WPS; 1139 1127 } ··· 1508 1502 return _SUCCESS; 1509 1503 } 1510 1504 1511 - /* Commented by Albert 20130604 */ 1512 - /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, */ 1513 - /* we will send the deauth first. */ 1514 - /* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */ 1515 - /* Added the following code to avoid this case. */ 1505 + /* Commented by Albert 20130604 1506 + * Before sending the auth frame to start the STA/GC mode connection with AP/GO, 1507 + * we will send the deauth first. 1508 + * However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. 1509 + * Added the following code to avoid this case. 1510 + */ 1516 1511 if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) || 1517 1512 (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) { 1518 1513 if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { ··· 1633 1626 u8 *addr; 1634 1627 struct sta_info *psta = NULL; 1635 1628 struct recv_reorder_ctrl *preorder_ctrl; 1636 - unsigned char *frame_body; 1637 - unsigned char category, action; 1629 + unsigned char *frame_body; 1630 + unsigned char category, action; 1638 1631 unsigned short tid, status; 1639 1632 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 1640 1633 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ··· 2266 2259 { 2267 2260 struct xmit_frame *pmgntframe; 2268 2261 struct pkt_attrib *pattrib; 2269 - unsigned char *pframe; 2262 + unsigned char *pframe; 2270 2263 struct ieee80211_hdr *pwlanhdr; 2271 2264 __le16 *fctrl; 2272 - unsigned char *mac, *bssid; 2265 + unsigned char *mac, *bssid; 2273 2266 struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2274 2267 2275 2268 u8 *pwps_ie; ··· 2463 2456 int ret = _FAIL; 2464 2457 struct xmit_frame *pmgntframe; 2465 2458 struct pkt_attrib *pattrib; 2466 - unsigned char *pframe; 2459 + unsigned char *pframe; 2467 2460 struct ieee80211_hdr *pwlanhdr; 2468 2461 __le16 *fctrl; 2469 - unsigned char *mac; 2470 - unsigned char bssrate[NumRates]; 2471 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2462 + unsigned char *mac; 2463 + unsigned char bssrate[NumRates]; 2464 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2472 2465 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 2473 2466 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 2474 2467 int bssrate_len = 0; ··· 2493 2486 *(fctrl) = 0; 2494 2487 2495 2488 if (da) { 2496 - /* unicast probe request frame */ 2489 + /* unicast probe request frame */ 2497 2490 memcpy(pwlanhdr->addr1, da, ETH_ALEN); 2498 2491 memcpy(pwlanhdr->addr3, da, ETH_ALEN); 2499 2492 } else { 2500 - /* broadcast probe request frame */ 2493 + /* broadcast probe request frame */ 2501 2494 eth_broadcast_addr(pwlanhdr->addr1); 2502 2495 eth_broadcast_addr(pwlanhdr->addr3); 2503 2496 } ··· 2591 2584 { 2592 2585 struct xmit_frame *pmgntframe; 2593 2586 struct pkt_attrib *pattrib; 2594 - unsigned char *pframe; 2587 + unsigned char *pframe; 2595 2588 struct ieee80211_hdr *pwlanhdr; 2596 2589 __le16 *fctrl; 2597 2590 unsigned int val32; 2598 2591 unsigned short val16; 2599 2592 int use_shared_key = 0; 2600 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2593 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2601 2594 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 2602 2595 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 2603 2596 __le16 le_tmp; ··· 2848 2841 int ret = _FAIL; 2849 2842 struct xmit_frame *pmgntframe; 2850 2843 struct pkt_attrib *pattrib; 2851 - unsigned char *pframe; 2844 + unsigned char *pframe; 2852 2845 struct ieee80211_hdr *pwlanhdr; 2853 2846 __le16 *fctrl; 2854 2847 __le16 val16; 2855 2848 unsigned int i, j, index = 0; 2856 2849 unsigned char bssrate[NumRates], sta_bssrate[NumRates]; 2857 2850 struct ndis_80211_var_ie *pIE; 2858 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2851 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 2859 2852 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 2860 2853 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 2861 2854 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ··· 3025 3018 int ret = _FAIL; 3026 3019 struct xmit_frame *pmgntframe; 3027 3020 struct pkt_attrib *pattrib; 3028 - unsigned char *pframe; 3021 + unsigned char *pframe; 3029 3022 struct ieee80211_hdr *pwlanhdr; 3030 3023 __le16 *fctrl; 3031 3024 struct xmit_priv *pxmitpriv; ··· 3170 3163 int ret = _FAIL; 3171 3164 struct xmit_frame *pmgntframe; 3172 3165 struct pkt_attrib *pattrib; 3173 - unsigned char *pframe; 3166 + unsigned char *pframe; 3174 3167 struct ieee80211_hdr *pwlanhdr; 3175 3168 __le16 *fctrl; 3176 3169 u16 *qc; 3177 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3170 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3178 3171 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 3179 3172 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 3180 3173 ··· 3279 3272 { 3280 3273 struct xmit_frame *pmgntframe; 3281 3274 struct pkt_attrib *pattrib; 3282 - unsigned char *pframe; 3275 + unsigned char *pframe; 3283 3276 struct ieee80211_hdr *pwlanhdr; 3284 3277 __le16 *fctrl; 3285 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3278 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3286 3279 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 3287 3280 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 3288 3281 int ret = _FAIL; ··· 3373 3366 u8 category = RTW_WLAN_CATEGORY_SA_QUERY; 3374 3367 struct xmit_frame *pmgntframe; 3375 3368 struct pkt_attrib *pattrib; 3376 - u8 *pframe; 3369 + u8 *pframe; 3377 3370 struct ieee80211_hdr *pwlanhdr; 3378 3371 __le16 *fctrl; 3379 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3372 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3380 3373 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 3381 3374 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 3382 3375 __le16 le_tmp; ··· 3446 3439 enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor; 3447 3440 struct xmit_frame *pmgntframe; 3448 3441 struct pkt_attrib *pattrib; 3449 - u8 *pframe; 3442 + u8 *pframe; 3450 3443 struct ieee80211_hdr *pwlanhdr; 3451 3444 __le16 *fctrl; 3452 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3445 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3453 3446 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 3454 3447 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 3455 - struct sta_info *psta; 3456 - struct sta_priv *pstapriv = &padapter->stapriv; 3457 - struct registry_priv *pregpriv = &padapter->registrypriv; 3448 + struct sta_info *psta; 3449 + struct sta_priv *pstapriv = &padapter->stapriv; 3450 + struct registry_priv *pregpriv = &padapter->registrypriv; 3458 3451 __le16 le_tmp; 3459 3452 3460 3453 pmgntframe = alloc_mgtxmitframe(pxmitpriv); ··· 3592 3585 unsigned char category, action; 3593 3586 struct xmit_frame *pmgntframe; 3594 3587 struct pkt_attrib *pattrib; 3595 - unsigned char *pframe; 3588 + unsigned char *pframe; 3596 3589 struct ieee80211_hdr *pwlanhdr; 3597 3590 __le16 *fctrl; 3598 3591 struct wlan_network *pnetwork = NULL; 3599 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3592 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 3600 3593 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 3601 3594 struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 3602 3595 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ··· 3805 3798 3806 3799 void site_survey(struct adapter *padapter) 3807 3800 { 3808 - unsigned char survey_channel = 0, val8; 3801 + unsigned char survey_channel = 0, val8; 3809 3802 enum rt_scan_type ScanType = SCAN_PASSIVE; 3810 3803 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 3811 3804 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ··· 3874 3867 set_survey_timer(pmlmeext, channel_scan_time_ms); 3875 3868 } else { 3876 3869 3877 - /* channel number is 0 or this channel is not valid. */ 3870 + /* channel number is 0 or this channel is not valid. */ 3878 3871 3879 3872 { 3880 3873 pmlmeext->sitesurvey_res.state = SCAN_COMPLETE; ··· 4151 4144 4152 4145 rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); 4153 4146 4154 - /* Because of AP's not receiving deauth before */ 4155 - /* AP may: 1)not response auth or 2)deauth us after link is complete */ 4156 - /* issue deauth before issuing auth to deal with the situation */ 4157 - 4158 - /* Commented by Albert 2012/07/21 */ 4159 - /* For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. */ 4147 + /* Because of AP's not receiving deauth before 4148 + * AP may: 1)not response auth or 2)deauth us after link is complete 4149 + * issue deauth before issuing auth to deal with the situation 4150 + * 4151 + * Commented by Albert 2012/07/21 4152 + * For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. 4153 + */ 4160 4154 { 4161 4155 /* To avoid connecting to AP fail during resume process, change retry count from 5 to 1 */ 4162 4156 issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, 1, 100); ··· 4330 4322 k++; 4331 4323 } else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) { 4332 4324 chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; 4333 - /* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ 4334 4325 chplan_new[k].ScanType = SCAN_PASSIVE; 4335 4326 i++; 4336 4327 k++; ··· 4347 4340 (chplan_sta[i].ChannelNum <= 14)) { 4348 4341 4349 4342 chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; 4350 - /* chplan_new[k].ScanType = chplan_sta[i].ScanType; */ 4351 4343 chplan_new[k].ScanType = SCAN_PASSIVE; 4352 4344 i++; 4353 4345 k++; ··· 4466 4460 u32 cmdsz; 4467 4461 struct surveydone_event *psurveydone_evt; 4468 4462 struct C2HEvent_Header *pc2h_evt_hdr; 4469 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4463 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4470 4464 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4471 4465 4472 4466 pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); ··· 4510 4504 u32 cmdsz; 4511 4505 struct joinbss_event *pjoinbss_evt; 4512 4506 struct C2HEvent_Header *pc2h_evt_hdr; 4513 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4507 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4514 4508 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 4515 4509 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4516 4510 ··· 4560 4554 u32 cmdsz; 4561 4555 struct wmm_event *pwmm_event; 4562 4556 struct C2HEvent_Header *pc2h_evt_hdr; 4563 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4557 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4564 4558 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4565 4559 4566 4560 pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); ··· 4606 4600 int mac_id; 4607 4601 struct stadel_event *pdel_sta_evt; 4608 4602 struct C2HEvent_Header *pc2h_evt_hdr; 4609 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4603 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4610 4604 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4611 4605 4612 4606 pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); ··· 4657 4651 u32 cmdsz; 4658 4652 struct stassoc_event *padd_sta_evt; 4659 4653 struct C2HEvent_Header *pc2h_evt_hdr; 4660 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4654 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4661 4655 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4662 4656 4663 4657 pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); ··· 4761 4755 4762 4756 static void rtw_mlmeext_disconnect(struct adapter *padapter) 4763 4757 { 4764 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 4758 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 4765 4759 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4766 4760 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 4767 4761 struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&(pmlmeinfo->network)); ··· 4811 4805 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4812 4806 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 4813 4807 struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); 4814 - struct sta_priv *pstapriv = &padapter->stapriv; 4808 + struct sta_priv *pstapriv = &padapter->stapriv; 4815 4809 u8 join_type; 4816 4810 struct sta_info *psta; 4817 4811 ··· 4989 4983 void linked_status_chk(struct adapter *padapter) 4990 4984 { 4991 4985 u32 i; 4992 - struct sta_info *psta; 4993 - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 4986 + struct sta_info *psta; 4987 + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); 4994 4988 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 4995 4989 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 4996 - struct sta_priv *pstapriv = &padapter->stapriv; 4990 + struct sta_priv *pstapriv = &padapter->stapriv; 4997 4991 4998 4992 4999 4993 if (is_client_associated_to_ap(padapter)) { ··· 5097 5091 timer_container_of(padapter, t, mlmeextpriv.survey_timer); 5098 5092 struct cmd_obj *ph2c; 5099 5093 struct sitesurvey_parm *psurveyPara; 5100 - struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 5101 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 5094 + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 5095 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 5102 5096 5103 5097 /* issue rtw_sitesurvey_cmd */ 5104 5098 if (pmlmeext->sitesurvey_res.state > SCAN_START) { ··· 5130 5124 { 5131 5125 struct adapter *padapter = 5132 5126 timer_container_of(padapter, t, mlmeextpriv.link_timer); 5133 - /* static unsigned int rx_pkt = 0; */ 5134 - /* static u64 tx_cnt = 0; */ 5135 - /* struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); */ 5136 5127 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 5137 5128 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 5138 - /* struct sta_priv *pstapriv = &padapter->stapriv; */ 5139 5129 5140 5130 5141 5131 if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
+2 -8
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
··· 430 430 return err; 431 431 } 432 432 433 - /* */ 434 - /* Description: */ 435 - /* Enter the leisure power save mode. */ 436 - /* */ 433 + /* Description: Enter the leisure power save mode. */ 437 434 void LPS_Enter(struct adapter *padapter, const char *msg) 438 435 { 439 436 struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); ··· 463 466 } 464 467 } 465 468 466 - /* */ 467 - /* Description: */ 468 - /* Leave the leisure power save mode. */ 469 - /* */ 469 + /* Description: Leave the leisure power save mode. */ 470 470 void LPS_Leave(struct adapter *padapter, const char *msg) 471 471 { 472 472 #define LPS_LEAVE_TIMEOUT_MS 100
+188 -6
drivers/staging/rtl8723bs/core/rtw_recv.c
··· 66 66 67 67 list_add_tail(&(precvframe->u.list), &(precvpriv->free_recv_queue.queue)); 68 68 69 - rtw_os_recv_resource_alloc(padapter, precvframe); 69 + precvframe->u.hdr.pkt_newalloc = NULL; 70 + precvframe->u.hdr.pkt = NULL; 70 71 71 72 precvframe->u.hdr.len = 0; 72 73 ··· 91 90 92 91 void _rtw_free_recv_priv(struct recv_priv *precvpriv) 93 92 { 93 + signed int i; 94 + union recv_frame *precvframe; 94 95 struct adapter *padapter = precvpriv->adapter; 95 96 96 97 rtw_free_uc_swdec_pending_queue(padapter); 97 98 98 - rtw_os_recv_resource_free(precvpriv); 99 + precvframe = (union recv_frame *)precvpriv->precv_frame_buf; 100 + 101 + for (i = 0; i < NR_RECVFRAME; i++) { 102 + if (precvframe->u.hdr.pkt) { 103 + /* free skb by driver */ 104 + dev_kfree_skb_any(precvframe->u.hdr.pkt); 105 + precvframe->u.hdr.pkt = NULL; 106 + } 107 + precvframe++; 108 + } 99 109 100 110 vfree(precvpriv->pallocated_frame_buf); 101 111 ··· 159 147 struct adapter *padapter = precvframe->u.hdr.adapter; 160 148 struct recv_priv *precvpriv = &padapter->recvpriv; 161 149 162 - rtw_os_free_recvframe(precvframe); 163 - 150 + if (precvframe->u.hdr.pkt) { 151 + dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */ 152 + precvframe->u.hdr.pkt = NULL; 153 + } 164 154 165 155 spin_lock_bh(&pfree_recv_queue->lock); 166 156 ··· 306 292 307 293 return precvbuf; 308 294 295 + } 296 + 297 + static void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup) 298 + { 299 + enum nl80211_key_type key_type = 0; 300 + union iwreq_data wrqu; 301 + struct iw_michaelmicfailure ev; 302 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 303 + struct security_priv *psecuritypriv = &padapter->securitypriv; 304 + unsigned long cur_time = 0; 305 + 306 + if (psecuritypriv->last_mic_err_time == 0) { 307 + psecuritypriv->last_mic_err_time = jiffies; 308 + } else { 309 + cur_time = jiffies; 310 + 311 + if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) { 312 + psecuritypriv->btkip_countermeasure = true; 313 + psecuritypriv->last_mic_err_time = 0; 314 + psecuritypriv->btkip_countermeasure_time = cur_time; 315 + } else { 316 + psecuritypriv->last_mic_err_time = jiffies; 317 + } 318 + } 319 + 320 + if (bgroup) 321 + key_type |= NL80211_KEYTYPE_GROUP; 322 + else 323 + key_type |= NL80211_KEYTYPE_PAIRWISE; 324 + 325 + cfg80211_michael_mic_failure(padapter->pnetdev, (u8 *)&pmlmepriv->assoc_bssid[0], key_type, -1, 326 + NULL, GFP_ATOMIC); 327 + 328 + memset(&ev, 0x00, sizeof(ev)); 329 + if (bgroup) 330 + ev.flags |= IW_MICFAILURE_GROUP; 331 + else 332 + ev.flags |= IW_MICFAILURE_PAIRWISE; 333 + 334 + ev.src_addr.sa_family = ARPHRD_ETHER; 335 + memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN); 336 + 337 + memset(&wrqu, 0x00, sizeof(wrqu)); 338 + wrqu.data.length = sizeof(ev); 309 339 } 310 340 311 341 static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe) ··· 1622 1564 return _SUCCESS; 1623 1565 } 1624 1566 1567 + static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata) 1568 + { 1569 + u16 eth_type; 1570 + struct sk_buff *sub_skb; 1571 + struct rx_pkt_attrib *pattrib; 1572 + 1573 + pattrib = &prframe->u.hdr.attrib; 1574 + 1575 + sub_skb = rtw_skb_alloc(nSubframe_Length + 12); 1576 + if (!sub_skb) 1577 + return NULL; 1578 + 1579 + skb_reserve(sub_skb, 12); 1580 + skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length); 1581 + 1582 + eth_type = get_unaligned_be16(&sub_skb->data[6]); 1583 + 1584 + if (sub_skb->len >= 8 && 1585 + ((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) && 1586 + eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || 1587 + !memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE))) { 1588 + /* 1589 + * remove RFC1042 or Bridge-Tunnel encapsulation and replace 1590 + * EtherType 1591 + */ 1592 + skb_pull(sub_skb, SNAP_SIZE); 1593 + memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN); 1594 + memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN); 1595 + } else { 1596 + __be16 len; 1597 + /* Leave Ethernet header part of hdr and full payload */ 1598 + len = htons(sub_skb->len); 1599 + memcpy(skb_push(sub_skb, 2), &len, 2); 1600 + memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN); 1601 + memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN); 1602 + } 1603 + 1604 + return sub_skb; 1605 + } 1606 + 1607 + static void rtw_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib) 1608 + { 1609 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1610 + 1611 + /* Indicate the packets to upper layer */ 1612 + if (pkt) { 1613 + if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { 1614 + struct sk_buff *pskb2 = NULL; 1615 + struct sta_info *psta = NULL; 1616 + struct sta_priv *pstapriv = &padapter->stapriv; 1617 + int bmcast = is_multicast_ether_addr(pattrib->dst); 1618 + 1619 + if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) { 1620 + if (bmcast) { 1621 + psta = rtw_get_bcmc_stainfo(padapter); 1622 + pskb2 = skb_clone(pkt, GFP_ATOMIC); 1623 + } else { 1624 + psta = rtw_get_stainfo(pstapriv, pattrib->dst); 1625 + } 1626 + 1627 + if (psta) { 1628 + struct net_device *pnetdev = (struct net_device *)padapter->pnetdev; 1629 + /* skb->ip_summed = CHECKSUM_NONE; */ 1630 + pkt->dev = pnetdev; 1631 + skb_set_queue_mapping(pkt, rtw_recv_select_queue(pkt)); 1632 + 1633 + _rtw_xmit_entry(pkt, pnetdev); 1634 + 1635 + if (bmcast && pskb2) 1636 + pkt = pskb2; 1637 + else 1638 + return; 1639 + } 1640 + } else { 1641 + /* to APself */ 1642 + } 1643 + } 1644 + 1645 + pkt->protocol = eth_type_trans(pkt, padapter->pnetdev); 1646 + pkt->dev = padapter->pnetdev; 1647 + 1648 + pkt->ip_summed = CHECKSUM_NONE; 1649 + 1650 + rtw_netif_rx(padapter->pnetdev, pkt); 1651 + } 1652 + } 1653 + 1625 1654 static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) 1626 1655 { 1627 1656 int a_len, padding_len; ··· 1738 1593 if (a_len < ETH_HLEN + nSubframe_Length) 1739 1594 break; 1740 1595 1741 - sub_pkt = rtw_os_alloc_msdu_pkt(prframe, nSubframe_Length, pdata); 1596 + sub_pkt = rtw_alloc_msdu_pkt(prframe, nSubframe_Length, pdata); 1742 1597 if (!sub_pkt) 1743 1598 break; 1744 1599 ··· 1771 1626 1772 1627 /* Indicate the packets to upper layer */ 1773 1628 if (sub_pkt) 1774 - rtw_os_recv_indicate_pkt(padapter, sub_pkt, &prframe->u.hdr.attrib); 1629 + rtw_recv_indicate_pkt(padapter, sub_pkt, &prframe->u.hdr.attrib); 1775 1630 } 1776 1631 1777 1632 prframe->u.hdr.len = 0; ··· 1868 1723 else 1869 1724 pdbgpriv->dbg_rx_ampdu_loss_count += (current_seq - prev_seq); 1870 1725 1726 + } 1727 + 1728 + static int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame) 1729 + { 1730 + struct recv_priv *precvpriv; 1731 + struct __queue *pfree_recv_queue; 1732 + struct sk_buff *skb; 1733 + struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; 1734 + 1735 + precvpriv = &(padapter->recvpriv); 1736 + pfree_recv_queue = &(precvpriv->free_recv_queue); 1737 + 1738 + skb = precv_frame->u.hdr.pkt; 1739 + if (!skb) 1740 + goto _recv_indicatepkt_drop; 1741 + 1742 + skb->data = precv_frame->u.hdr.rx_data; 1743 + 1744 + skb_set_tail_pointer(skb, precv_frame->u.hdr.len); 1745 + 1746 + skb->len = precv_frame->u.hdr.len; 1747 + 1748 + rtw_recv_indicate_pkt(padapter, skb, pattrib); 1749 + 1750 + /* pointers to NULL before rtw_free_recvframe() */ 1751 + precv_frame->u.hdr.pkt = NULL; 1752 + 1753 + rtw_free_recvframe(precv_frame, pfree_recv_queue); 1754 + 1755 + return _SUCCESS; 1756 + 1757 + _recv_indicatepkt_drop: 1758 + 1759 + /* enqueue back to free_recv_queue */ 1760 + rtw_free_recvframe(precv_frame, pfree_recv_queue); 1761 + 1762 + return _FAIL; 1871 1763 } 1872 1764 1873 1765 static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
+18 -60
drivers/staging/rtl8723bs/core/rtw_security.c
··· 7 7 #include <linux/crc32.h> 8 8 #include <drv_types.h> 9 9 #include <crypto/aes.h> 10 + #include <crypto/utils.h> 10 11 11 12 static const char * const _security_type_str[] = { 12 13 "N/A", ··· 638 637 639 638 #define MAX_MSG_SIZE 2048 640 639 641 - /*****************************/ 642 - /**** Function Prototypes ****/ 643 - /*****************************/ 644 - 645 - static void bitwise_xor(u8 *ina, u8 *inb, u8 *out); 646 - static void construct_mic_iv(u8 *mic_header1, 647 - signed int qc_exists, 648 - signed int a4_exists, 649 - u8 *mpdu, 650 - uint payload_length, 651 - u8 *pn_vector, 652 - uint frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ 653 - static void construct_mic_header1(u8 *mic_header1, 654 - signed int header_length, 655 - u8 *mpdu, 656 - uint frtype); /* for CONFIG_IEEE80211W, none 11w also can use */ 657 - static void construct_mic_header2(u8 *mic_header2, 658 - u8 *mpdu, 659 - signed int a4_exists, 660 - signed int qc_exists); 661 - static void construct_ctr_preload(u8 *ctr_preload, 662 - signed int a4_exists, 663 - signed int qc_exists, 664 - u8 *mpdu, 665 - u8 *pn_vector, 666 - signed int c, 667 - uint frtype); /* for CONFIG_IEEE80211W, none 11w also can use */ 668 - 669 - static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); 670 - 671 - 672 640 /****************************************/ 673 641 /* aes128k128d() */ 674 642 /* Performs a 128 bit AES encrypt with */ ··· 819 849 ctr_preload[15] = (unsigned char) (c % 256); 820 850 } 821 851 822 - /************************************/ 823 - /* bitwise_xor() */ 824 - /* A 128 bit, bitwise exclusive or */ 825 - /************************************/ 826 - static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) 827 - { 828 - signed int i; 829 - 830 - for (i = 0; i < 16; i++) 831 - out[i] = ina[i] ^ inb[i]; 832 - } 833 - 834 852 static signed int aes_cipher(u8 *key, uint hdrlen, 835 853 u8 *pframe, uint plen) 836 854 { ··· 899 941 900 942 /* Calculate MIC */ 901 943 aes128k128d(key, mic_iv, aes_out); 902 - bitwise_xor(aes_out, mic_header1, chain_buffer); 944 + crypto_xor_cpy(chain_buffer, aes_out, mic_header1, 16); 903 945 aes128k128d(key, chain_buffer, aes_out); 904 - bitwise_xor(aes_out, mic_header2, chain_buffer); 946 + crypto_xor_cpy(chain_buffer, aes_out, mic_header2, 16); 905 947 aes128k128d(key, chain_buffer, aes_out); 906 948 907 949 for (i = 0; i < num_blocks; i++) { 908 - bitwise_xor(aes_out, &pframe[payload_index], chain_buffer); 950 + crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16); 909 951 910 952 payload_index += 16; 911 953 aes128k128d(key, chain_buffer, aes_out); ··· 918 960 for (j = 0; j < payload_remainder; j++) 919 961 padded_buffer[j] = pframe[payload_index++]; 920 962 921 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 963 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 922 964 aes128k128d(key, chain_buffer, aes_out); 923 965 } 924 966 ··· 935 977 pn_vector, i+1, frtype); 936 978 /* add for CONFIG_IEEE80211W, none 11w also can use */ 937 979 aes128k128d(key, ctr_preload, aes_out); 938 - bitwise_xor(aes_out, &pframe[payload_index], chain_buffer); 980 + crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16); 939 981 for (j = 0; j < 16; j++) 940 982 pframe[payload_index++] = chain_buffer[j]; 941 983 } ··· 953 995 padded_buffer[j] = pframe[payload_index+j]; 954 996 955 997 aes128k128d(key, ctr_preload, aes_out); 956 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 998 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 957 999 for (j = 0; j < payload_remainder; j++) 958 1000 pframe[payload_index++] = chain_buffer[j]; 959 1001 } ··· 969 1011 padded_buffer[j] = pframe[j+hdrlen+8+plen]; 970 1012 971 1013 aes128k128d(key, ctr_preload, aes_out); 972 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 1014 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 973 1015 for (j = 0; j < 8; j++) 974 1016 pframe[payload_index++] = chain_buffer[j]; 975 1017 ··· 1095 1137 frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ 1096 1138 1097 1139 aes128k128d(key, ctr_preload, aes_out); 1098 - bitwise_xor(aes_out, &pframe[payload_index], chain_buffer); 1140 + crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16); 1099 1141 1100 1142 for (j = 0; j < 16; j++) 1101 1143 pframe[payload_index++] = chain_buffer[j]; ··· 1114 1156 padded_buffer[j] = pframe[payload_index+j]; 1115 1157 1116 1158 aes128k128d(key, ctr_preload, aes_out); 1117 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 1159 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 1118 1160 for (j = 0; j < payload_remainder; j++) 1119 1161 pframe[payload_index++] = chain_buffer[j]; 1120 1162 } ··· 1145 1187 1146 1188 /* Calculate MIC */ 1147 1189 aes128k128d(key, mic_iv, aes_out); 1148 - bitwise_xor(aes_out, mic_header1, chain_buffer); 1190 + crypto_xor_cpy(chain_buffer, aes_out, mic_header1, 16); 1149 1191 aes128k128d(key, chain_buffer, aes_out); 1150 - bitwise_xor(aes_out, mic_header2, chain_buffer); 1192 + crypto_xor_cpy(chain_buffer, aes_out, mic_header2, 16); 1151 1193 aes128k128d(key, chain_buffer, aes_out); 1152 1194 1153 1195 for (i = 0; i < num_blocks; i++) { 1154 - bitwise_xor(aes_out, &message[payload_index], chain_buffer); 1196 + crypto_xor_cpy(chain_buffer, aes_out, &message[payload_index], 16); 1155 1197 1156 1198 payload_index += 16; 1157 1199 aes128k128d(key, chain_buffer, aes_out); ··· 1164 1206 for (j = 0; j < payload_remainder; j++) 1165 1207 padded_buffer[j] = message[payload_index++]; 1166 1208 1167 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 1209 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 1168 1210 aes128k128d(key, chain_buffer, aes_out); 1169 1211 } 1170 1212 ··· 1181 1223 frtype); 1182 1224 /* add for CONFIG_IEEE80211W, none 11w also can use */ 1183 1225 aes128k128d(key, ctr_preload, aes_out); 1184 - bitwise_xor(aes_out, &message[payload_index], chain_buffer); 1226 + crypto_xor_cpy(chain_buffer, aes_out, &message[payload_index], 16); 1185 1227 for (j = 0; j < 16; j++) 1186 1228 message[payload_index++] = chain_buffer[j]; 1187 1229 } ··· 1199 1241 padded_buffer[j] = message[payload_index+j]; 1200 1242 1201 1243 aes128k128d(key, ctr_preload, aes_out); 1202 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 1244 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 1203 1245 for (j = 0; j < payload_remainder; j++) 1204 1246 message[payload_index++] = chain_buffer[j]; 1205 1247 } ··· 1214 1256 padded_buffer[j] = message[j+hdrlen+8+plen-8]; 1215 1257 1216 1258 aes128k128d(key, ctr_preload, aes_out); 1217 - bitwise_xor(aes_out, padded_buffer, chain_buffer); 1259 + crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16); 1218 1260 for (j = 0; j < 8; j++) 1219 1261 message[payload_index++] = chain_buffer[j]; 1220 1262 ··· 1363 1405 ClearPwrMgt(BIP_AAD); 1364 1406 ClearMData(BIP_AAD); 1365 1407 /* conscruct AAD, copy address 1 to address 3 */ 1366 - memcpy(BIP_AAD+2, pwlanhdr->addr1, 18); 1408 + memcpy(BIP_AAD + 2, &pwlanhdr->addrs, sizeof(pwlanhdr->addrs)); 1367 1409 1368 1410 if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey 1369 1411 , BIP_AAD, ori_len, mic))
+4 -2
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
··· 229 229 for (i = 0; i < 16; i++) 230 230 memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2); 231 231 232 - init_addba_retry_timer(pstapriv->padapter, psta); 232 + timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0); 233 233 234 234 /* for A-MPDU Rx reordering buffer control */ 235 235 for (i = 0; i < 16 ; i++) { ··· 247 247 INIT_LIST_HEAD(&preorder_ctrl->pending_recvframe_queue.queue); 248 248 spin_lock_init(&preorder_ctrl->pending_recvframe_queue.lock); 249 249 250 - rtw_init_recv_timer(preorder_ctrl); 250 + /* init recv timer */ 251 + timer_setup(&preorder_ctrl->reordering_ctrl_timer, 252 + rtw_reordering_ctrl_timeout_handler, 0); 251 253 } 252 254 253 255 /* init for DM */
+30 -30
drivers/staging/rtl8723bs/core/rtw_wlan_util.c
··· 170 170 171 171 void set_mcs_rate_by_mask(u8 *mcs_set, u32 mask) 172 172 { 173 - u8 mcs_rate_1r = (u8)(mask&0xff); 174 - u8 mcs_rate_2r = (u8)((mask>>8)&0xff); 175 - u8 mcs_rate_3r = (u8)((mask>>16)&0xff); 176 - u8 mcs_rate_4r = (u8)((mask>>24)&0xff); 173 + u8 mcs_rate_1r = (u8)(mask & 0xff); 174 + u8 mcs_rate_2r = (u8)((mask >> 8) & 0xff); 175 + u8 mcs_rate_3r = (u8)((mask >> 16) & 0xff); 176 + u8 mcs_rate_4r = (u8)((mask >> 24) & 0xff); 177 177 178 178 mcs_set[0] &= mcs_rate_1r; 179 179 mcs_set[1] &= mcs_rate_2r; ··· 267 267 dvobj->on_oper_ch_time = jiffies; 268 268 269 269 #ifdef DBG_CH_SWITCH 270 - cnt += scnprintf(msg+cnt, len-cnt, "switch to ch %3u", ch); 270 + cnt += scnprintf(msg + cnt, len - cnt, "switch to ch %3u", ch); 271 271 272 272 for (i = 0; i < dvobj->iface_nums; i++) { 273 273 struct adapter *iface = dvobj->padapters[i]; 274 274 275 - cnt += scnprintf(msg+cnt, len-cnt, " [%s:", ADPT_ARG(iface)); 275 + cnt += scnprintf(msg + cnt, len - cnt, " [%s:", ADPT_ARG(iface)); 276 276 if (iface->mlmeextpriv.cur_channel == ch) 277 - cnt += scnprintf(msg+cnt, len-cnt, "C"); 277 + cnt += scnprintf(msg + cnt, len - cnt, "C"); 278 278 else 279 - cnt += scnprintf(msg+cnt, len-cnt, "_"); 279 + cnt += scnprintf(msg + cnt, len - cnt, "_"); 280 280 if (iface->wdinfo.listen_channel == ch && !rtw_p2p_chk_state(&iface->wdinfo, P2P_STATE_NONE)) 281 - cnt += scnprintf(msg+cnt, len-cnt, "L"); 281 + cnt += scnprintf(msg + cnt, len - cnt, "L"); 282 282 else 283 - cnt += scnprintf(msg+cnt, len-cnt, "_"); 284 - cnt += scnprintf(msg+cnt, len-cnt, "]"); 283 + cnt += scnprintf(msg + cnt, len - cnt, "_"); 284 + cnt += scnprintf(msg + cnt, len - cnt, "]"); 285 285 } 286 286 287 287 #endif /* DBG_CH_SWITCH */ ··· 381 381 pmlmeext = &padapter->mlmeextpriv; 382 382 pmlmeinfo = &(pmlmeext->mlmext_info); 383 383 384 - if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)) 384 + if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) 385 385 return true; 386 386 else 387 387 return _FAIL; ··· 392 392 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 393 393 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 394 394 395 - if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)) 395 + if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) 396 396 return true; 397 397 else 398 398 return _FAIL; ··· 431 431 432 432 spin_lock_bh(&cam_ctl->lock); 433 433 cam_ctl->bitmap = 0; 434 - memset(dvobj->cam_cache, 0, sizeof(struct cam_entry_cache)*TOTAL_CAM_ENTRY); 434 + memset(dvobj->cam_cache, 0, sizeof(struct cam_entry_cache) * TOTAL_CAM_ENTRY); 435 435 spin_unlock_bh(&cam_ctl->lock); 436 436 } 437 437 ··· 453 453 break; 454 454 default: 455 455 i = (j - 2) << 2; 456 - val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24)); 456 + val = (key[i] | (key[i + 1] << 8) | (key[i + 2] << 16) | (key[i + 3] << 24)); 457 457 break; 458 458 } 459 459 ··· 522 522 if (!(cam_ctl->bitmap & BIT(cam_id))) 523 523 goto exit; 524 524 525 - ret = (dvobj->cam_cache[cam_id].ctrl&BIT6)?true:false; 525 + ret = (dvobj->cam_cache[cam_id].ctrl & BIT6) ? true : false; 526 526 527 527 exit: 528 528 return ret; ··· 537 537 for (i = 0; i < TOTAL_CAM_ENTRY; i++) { 538 538 if (addr && memcmp(dvobj->cam_cache[i].mac, addr, ETH_ALEN)) 539 539 continue; 540 - if (kid >= 0 && kid != (dvobj->cam_cache[i].ctrl&0x03)) 540 + if (kid >= 0 && kid != (dvobj->cam_cache[i].ctrl & 0x03)) 541 541 continue; 542 542 543 543 cam_id = i; ··· 571 571 572 572 mlmeinfo = &adapter->mlmeextpriv.mlmext_info; 573 573 574 - if ((((mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) || ((mlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)) 574 + if ((((mlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) || ((mlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) 575 575 && !sta) { 576 576 /* AP/Ad-hoc mode group key: static alloction to default key by key ID */ 577 577 if (kid > 3) { ··· 585 585 cam_id = kid; 586 586 } else { 587 587 int i; 588 - u8 *addr = sta?sta->hwaddr:NULL; 588 + u8 *addr = sta ? sta->hwaddr : NULL; 589 589 590 590 if (!sta) { 591 591 if (!(mlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { ··· 792 792 switch (ACI) { 793 793 case 0x0: 794 794 rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acParm)); 795 - acm_mask |= (ACM ? BIT(1):0); 795 + acm_mask |= (ACM ? BIT(1) : 0); 796 796 edca[XMIT_BE_QUEUE] = acParm; 797 797 break; 798 798 ··· 804 804 805 805 case 0x2: 806 806 rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acParm)); 807 - acm_mask |= (ACM ? BIT(2):0); 807 + acm_mask |= (ACM ? BIT(2) : 0); 808 808 edca[XMIT_VI_QUEUE] = acParm; 809 809 break; 810 810 811 811 case 0x3: 812 812 rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acParm)); 813 - acm_mask |= (ACM ? BIT(3):0); 813 + acm_mask |= (ACM ? BIT(3) : 0); 814 814 edca[XMIT_VO_QUEUE] = acParm; 815 815 break; 816 816 } ··· 1170 1170 ht_info_infos_0 = 0; 1171 1171 } 1172 1172 if (ht_cap_info != cur_network->bcn_info.ht_cap_info || 1173 - ((ht_info_infos_0&0x03) != (cur_network->bcn_info.ht_info_infos_0&0x03))) { 1173 + ((ht_info_infos_0 & 0x03) != (cur_network->bcn_info.ht_info_infos_0 & 0x03))) { 1174 1174 { 1175 1175 /* bcn_info_update */ 1176 1176 cur_network->bcn_info.ht_cap_info = ht_cap_info; ··· 1238 1238 goto _mismatch; 1239 1239 1240 1240 if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) { 1241 - pbuf = rtw_get_wpa_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length-12); 1241 + pbuf = rtw_get_wpa_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length - 12); 1242 1242 if (pbuf && (wpa_ielen > 0)) { 1243 1243 rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher, 1244 1244 &pairwise_cipher, &is_8021x); 1245 1245 } else { 1246 - pbuf = rtw_get_wpa2_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length-12); 1246 + pbuf = rtw_get_wpa2_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length - 12); 1247 1247 1248 1248 if (pbuf && (wpa_ielen > 0)) 1249 1249 rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher, ··· 1630 1630 1631 1631 if (psta) { 1632 1632 param = le16_to_cpu(preq->BA_para_set); 1633 - tid = (param>>2)&0x0f; 1633 + tid = (param >> 2) & 0x0f; 1634 1634 1635 1635 preorder_ctrl = &psta->recvreorder_ctrl[tid]; 1636 1636 ··· 1648 1648 pIE = pframe + sizeof(struct ieee80211_hdr_3addr); 1649 1649 pbuf = (__le32 *)pIE; 1650 1650 1651 - pmlmeext->TSFValue = le32_to_cpu(*(pbuf+1)); 1651 + pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1)); 1652 1652 1653 1653 pmlmeext->TSFValue = pmlmeext->TSFValue << 32; 1654 1654 ··· 1674 1674 pIE = pframe + sizeof(struct ieee80211_hdr_3addr); 1675 1675 pbuf = (__le32 *)pIE; 1676 1676 1677 - tsf = le32_to_cpu(*(pbuf+1)); 1677 + tsf = le32_to_cpu(*(pbuf + 1)); 1678 1678 tsf = tsf << 32; 1679 1679 tsf |= le32_to_cpu(*pbuf); 1680 1680 1681 1681 /* delay = (timestamp mod 1024*100)/1000 (unit: ms) */ 1682 1682 /* delay_ms = do_div(tsf, (pmlmeinfo->bcn_interval*1024))/1000; */ 1683 - delay_ms = do_div(tsf, (pmlmeinfo->bcn_interval*1024)); 1684 - delay_ms = delay_ms/1000; 1683 + delay_ms = do_div(tsf, (pmlmeinfo->bcn_interval * 1024)); 1684 + delay_ms = delay_ms / 1000; 1685 1685 1686 1686 if (delay_ms >= 8) 1687 1687 pmlmeext->bcn_delay_cnt[8]++;
+1 -1
drivers/staging/rtl8723bs/core/rtw_xmit.c
··· 1209 1209 ClearPwrMgt(BIP_AAD); 1210 1210 ClearMData(BIP_AAD); 1211 1211 /* conscruct AAD, copy address 1 to address 3 */ 1212 - memcpy(BIP_AAD+2, pwlanhdr->addr1, 18); 1212 + memcpy(BIP_AAD + 2, &pwlanhdr->addrs, sizeof(pwlanhdr->addrs)); 1213 1213 /* copy management fram body */ 1214 1214 memcpy(BIP_AAD+BIP_AAD_SIZE, MGMT_body, frame_body_len); 1215 1215 /* calculate mic */
+1 -4
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
··· 59 59 } 60 60 } 61 61 62 - static void 63 - phy_StoreTxPowerByRateBase( 64 - struct adapter *padapter 65 - ) 62 + static void phy_StoreTxPowerByRateBase(struct adapter *padapter) 66 63 { 67 64 u8 path, base; 68 65
+1 -1
drivers/staging/rtl8723bs/hal/hal_pwr_seq.c
··· 8 8 /* 9 9 * 10 10 This file includes all kinds of Power Action event for RTL8723B 11 - and corresponding hardware configurtions which are released from HW SD. 11 + and corresponding hardware configurations which are released from HW SD. 12 12 13 13 Major Change History: 14 14 When Who What
-152
drivers/staging/rtl8723bs/hal/odm.c
··· 9 9 10 10 /* Global var */ 11 11 12 - u32 OFDMSwingTable[OFDM_TABLE_SIZE] = { 13 - 0x7f8001fe, /* 0, +6.0dB */ 14 - 0x788001e2, /* 1, +5.5dB */ 15 - 0x71c001c7, /* 2, +5.0dB */ 16 - 0x6b8001ae, /* 3, +4.5dB */ 17 - 0x65400195, /* 4, +4.0dB */ 18 - 0x5fc0017f, /* 5, +3.5dB */ 19 - 0x5a400169, /* 6, +3.0dB */ 20 - 0x55400155, /* 7, +2.5dB */ 21 - 0x50800142, /* 8, +2.0dB */ 22 - 0x4c000130, /* 9, +1.5dB */ 23 - 0x47c0011f, /* 10, +1.0dB */ 24 - 0x43c0010f, /* 11, +0.5dB */ 25 - 0x40000100, /* 12, +0dB */ 26 - 0x3c8000f2, /* 13, -0.5dB */ 27 - 0x390000e4, /* 14, -1.0dB */ 28 - 0x35c000d7, /* 15, -1.5dB */ 29 - 0x32c000cb, /* 16, -2.0dB */ 30 - 0x300000c0, /* 17, -2.5dB */ 31 - 0x2d4000b5, /* 18, -3.0dB */ 32 - 0x2ac000ab, /* 19, -3.5dB */ 33 - 0x288000a2, /* 20, -4.0dB */ 34 - 0x26000098, /* 21, -4.5dB */ 35 - 0x24000090, /* 22, -5.0dB */ 36 - 0x22000088, /* 23, -5.5dB */ 37 - 0x20000080, /* 24, -6.0dB */ 38 - 0x1e400079, /* 25, -6.5dB */ 39 - 0x1c800072, /* 26, -7.0dB */ 40 - 0x1b00006c, /* 27. -7.5dB */ 41 - 0x19800066, /* 28, -8.0dB */ 42 - 0x18000060, /* 29, -8.5dB */ 43 - 0x16c0005b, /* 30, -9.0dB */ 44 - 0x15800056, /* 31, -9.5dB */ 45 - 0x14400051, /* 32, -10.0dB */ 46 - 0x1300004c, /* 33, -10.5dB */ 47 - 0x12000048, /* 34, -11.0dB */ 48 - 0x11000044, /* 35, -11.5dB */ 49 - 0x10000040, /* 36, -12.0dB */ 50 - }; 51 - 52 - u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8] = { 53 - {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, /* 0, +0dB */ 54 - {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, /* 1, -0.5dB */ 55 - {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, /* 2, -1.0dB */ 56 - {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, /* 3, -1.5dB */ 57 - {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, /* 4, -2.0dB */ 58 - {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, /* 5, -2.5dB */ 59 - {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, /* 6, -3.0dB */ 60 - {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, /* 7, -3.5dB */ 61 - {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, /* 8, -4.0dB */ 62 - {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, /* 9, -4.5dB */ 63 - {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, /* 10, -5.0dB */ 64 - {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, /* 11, -5.5dB */ 65 - {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, /* 12, -6.0dB <== default */ 66 - {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, /* 13, -6.5dB */ 67 - {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, /* 14, -7.0dB */ 68 - {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, /* 15, -7.5dB */ 69 - {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, /* 16, -8.0dB */ 70 - {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, /* 17, -8.5dB */ 71 - {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, /* 18, -9.0dB */ 72 - {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 19, -9.5dB */ 73 - {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 20, -10.0dB */ 74 - {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 21, -10.5dB */ 75 - {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 22, -11.0dB */ 76 - {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, /* 23, -11.5dB */ 77 - {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, /* 24, -12.0dB */ 78 - {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, /* 25, -12.5dB */ 79 - {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, /* 26, -13.0dB */ 80 - {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 27, -13.5dB */ 81 - {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 28, -14.0dB */ 82 - {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 29, -14.5dB */ 83 - {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 30, -15.0dB */ 84 - {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, /* 31, -15.5dB */ 85 - {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} /* 32, -16.0dB */ 86 - }; 87 - 88 - u8 CCKSwingTable_Ch14[CCK_TABLE_SIZE][8] = { 89 - {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, /* 0, +0dB */ 90 - {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, /* 1, -0.5dB */ 91 - {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 2, -1.0dB */ 92 - {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, /* 3, -1.5dB */ 93 - {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, /* 4, -2.0dB */ 94 - {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, /* 5, -2.5dB */ 95 - {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, /* 6, -3.0dB */ 96 - {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, /* 7, -3.5dB */ 97 - {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, /* 8, -4.0dB */ 98 - {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, /* 9, -4.5dB */ 99 - {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, /* 10, -5.0dB */ 100 - {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 11, -5.5dB */ 101 - {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 12, -6.0dB <== default */ 102 - {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, /* 13, -6.5dB */ 103 - {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, /* 14, -7.0dB */ 104 - {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 15, -7.5dB */ 105 - {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 16, -8.0dB */ 106 - {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 17, -8.5dB */ 107 - {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 18, -9.0dB */ 108 - {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 19, -9.5dB */ 109 - {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 20, -10.0dB */ 110 - {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 21, -10.5dB */ 111 - {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 22, -11.0dB */ 112 - {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 23, -11.5dB */ 113 - {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 24, -12.0dB */ 114 - {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 25, -12.5dB */ 115 - {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 26, -13.0dB */ 116 - {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 27, -13.5dB */ 117 - {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 28, -14.0dB */ 118 - {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 29, -14.5dB */ 119 - {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 30, -15.0dB */ 120 - {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 31, -15.5dB */ 121 - {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} /* 32, -16.0dB */ 122 - }; 123 - 124 12 u32 OFDMSwingTable_New[OFDM_TABLE_SIZE] = { 125 13 0x0b40002d, /* 0, -15.0dB */ 126 14 0x0c000030, /* 1, -14.5dB */ ··· 125 237 {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 30, -1.0dB */ 126 238 {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, /* 31, -0.5dB */ 127 239 {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} /* 32, +0dB */ 128 - }; 129 - 130 - u32 TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE] = { 131 - 0x081, /* 0, -12.0dB */ 132 - 0x088, /* 1, -11.5dB */ 133 - 0x090, /* 2, -11.0dB */ 134 - 0x099, /* 3, -10.5dB */ 135 - 0x0A2, /* 4, -10.0dB */ 136 - 0x0AC, /* 5, -9.5dB */ 137 - 0x0B6, /* 6, -9.0dB */ 138 - 0x0C0, /* 7, -8.5dB */ 139 - 0x0CC, /* 8, -8.0dB */ 140 - 0x0D8, /* 9, -7.5dB */ 141 - 0x0E5, /* 10, -7.0dB */ 142 - 0x0F2, /* 11, -6.5dB */ 143 - 0x101, /* 12, -6.0dB */ 144 - 0x110, /* 13, -5.5dB */ 145 - 0x120, /* 14, -5.0dB */ 146 - 0x131, /* 15, -4.5dB */ 147 - 0x143, /* 16, -4.0dB */ 148 - 0x156, /* 17, -3.5dB */ 149 - 0x16A, /* 18, -3.0dB */ 150 - 0x180, /* 19, -2.5dB */ 151 - 0x197, /* 20, -2.0dB */ 152 - 0x1AF, /* 21, -1.5dB */ 153 - 0x1C8, /* 22, -1.0dB */ 154 - 0x1E3, /* 23, -0.5dB */ 155 - 0x200, /* 24, +0 dB */ 156 - 0x21E, /* 25, +0.5dB */ 157 - 0x23E, /* 26, +1.0dB */ 158 - 0x261, /* 27, +1.5dB */ 159 - 0x285, /* 28, +2.0dB */ 160 - 0x2AB, /* 29, +2.5dB */ 161 - 0x2D3, /* 30, +3.0dB */ 162 - 0x2FE, /* 31, +3.5dB */ 163 - 0x32B, /* 32, +4.0dB */ 164 - 0x35C, /* 33, +4.5dB */ 165 - 0x38E, /* 34, +5.0dB */ 166 - 0x3C4, /* 35, +5.5dB */ 167 - 0x3FE /* 36, +6.0dB */ 168 240 }; 169 241 170 242 /* Remove Edca by Yu Chen */
-6
drivers/staging/rtl8723bs/hal/odm.h
··· 1080 1080 /* */ 1081 1081 /* Extern Global Variables. */ 1082 1082 /* */ 1083 - extern u32 OFDMSwingTable[OFDM_TABLE_SIZE]; 1084 - extern u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8]; 1085 - extern u8 CCKSwingTable_Ch14[CCK_TABLE_SIZE][8]; 1086 - 1087 1083 extern u32 OFDMSwingTable_New[OFDM_TABLE_SIZE]; 1088 1084 extern u8 CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8]; 1089 1085 extern u8 CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8]; 1090 - 1091 - extern u32 TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE]; 1092 1086 1093 1087 /* */ 1094 1088 /* check Sta pointer valid or not */
+54 -314
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
··· 445 445 /* Efuse related code */ 446 446 /* */ 447 447 static u8 hal_EfuseSwitchToBank( 448 - struct adapter *padapter, u8 bank, bool bPseudoTest 448 + struct adapter *padapter, u8 bank 449 449 ) 450 450 { 451 - u8 bRet = false; 452 - u32 value32 = 0; 453 - #ifdef HAL_EFUSE_MEMORY 454 - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 455 - struct efuse_hal *pEfuseHal = &pHalData->EfuseHal; 456 - #endif 451 + u8 bRet = true; 452 + u32 value32 = rtw_read32(padapter, EFUSE_TEST); 457 453 458 - 459 - if (bPseudoTest) { 460 - #ifdef HAL_EFUSE_MEMORY 461 - pEfuseHal->fakeEfuseBank = bank; 462 - #else 463 - fakeEfuseBank = bank; 464 - #endif 465 - bRet = true; 466 - } else { 467 - value32 = rtw_read32(padapter, EFUSE_TEST); 468 - bRet = true; 469 - switch (bank) { 470 - case 0: 471 - value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0); 472 - break; 473 - case 1: 474 - value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_0); 475 - break; 476 - case 2: 477 - value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_1); 478 - break; 479 - case 3: 480 - value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_2); 481 - break; 482 - default: 483 - value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0); 484 - bRet = false; 485 - break; 486 - } 487 - rtw_write32(padapter, EFUSE_TEST, value32); 454 + switch (bank) { 455 + case 0: 456 + value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0); 457 + break; 458 + case 1: 459 + value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_0); 460 + break; 461 + case 2: 462 + value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_1); 463 + break; 464 + case 3: 465 + value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_2); 466 + break; 467 + default: 468 + value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0); 469 + bRet = false; 470 + break; 488 471 } 472 + rtw_write32(padapter, EFUSE_TEST, value32); 489 473 490 474 return bRet; 491 475 } ··· 478 494 struct adapter *padapter, 479 495 u8 efuseType, 480 496 u8 type, 481 - void *pOut, 482 - bool bPseudoTest 497 + void *pOut 483 498 ) 484 499 { 485 500 switch (type) { ··· 568 585 } 569 586 } 570 587 571 - #define VOLTAGE_V25 0x03 572 - 573 - /* */ 574 - /* The following is for compile ok */ 575 - /* That should be merged with the original in the future */ 576 - /* */ 577 - #define EFUSE_ACCESS_ON_8723 0x69 /* For RTL8723 only. */ 578 - #define REG_EFUSE_ACCESS_8723 0x00CF /* Efuse access protection for RTL8723 */ 579 - 580 588 void Hal_EfusePowerSwitch( 581 - struct adapter *padapter, u8 bWrite, u8 PwrState 589 + struct adapter *padapter, u8 PwrState 582 590 ) 583 591 { 584 592 u8 tempval; ··· 602 628 } while (1); 603 629 } 604 630 605 - rtw_write8(padapter, REG_EFUSE_ACCESS_8723, EFUSE_ACCESS_ON_8723); 631 + rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); 606 632 607 633 /* Reset: 0x0000h[28], default valid */ 608 634 tmpV16 = rtw_read16(padapter, REG_SYS_FUNC_EN); ··· 617 643 tmpV16 |= (LOADER_CLK_EN | ANA8M); 618 644 rtw_write16(padapter, REG_SYS_CLKR, tmpV16); 619 645 } 620 - 621 - if (bWrite) { 622 - /* Enable LDO 2.5V before read/write action */ 623 - tempval = rtw_read8(padapter, EFUSE_TEST+3); 624 - tempval &= 0x0F; 625 - tempval |= (VOLTAGE_V25 << 4); 626 - rtw_write8(padapter, EFUSE_TEST+3, (tempval | 0x80)); 627 - 628 - /* rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); */ 629 - } 630 646 } else { 631 647 rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF); 632 - 633 - if (bWrite) { 634 - /* Disable LDO 2.5V after read/write action */ 635 - tempval = rtw_read8(padapter, EFUSE_TEST+3); 636 - rtw_write8(padapter, EFUSE_TEST+3, (tempval & 0x7F)); 637 - } 638 - 639 648 } 640 649 } 641 650 ··· 626 669 struct adapter *padapter, 627 670 u16 _offset, 628 671 u16 _size_byte, 629 - u8 *pbuf, 630 - bool bPseudoTest 672 + u8 *pbuf 631 673 ) 632 674 { 633 - #ifdef HAL_EFUSE_MEMORY 634 - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 635 - struct efuse_hal *pEfuseHal = &pHalData->EfuseHal; 636 - #endif 637 675 u8 *efuseTbl = NULL; 638 676 u16 eFuse_Addr = 0; 639 677 u8 offset, wden; ··· 650 698 memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN); 651 699 652 700 /* switch bank back to bank 0 for later BT and wifi use. */ 653 - hal_EfuseSwitchToBank(padapter, 0, bPseudoTest); 701 + hal_EfuseSwitchToBank(padapter, 0); 654 702 655 703 while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) { 656 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, bPseudoTest); 704 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader); 657 705 if (efuseHeader == 0xFF) 658 706 break; 659 707 ··· 661 709 if (EXT_HEADER(efuseHeader)) { /* extended header */ 662 710 offset = GET_HDR_OFFSET_2_0(efuseHeader); 663 711 664 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, bPseudoTest); 712 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr); 665 713 if (ALL_WORDS_DISABLED(efuseExtHdr)) 666 714 continue; 667 715 ··· 680 728 for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) { 681 729 /* Check word enable condition in the section */ 682 730 if (!(wden & (0x01<<i))) { 683 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest); 731 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData); 684 732 efuseTbl[addr] = efuseData; 685 733 686 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest); 734 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData); 687 735 efuseTbl[addr+1] = efuseData; 688 736 } 689 737 addr += 2; ··· 698 746 pbuf[i] = efuseTbl[_offset+i]; 699 747 700 748 /* Calculate Efuse utilization */ 701 - EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, bPseudoTest); 749 + Hal_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total); 702 750 used = eFuse_Addr - 1; 703 751 efuse_usage = (u8)((used*100)/total); 704 - if (bPseudoTest) { 705 - #ifdef HAL_EFUSE_MEMORY 706 - pEfuseHal->fakeEfuseUsedBytes = used; 707 - #else 708 - fakeEfuseUsedBytes = used; 709 - #endif 710 - } else { 711 - rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&used); 712 - rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage); 713 - } 752 + 753 + rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&used); 754 + rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage); 714 755 715 756 kfree(efuseTbl); 716 757 } ··· 712 767 struct adapter *padapter, 713 768 u16 _offset, 714 769 u16 _size_byte, 715 - u8 *pbuf, 716 - bool bPseudoTest 770 + u8 *pbuf 717 771 ) 718 772 { 719 - #ifdef HAL_EFUSE_MEMORY 720 - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 721 - struct efuse_hal *pEfuseHal = &pHalData->EfuseHal; 722 - #endif 723 773 u8 *efuseTbl; 724 774 u8 bank; 725 775 u16 eFuse_Addr; ··· 737 797 /* 0xff will be efuse default value instead of 0x00. */ 738 798 memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); 739 799 740 - EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total, bPseudoTest); 800 + Hal_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total); 741 801 742 802 for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */ 743 - if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false) 803 + if (hal_EfuseSwitchToBank(padapter, bank) == false) 744 804 goto exit; 745 805 746 806 eFuse_Addr = 0; 747 807 748 808 while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) { 749 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, bPseudoTest); 809 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader); 750 810 if (efuseHeader == 0xFF) 751 811 break; 752 812 ··· 754 814 if (EXT_HEADER(efuseHeader)) { /* extended header */ 755 815 offset = GET_HDR_OFFSET_2_0(efuseHeader); 756 816 757 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, bPseudoTest); 817 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr); 758 818 if (ALL_WORDS_DISABLED(efuseExtHdr)) 759 819 continue; 760 820 ··· 772 832 for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) { 773 833 /* Check word enable condition in the section */ 774 834 if (!(wden & (0x01<<i))) { 775 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest); 835 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData); 776 836 efuseTbl[addr] = efuseData; 777 837 778 - efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest); 838 + efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData); 779 839 efuseTbl[addr+1] = efuseData; 780 840 } 781 841 addr += 2; ··· 791 851 } 792 852 793 853 /* switch bank back to bank 0 for later BT and wifi use. */ 794 - hal_EfuseSwitchToBank(padapter, 0, bPseudoTest); 854 + hal_EfuseSwitchToBank(padapter, 0); 795 855 796 856 /* Copy from Efuse map to output pointer memory!!! */ 797 857 for (i = 0; i < _size_byte; i++) ··· 800 860 /* */ 801 861 /* Calculate Efuse utilization. */ 802 862 /* */ 803 - EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, bPseudoTest); 863 + Hal_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total); 804 864 used = (EFUSE_BT_REAL_BANK_CONTENT_LEN*(bank-1)) + eFuse_Addr - 1; 805 865 efuse_usage = (u8)((used*100)/total); 806 - if (bPseudoTest) { 807 - #ifdef HAL_EFUSE_MEMORY 808 - pEfuseHal->fakeBTEfuseUsedBytes = used; 809 - #else 810 - fakeBTEfuseUsedBytes = used; 811 - #endif 812 - } else { 813 - rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used); 814 - rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage); 815 - } 866 + 867 + rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used); 868 + rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage); 816 869 817 870 exit: 818 871 kfree(efuseTbl); ··· 816 883 u8 efuseType, 817 884 u16 _offset, 818 885 u16 _size_byte, 819 - u8 *pbuf, 820 - bool bPseudoTest 886 + u8 *pbuf 821 887 ) 822 888 { 823 889 if (efuseType == EFUSE_WIFI) 824 - hal_ReadEFuse_WiFi(padapter, _offset, _size_byte, pbuf, bPseudoTest); 890 + hal_ReadEFuse_WiFi(padapter, _offset, _size_byte, pbuf); 825 891 else 826 - hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf, bPseudoTest); 827 - } 828 - 829 - static u16 hal_EfuseGetCurrentSize_WiFi( 830 - struct adapter *padapter, bool bPseudoTest 831 - ) 832 - { 833 - #ifdef HAL_EFUSE_MEMORY 834 - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 835 - struct efuse_hal *pEfuseHal = &pHalData->EfuseHal; 836 - #endif 837 - u16 efuse_addr = 0; 838 - u16 start_addr = 0; /* for debug */ 839 - u8 hworden = 0; 840 - u8 efuse_data, word_cnts = 0; 841 - u32 count = 0; /* for debug */ 842 - 843 - 844 - if (bPseudoTest) { 845 - #ifdef HAL_EFUSE_MEMORY 846 - efuse_addr = (u16)pEfuseHal->fakeEfuseUsedBytes; 847 - #else 848 - efuse_addr = (u16)fakeEfuseUsedBytes; 849 - #endif 850 - } else 851 - rtw_hal_get_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr); 852 - 853 - start_addr = efuse_addr; 854 - 855 - /* switch bank back to bank 0 for later BT and wifi use. */ 856 - hal_EfuseSwitchToBank(padapter, 0, bPseudoTest); 857 - 858 - count = 0; 859 - while (AVAILABLE_EFUSE_ADDR(efuse_addr)) { 860 - if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false) 861 - goto error; 862 - 863 - if (efuse_data == 0xFF) 864 - break; 865 - 866 - if ((start_addr != 0) && (efuse_addr == start_addr)) { 867 - count++; 868 - 869 - efuse_data = 0xFF; 870 - if (count < 4) { 871 - /* try again! */ 872 - 873 - if (count > 2) { 874 - /* try again form address 0 */ 875 - efuse_addr = 0; 876 - start_addr = 0; 877 - } 878 - 879 - continue; 880 - } 881 - 882 - goto error; 883 - } 884 - 885 - if (EXT_HEADER(efuse_data)) { 886 - efuse_addr++; 887 - efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest); 888 - if (ALL_WORDS_DISABLED(efuse_data)) 889 - continue; 890 - 891 - hworden = efuse_data & 0x0F; 892 - } else { 893 - hworden = efuse_data & 0x0F; 894 - } 895 - 896 - word_cnts = Efuse_CalculateWordCnts(hworden); 897 - efuse_addr += (word_cnts*2)+1; 898 - } 899 - 900 - if (bPseudoTest) { 901 - #ifdef HAL_EFUSE_MEMORY 902 - pEfuseHal->fakeEfuseUsedBytes = efuse_addr; 903 - #else 904 - fakeEfuseUsedBytes = efuse_addr; 905 - #endif 906 - } else 907 - rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr); 908 - 909 - goto exit; 910 - 911 - error: 912 - /* report max size to prevent write efuse */ 913 - EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &efuse_addr, bPseudoTest); 914 - 915 - exit: 916 - 917 - return efuse_addr; 918 - } 919 - 920 - static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) 921 - { 922 - #ifdef HAL_EFUSE_MEMORY 923 - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 924 - struct efuse_hal *pEfuseHal = &pHalData->EfuseHal; 925 - #endif 926 - u16 btusedbytes; 927 - u16 efuse_addr; 928 - u8 bank, startBank; 929 - u8 hworden = 0; 930 - u8 efuse_data, word_cnts = 0; 931 - u16 retU2 = 0; 932 - 933 - if (bPseudoTest) { 934 - #ifdef HAL_EFUSE_MEMORY 935 - btusedbytes = pEfuseHal->fakeBTEfuseUsedBytes; 936 - #else 937 - btusedbytes = fakeBTEfuseUsedBytes; 938 - #endif 939 - } else 940 - rtw_hal_get_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&btusedbytes); 941 - 942 - efuse_addr = (u16)((btusedbytes%EFUSE_BT_REAL_BANK_CONTENT_LEN)); 943 - startBank = (u8)(1+(btusedbytes/EFUSE_BT_REAL_BANK_CONTENT_LEN)); 944 - 945 - EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &retU2, bPseudoTest); 946 - 947 - for (bank = startBank; bank < 3; bank++) { 948 - if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false) 949 - /* bank = EFUSE_MAX_BANK; */ 950 - break; 951 - 952 - /* only when bank is switched we have to reset the efuse_addr. */ 953 - if (bank != startBank) 954 - efuse_addr = 0; 955 - 956 - while (AVAILABLE_EFUSE_ADDR(efuse_addr)) { 957 - if (efuse_OneByteRead(padapter, efuse_addr, 958 - &efuse_data, bPseudoTest) == false) 959 - /* bank = EFUSE_MAX_BANK; */ 960 - break; 961 - 962 - if (efuse_data == 0xFF) 963 - break; 964 - 965 - if (EXT_HEADER(efuse_data)) { 966 - efuse_addr++; 967 - efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest); 968 - 969 - if (ALL_WORDS_DISABLED(efuse_data)) { 970 - efuse_addr++; 971 - continue; 972 - } 973 - 974 - hworden = efuse_data & 0x0F; 975 - } else { 976 - hworden = efuse_data & 0x0F; 977 - } 978 - 979 - word_cnts = Efuse_CalculateWordCnts(hworden); 980 - /* read next header */ 981 - efuse_addr += (word_cnts*2)+1; 982 - } 983 - 984 - /* Check if we need to check next bank efuse */ 985 - if (efuse_addr < retU2) 986 - break; /* don't need to check next bank. */ 987 - } 988 - 989 - retU2 = ((bank-1)*EFUSE_BT_REAL_BANK_CONTENT_LEN)+efuse_addr; 990 - if (bPseudoTest) { 991 - pEfuseHal->fakeBTEfuseUsedBytes = retU2; 992 - } else { 993 - pEfuseHal->BTEfuseUsedBytes = retU2; 994 - } 995 - 996 - return retU2; 997 - } 998 - 999 - u16 Hal_EfuseGetCurrentSize( 1000 - struct adapter *padapter, u8 efuseType, bool bPseudoTest 1001 - ) 1002 - { 1003 - u16 ret = 0; 1004 - 1005 - if (efuseType == EFUSE_WIFI) 1006 - ret = hal_EfuseGetCurrentSize_WiFi(padapter, bPseudoTest); 1007 - else 1008 - ret = hal_EfuseGetCurrentSize_BT(padapter, bPseudoTest); 1009 - 1010 - return ret; 892 + hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf); 1011 893 } 1012 894 1013 895 static struct hal_version ReadChipVersion8723B(struct adapter *padapter) ··· 1186 1438 if (!pEEPROM->bautoload_fail_flag) { /* autoload OK. */ 1187 1439 if (!pEEPROM->EepromOrEfuse) { 1188 1440 /* Read EFUSE real map to shadow. */ 1189 - EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false); 1441 + EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI); 1190 1442 memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B); 1191 1443 } 1192 1444 } else {/* autoload fail */ 1193 1445 if (!pEEPROM->EepromOrEfuse) 1194 - EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false); 1446 + EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI); 1195 1447 memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B); 1196 1448 } 1197 1449 } ··· 1448 1700 u8 package; 1449 1701 u8 efuseContent; 1450 1702 1451 - Efuse_PowerSwitch(padapter, false, true); 1452 - efuse_OneByteRead(padapter, 0x1FB, &efuseContent, false); 1453 - Efuse_PowerSwitch(padapter, false, false); 1703 + Hal_EfusePowerSwitch(padapter, true); 1704 + efuse_OneByteRead(padapter, 0x1FB, &efuseContent); 1705 + Hal_EfusePowerSwitch(padapter, false); 1454 1706 1455 1707 package = efuseContent & 0x7; 1456 1708 switch (package) { ··· 1509 1761 pHalData->EEPROMCustomerID = hwinfo[EEPROM_CustomID_8723B]; 1510 1762 else 1511 1763 pHalData->EEPROMCustomerID = 0; 1512 - } 1513 - 1514 - void Hal_EfuseParseAntennaDiversity_8723B( 1515 - struct adapter *padapter, 1516 - u8 *hwinfo, 1517 - bool AutoLoadFail 1518 - ) 1519 - { 1520 1764 } 1521 1765 1522 1766 void Hal_EfuseParseXtal_8723B(
+4 -2
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
··· 431 431 precvpriv->free_recv_buf_queue_cnt = 0; 432 432 for (i = 0; i < n ; i++) { 433 433 list_del_init(&precvbuf->list); 434 - rtw_os_recvbuf_resource_free(padapter, precvbuf); 434 + if (precvbuf->pskb) 435 + dev_kfree_skb_any(precvbuf->pskb); 435 436 precvbuf++; 436 437 } 437 438 precvpriv->precv_buf = NULL; ··· 468 467 precvpriv->free_recv_buf_queue_cnt = 0; 469 468 for (i = 0; i < NR_RECVBUFF; i++) { 470 469 list_del_init(&precvbuf->list); 471 - rtw_os_recvbuf_resource_free(padapter, precvbuf); 470 + if (precvbuf->pskb) 471 + dev_kfree_skb_any(precvbuf->pskb); 472 472 precvbuf++; 473 473 } 474 474 precvpriv->precv_buf = NULL;
+1 -1
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
··· 76 76 /* check if hardware tx fifo page is enough */ 77 77 if (!rtw_hal_sdio_query_tx_freepage(pri_padapter, PageIdx, pxmitbuf->pg_num)) { 78 78 if (!bUpdatePageNum) { 79 - /* Total number of page is NOT available, so update current FIFO status */ 79 + /* Total page count is not available, so update current FIFO status */ 80 80 HalQueryTxBufferStatus8723BSdio(padapter); 81 81 bUpdatePageNum = true; 82 82 goto query_free_page;
-1
drivers/staging/rtl8723bs/hal/sdio_halinit.c
··· 1071 1071 Hal_EfuseParseChnlPlan_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag); 1072 1072 Hal_EfuseParseXtal_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag); 1073 1073 Hal_EfuseParseThermalMeter_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag); 1074 - Hal_EfuseParseAntennaDiversity_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag); 1075 1074 Hal_EfuseParseCustomerID_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag); 1076 1075 1077 1076 Hal_EfuseParseVoltage_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
+22 -19
drivers/staging/rtl8723bs/include/basic_types.h
··· 22 22 /* TODO: Belows are Sync from SD7-Driver. It is necessary to check correctness */ 23 23 24 24 /* 25 - *Call endian free function when 25 + * Call endian free function when 26 26 * 1. Read/write packet content. 27 27 * 2. Before write integer to IO. 28 28 * 3. After read integer from IO. 29 - */ 29 + */ 30 30 31 31 /* */ 32 32 /* Byte Swapping routine. */ ··· 68 68 (*((u32 *)(_ptr))) = EF2BYTE(_val); \ 69 69 } while (0) 70 70 71 - /* Create a bit mask 71 + /* 72 + * Create a bit mask 72 73 * Examples: 73 74 * BIT_LEN_MASK_32(0) => 0x00000000 74 75 * BIT_LEN_MASK_32(1) => 0x00000001 ··· 83 82 #define BIT_LEN_MASK_8(__bitlen) \ 84 83 (0xFF >> (8 - (__bitlen))) 85 84 86 - /* Create an offset bit mask 85 + /* 86 + * Create an offset bit mask 87 87 * Examples: 88 88 * BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003 89 89 * BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000 ··· 96 94 #define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \ 97 95 (BIT_LEN_MASK_8(__bitlen) << (__bitoffset)) 98 96 99 - /*Description: 97 + /* 98 + * Description: 100 99 * Return 4-byte value in host byte ordering from 101 100 * 4-byte pointer in little-endian system. 102 101 */ ··· 108 105 #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ 109 106 (EF1BYTE(*((u8 *)(__pstart)))) 110 107 111 - /* */ 112 - /* Description: */ 113 - /* Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to */ 114 - /* 4-byte value in host byte ordering. */ 115 - /* */ 108 + /* 109 + * Description: 110 + * Translate subfield (continuous bits in little-endian) of 4-byte value in 111 + * little byte to 4-byte value in host byte ordering. 112 + */ 116 113 #define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ 117 114 (\ 118 115 (LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \ ··· 129 126 BIT_LEN_MASK_8(__bitlen) \ 130 127 ) 131 128 132 - /* */ 133 - /* Description: */ 134 - /* Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering */ 135 - /* and return the result in 4-byte value in host byte ordering. */ 136 - /* */ 129 + /* 130 + * Description: 131 + * Mask subfield (continuous bits in little-endian) of 4-byte value in little 132 + * byte ordering and return the result in 4-byte value in host byte ordering. 133 + */ 137 134 #define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ 138 135 (\ 139 136 LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \ ··· 150 147 (~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \ 151 148 ) 152 149 153 - /* */ 154 - /* Description: */ 155 - /* Set subfield of little-endian 4-byte value to specified value. */ 156 - /* */ 150 + /* 151 + * Description: 152 + * Set subfield of little-endian 4-byte value to specified value. 153 + */ 157 154 #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ 158 155 *((u32 *)(__pstart)) = \ 159 156 ( \
-2
drivers/staging/rtl8723bs/include/drv_types.h
··· 33 33 #include <xmit_osdep.h> 34 34 #include <rtw_recv.h> 35 35 36 - #include <recv_osdep.h> 37 36 #include <rtw_efuse.h> 38 37 #include <hal_intf.h> 39 38 #include <hal_com.h> 40 39 #include <rtw_qos.h> 41 40 #include <rtw_pwrctrl.h> 42 41 #include <rtw_mlme.h> 43 - #include <mlme_osdep.h> 44 42 #include <rtw_io.h> 45 43 #include <rtw_ioctl_set.h> 46 44 #include <osdep_intf.h>
+3 -4
drivers/staging/rtl8723bs/include/hal_intf.h
··· 265 265 u8 SetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue); 266 266 void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level); 267 267 void rtl8723b_SetBeaconRelatedRegisters(struct adapter *padapter); 268 - void Hal_EfusePowerSwitch(struct adapter *padapter, u8 bWrite, u8 PwrState); 268 + void Hal_EfusePowerSwitch(struct adapter *padapter, u8 PwrState); 269 269 void Hal_ReadEFuse(struct adapter *padapter, u8 efuseType, u16 _offset, 270 - u16 _size_byte, u8 *pbuf, bool bPseudoTest); 270 + u16 _size_byte, u8 *pbuf); 271 271 void Hal_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type, 272 - void *pOut, bool bPseudoTest); 273 - u16 Hal_EfuseGetCurrentSize(struct adapter *padapter, u8 efuseType, bool bPseudoTest); 272 + void *pOut); 274 273 void hal_notch_filter_8723b(struct adapter *adapter, bool enable); 275 274 #endif /* __HAL_INTF_H__ */
-19
drivers/staging/rtl8723bs/include/mlme_osdep.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /****************************************************************************** 3 - * 4 - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 - * 6 - ******************************************************************************/ 7 - #ifndef __MLME_OSDEP_H_ 8 - #define __MLME_OSDEP_H_ 9 - 10 - 11 - extern void rtw_init_mlme_timer(struct adapter *padapter); 12 - extern void rtw_os_indicate_disconnect(struct adapter *adapter); 13 - extern void rtw_os_indicate_connect(struct adapter *adapter); 14 - void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted); 15 - extern void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie); 16 - 17 - void rtw_reset_securitypriv(struct adapter *adapter); 18 - 19 - #endif /* _MLME_OSDEP_H_ */
-40
drivers/staging/rtl8723bs/include/recv_osdep.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /****************************************************************************** 3 - * 4 - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 - * 6 - ******************************************************************************/ 7 - #ifndef __RECV_OSDEP_H_ 8 - #define __RECV_OSDEP_H_ 9 - 10 - 11 - extern signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); 12 - extern void _rtw_free_recv_priv(struct recv_priv *precvpriv); 13 - 14 - 15 - extern s32 rtw_recv_entry(union recv_frame *precv_frame); 16 - extern int rtw_recv_indicatepkt(struct adapter *adapter, union recv_frame *precv_frame); 17 - extern void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *preturnedpkt); 18 - 19 - extern void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup); 20 - 21 - int rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); 22 - void rtw_free_recv_priv(struct recv_priv *precvpriv); 23 - 24 - 25 - void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe); 26 - void rtw_os_recv_resource_free(struct recv_priv *precvpriv); 27 - 28 - 29 - void rtw_os_free_recvframe(union recv_frame *precvframe); 30 - 31 - 32 - void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf); 33 - 34 - struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); 35 - void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib); 36 - 37 - void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl); 38 - 39 - 40 - #endif /* */
-2
drivers/staging/rtl8723bs/include/rtl8723b_hal.h
··· 210 210 bool AutoLoadFail); 211 211 void Hal_EfuseParseCustomerID_8723B(struct adapter *padapter, u8 *hwinfo, 212 212 bool AutoLoadFail); 213 - void Hal_EfuseParseAntennaDiversity_8723B(struct adapter *padapter, u8 *hwinfo, 214 - bool AutoLoadFail); 215 213 void Hal_EfuseParseXtal_8723B(struct adapter *padapter, u8 *hwinfo, 216 214 bool AutoLoadFail); 217 215 void Hal_EfuseParseThermalMeter_8723B(struct adapter *padapter, u8 *hwinfo,
+4 -11
drivers/staging/rtl8723bs/include/rtw_efuse.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - /****************************************************************************** 3 - * 4 - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 - * 6 - ******************************************************************************/ 2 + /* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. */ 3 + 7 4 #ifndef __RTW_EFUSE_H__ 8 5 #define __RTW_EFUSE_H__ 9 6 ··· 88 91 /*------------------------Export global variable----------------------------*/ 89 92 90 93 u8 Efuse_CalculateWordCnts(u8 word_en); 91 - void EFUSE_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type, void *pOut, bool bPseudoTest); 92 - u8 efuse_OneByteRead(struct adapter *padapter, u16 addr, u8 *data, bool bPseudoTest); 93 - u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoTest); 94 - 95 - void Efuse_PowerSwitch(struct adapter *padapter, u8 bWrite, u8 PwrState); 94 + u8 efuse_OneByteRead(struct adapter *padapter, u16 addr, u8 *data); 96 95 97 96 u8 EFUSE_Read1Byte(struct adapter *padapter, u16 Address); 98 - void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType, bool bPseudoTest); 97 + void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType); 99 98 void EFUSE_ShadowRead(struct adapter *padapter, u8 Type, u16 Offset, u32 *Value); 100 99 void Rtw_Hal_ReadMACAddrFromFile(struct adapter *padapter); 101 100 u32 Rtw_Hal_readPGDataFromConfigFile(struct adapter *padapter);
+1
drivers/staging/rtl8723bs/include/rtw_mlme.h
··· 395 395 int rtw_select_roaming_candidate(struct mlme_priv *pmlmepriv); 396 396 397 397 void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u32 mstatus); 398 + void rtw_reset_securitypriv(struct adapter *adapter); 398 399 399 400 #endif /* __RTL871X_MLME_H_ */
-2
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
··· 426 426 void init_mlme_ext_priv(struct adapter *padapter); 427 427 int init_hw_mlme_ext(struct adapter *padapter); 428 428 void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext); 429 - extern void init_mlme_ext_timer(struct adapter *padapter); 430 - extern void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta); 431 429 extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); 432 430 433 431 /* void fill_fwpriv(struct adapter *padapter, struct fw_priv *pfwpriv); */
+4
drivers/staging/rtl8723bs/include/rtw_recv.h
··· 342 342 343 343 void rtw_reordering_ctrl_timeout_handler(struct timer_list *t); 344 344 345 + signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); 346 + void _rtw_free_recv_priv(struct recv_priv *precvpriv); 347 + s32 rtw_recv_entry(union recv_frame *precv_frame); 348 + 345 349 static inline u8 *get_rxmem(union recv_frame *precvframe) 346 350 { 347 351 /* always return rx_head... */
-179
drivers/staging/rtl8723bs/os_dep/mlme_linux.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /****************************************************************************** 3 - * 4 - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 - * 6 - ******************************************************************************/ 7 - #include <drv_types.h> 8 - 9 - static void _dynamic_check_timer_handler(struct timer_list *t) 10 - { 11 - struct adapter *adapter = 12 - timer_container_of(adapter, t, mlmepriv.dynamic_chk_timer); 13 - 14 - rtw_dynamic_check_timer_handler(adapter); 15 - 16 - _set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000); 17 - } 18 - 19 - static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t) 20 - { 21 - struct adapter *adapter = 22 - timer_container_of(adapter, t, mlmepriv.set_scan_deny_timer); 23 - 24 - rtw_clear_scan_deny(adapter); 25 - } 26 - 27 - void rtw_init_mlme_timer(struct adapter *padapter) 28 - { 29 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 30 - 31 - timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0); 32 - timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0); 33 - timer_setup(&pmlmepriv->dynamic_chk_timer, 34 - _dynamic_check_timer_handler, 0); 35 - timer_setup(&pmlmepriv->set_scan_deny_timer, 36 - _rtw_set_scan_deny_timer_hdl, 0); 37 - } 38 - 39 - void rtw_os_indicate_connect(struct adapter *adapter) 40 - { 41 - struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); 42 - 43 - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || 44 - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) { 45 - rtw_cfg80211_ibss_indicate_connect(adapter); 46 - } else { 47 - rtw_cfg80211_indicate_connect(adapter); 48 - } 49 - 50 - netif_carrier_on(adapter->pnetdev); 51 - 52 - if (adapter->pid[2] != 0) 53 - rtw_signal_process(adapter->pid[2], SIGALRM); 54 - } 55 - 56 - void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted) 57 - { 58 - rtw_cfg80211_indicate_scan_done(padapter, aborted); 59 - } 60 - 61 - static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE]; 62 - void rtw_reset_securitypriv(struct adapter *adapter) 63 - { 64 - u8 backupPMKIDIndex = 0; 65 - u8 backupTKIPCountermeasure = 0x00; 66 - u32 backupTKIPcountermeasure_time = 0; 67 - /* add for CONFIG_IEEE80211W, none 11w also can use */ 68 - struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; 69 - 70 - spin_lock_bh(&adapter->security_key_mutex); 71 - 72 - if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { 73 - /* 802.1x */ 74 - /* Added by Albert 2009/02/18 */ 75 - /* We have to backup the PMK information for WiFi PMK Caching test item. */ 76 - /* */ 77 - /* Backup the btkip_countermeasure information. */ 78 - /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ 79 - 80 - memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE); 81 - backupPMKIDIndex = adapter->securitypriv.PMKIDIndex; 82 - backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure; 83 - backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time; 84 - 85 - /* reset RX BIP packet number */ 86 - pmlmeext->mgnt_80211w_IPN_rx = 0; 87 - 88 - memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); 89 - 90 - /* Added by Albert 2009/02/18 */ 91 - /* Restore the PMK information to securitypriv structure for the following connection. */ 92 - memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE); 93 - adapter->securitypriv.PMKIDIndex = backupPMKIDIndex; 94 - adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure; 95 - adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time; 96 - 97 - adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; 98 - adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; 99 - 100 - } else { 101 - /* reset values in securitypriv */ 102 - /* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */ 103 - /* */ 104 - struct security_priv *psec_priv = &adapter->securitypriv; 105 - 106 - psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */ 107 - psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_; 108 - psec_priv->dot11PrivacyKeyIndex = 0; 109 - 110 - psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_; 111 - psec_priv->dot118021XGrpKeyid = 1; 112 - 113 - psec_priv->ndisauthtype = Ndis802_11AuthModeOpen; 114 - psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled; 115 - /* */ 116 - } 117 - /* add for CONFIG_IEEE80211W, none 11w also can use */ 118 - spin_unlock_bh(&adapter->security_key_mutex); 119 - } 120 - 121 - void rtw_os_indicate_disconnect(struct adapter *adapter) 122 - { 123 - /* struct rt_pmkid_list backupPMKIDList[ NUM_PMKID_CACHE ]; */ 124 - 125 - netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */ 126 - 127 - rtw_cfg80211_indicate_disconnect(adapter); 128 - 129 - /* modify for CONFIG_IEEE80211W, none 11w also can use the same command */ 130 - rtw_reset_securitypriv_cmd(adapter); 131 - } 132 - 133 - void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) 134 - { 135 - uint len; 136 - u8 *buff, *p, i; 137 - union iwreq_data wrqu; 138 - 139 - buff = NULL; 140 - if (authmode == WLAN_EID_VENDOR_SPECIFIC) { 141 - buff = rtw_zmalloc(IW_CUSTOM_MAX); 142 - if (!buff) 143 - return; 144 - 145 - p = buff; 146 - 147 - p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs ="); 148 - 149 - len = sec_ie[1] + 2; 150 - len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX; 151 - 152 - for (i = 0; i < len; i++) 153 - p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]); 154 - 155 - p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")"); 156 - 157 - memset(&wrqu, 0, sizeof(wrqu)); 158 - 159 - wrqu.data.length = p - buff; 160 - 161 - wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX; 162 - 163 - kfree(buff); 164 - } 165 - } 166 - 167 - void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta) 168 - { 169 - timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0); 170 - } 171 - 172 - void init_mlme_ext_timer(struct adapter *padapter) 173 - { 174 - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 175 - 176 - timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0); 177 - timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0); 178 - timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0); 179 - }
-225
drivers/staging/rtl8723bs/os_dep/recv_linux.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /****************************************************************************** 3 - * 4 - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 - * 6 - ******************************************************************************/ 7 - #include <drv_types.h> 8 - #include <linux/jiffies.h> 9 - #include <net/cfg80211.h> 10 - #include <linux/unaligned.h> 11 - 12 - void rtw_os_free_recvframe(union recv_frame *precvframe) 13 - { 14 - if (precvframe->u.hdr.pkt) { 15 - dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */ 16 - 17 - precvframe->u.hdr.pkt = NULL; 18 - } 19 - } 20 - 21 - /* alloc os related resource in union recv_frame */ 22 - void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe) 23 - { 24 - precvframe->u.hdr.pkt_newalloc = precvframe->u.hdr.pkt = NULL; 25 - } 26 - 27 - /* free os related resource in union recv_frame */ 28 - void rtw_os_recv_resource_free(struct recv_priv *precvpriv) 29 - { 30 - signed int i; 31 - union recv_frame *precvframe; 32 - 33 - precvframe = (union recv_frame *) precvpriv->precv_frame_buf; 34 - 35 - for (i = 0; i < NR_RECVFRAME; i++) { 36 - if (precvframe->u.hdr.pkt) { 37 - /* free skb by driver */ 38 - dev_kfree_skb_any(precvframe->u.hdr.pkt); 39 - precvframe->u.hdr.pkt = NULL; 40 - } 41 - precvframe++; 42 - } 43 - } 44 - 45 - /* free os related resource in struct recv_buf */ 46 - void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf) 47 - { 48 - if (precvbuf->pskb) 49 - dev_kfree_skb_any(precvbuf->pskb); 50 - } 51 - 52 - struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata) 53 - { 54 - u16 eth_type; 55 - struct sk_buff *sub_skb; 56 - struct rx_pkt_attrib *pattrib; 57 - 58 - pattrib = &prframe->u.hdr.attrib; 59 - 60 - sub_skb = rtw_skb_alloc(nSubframe_Length + 12); 61 - if (!sub_skb) 62 - return NULL; 63 - 64 - skb_reserve(sub_skb, 12); 65 - skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length); 66 - 67 - eth_type = get_unaligned_be16(&sub_skb->data[6]); 68 - 69 - if (sub_skb->len >= 8 && 70 - ((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) && 71 - eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || 72 - !memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE))) { 73 - /* 74 - * remove RFC1042 or Bridge-Tunnel encapsulation and replace 75 - * EtherType 76 - */ 77 - skb_pull(sub_skb, SNAP_SIZE); 78 - memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN); 79 - memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN); 80 - } else { 81 - __be16 len; 82 - /* Leave Ethernet header part of hdr and full payload */ 83 - len = htons(sub_skb->len); 84 - memcpy(skb_push(sub_skb, 2), &len, 2); 85 - memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN); 86 - memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN); 87 - } 88 - 89 - return sub_skb; 90 - } 91 - 92 - void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib) 93 - { 94 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 95 - 96 - /* Indicate the packets to upper layer */ 97 - if (pkt) { 98 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { 99 - struct sk_buff *pskb2 = NULL; 100 - struct sta_info *psta = NULL; 101 - struct sta_priv *pstapriv = &padapter->stapriv; 102 - int bmcast = is_multicast_ether_addr(pattrib->dst); 103 - 104 - if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) { 105 - if (bmcast) { 106 - psta = rtw_get_bcmc_stainfo(padapter); 107 - pskb2 = skb_clone(pkt, GFP_ATOMIC); 108 - } else { 109 - psta = rtw_get_stainfo(pstapriv, pattrib->dst); 110 - } 111 - 112 - if (psta) { 113 - struct net_device *pnetdev = (struct net_device *)padapter->pnetdev; 114 - /* skb->ip_summed = CHECKSUM_NONE; */ 115 - pkt->dev = pnetdev; 116 - skb_set_queue_mapping(pkt, rtw_recv_select_queue(pkt)); 117 - 118 - _rtw_xmit_entry(pkt, pnetdev); 119 - 120 - if (bmcast && pskb2) 121 - pkt = pskb2; 122 - else 123 - return; 124 - } 125 - } else { 126 - /* to APself */ 127 - } 128 - } 129 - 130 - pkt->protocol = eth_type_trans(pkt, padapter->pnetdev); 131 - pkt->dev = padapter->pnetdev; 132 - 133 - pkt->ip_summed = CHECKSUM_NONE; 134 - 135 - rtw_netif_rx(padapter->pnetdev, pkt); 136 - } 137 - } 138 - 139 - void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup) 140 - { 141 - enum nl80211_key_type key_type = 0; 142 - union iwreq_data wrqu; 143 - struct iw_michaelmicfailure ev; 144 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 145 - struct security_priv *psecuritypriv = &padapter->securitypriv; 146 - unsigned long cur_time = 0; 147 - 148 - if (psecuritypriv->last_mic_err_time == 0) { 149 - psecuritypriv->last_mic_err_time = jiffies; 150 - } else { 151 - cur_time = jiffies; 152 - 153 - if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) { 154 - psecuritypriv->btkip_countermeasure = true; 155 - psecuritypriv->last_mic_err_time = 0; 156 - psecuritypriv->btkip_countermeasure_time = cur_time; 157 - } else { 158 - psecuritypriv->last_mic_err_time = jiffies; 159 - } 160 - } 161 - 162 - if (bgroup) 163 - key_type |= NL80211_KEYTYPE_GROUP; 164 - else 165 - key_type |= NL80211_KEYTYPE_PAIRWISE; 166 - 167 - cfg80211_michael_mic_failure(padapter->pnetdev, (u8 *)&pmlmepriv->assoc_bssid[0], key_type, -1, 168 - NULL, GFP_ATOMIC); 169 - 170 - memset(&ev, 0x00, sizeof(ev)); 171 - if (bgroup) 172 - ev.flags |= IW_MICFAILURE_GROUP; 173 - else 174 - ev.flags |= IW_MICFAILURE_PAIRWISE; 175 - 176 - ev.src_addr.sa_family = ARPHRD_ETHER; 177 - memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN); 178 - 179 - memset(&wrqu, 0x00, sizeof(wrqu)); 180 - wrqu.data.length = sizeof(ev); 181 - } 182 - 183 - int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame) 184 - { 185 - struct recv_priv *precvpriv; 186 - struct __queue *pfree_recv_queue; 187 - struct sk_buff *skb; 188 - struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; 189 - 190 - precvpriv = &(padapter->recvpriv); 191 - pfree_recv_queue = &(precvpriv->free_recv_queue); 192 - 193 - skb = precv_frame->u.hdr.pkt; 194 - if (!skb) 195 - goto _recv_indicatepkt_drop; 196 - 197 - skb->data = precv_frame->u.hdr.rx_data; 198 - 199 - skb_set_tail_pointer(skb, precv_frame->u.hdr.len); 200 - 201 - skb->len = precv_frame->u.hdr.len; 202 - 203 - rtw_os_recv_indicate_pkt(padapter, skb, pattrib); 204 - 205 - /* pointers to NULL before rtw_free_recvframe() */ 206 - precv_frame->u.hdr.pkt = NULL; 207 - 208 - rtw_free_recvframe(precv_frame, pfree_recv_queue); 209 - 210 - return _SUCCESS; 211 - 212 - _recv_indicatepkt_drop: 213 - 214 - /* enqueue back to free_recv_queue */ 215 - rtw_free_recvframe(precv_frame, pfree_recv_queue); 216 - 217 - return _FAIL; 218 - } 219 - 220 - void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) 221 - { 222 - timer_setup(&preorder_ctrl->reordering_ctrl_timer, 223 - rtw_reordering_ctrl_timeout_handler, 0); 224 - 225 - }
+3 -3
drivers/staging/sm750fb/sm750.h
··· 50 50 51 51 struct lynx_accel { 52 52 /* base virtual address of DPR registers */ 53 - volatile unsigned char __iomem *dprBase; 53 + unsigned char __iomem *dpr_base; 54 54 /* base virtual address of de data port */ 55 - volatile unsigned char __iomem *dpPortBase; 55 + unsigned char __iomem *dp_port_base; 56 56 57 57 /* function pointers */ 58 58 void (*de_init)(struct lynx_accel *accel); ··· 128 128 char __iomem *vstart; 129 129 int offset; 130 130 /* mmio addr of hw cursor */ 131 - volatile char __iomem *mmio; 131 + char __iomem *mmio; 132 132 }; 133 133 134 134 struct lynxfb_crtc {
+4 -4
drivers/staging/sm750fb/sm750_accel.c
··· 17 17 18 18 #include "sm750.h" 19 19 #include "sm750_accel.h" 20 - static inline void write_dpr(struct lynx_accel *accel, int offset, u32 regValue) 20 + static inline void write_dpr(struct lynx_accel *accel, int offset, u32 reg_value) 21 21 { 22 - writel(regValue, accel->dprBase + offset); 22 + writel(reg_value, accel->dpr_base + offset); 23 23 } 24 24 25 25 static inline u32 read_dpr(struct lynx_accel *accel, int offset) 26 26 { 27 - return readl(accel->dprBase + offset); 27 + return readl(accel->dpr_base + offset); 28 28 } 29 29 30 30 static inline void write_dpPort(struct lynx_accel *accel, u32 data) 31 31 { 32 - writel(data, accel->dpPortBase); 32 + writel(data, accel->dp_port_base); 33 33 } 34 34 35 35 void sm750_hw_de_init(struct lynx_accel *accel)
+2 -2
drivers/staging/sm750fb/sm750_hw.c
··· 58 58 } 59 59 pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg); 60 60 61 - sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1; 62 - sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1; 61 + sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1; 62 + sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1; 63 63 64 64 mmio750 = sm750_dev->pvReg; 65 65 sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
+1 -1
drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h
··· 13 13 14 14 /* 15 15 * all the data structures which serialise the MMAL protocol. note 16 - * these are directly mapped onto the recived message data. 16 + * these are directly mapped onto the received message data. 17 17 * 18 18 * BEWARE: They seem to *assume* pointers are u32 and that there is no 19 19 * structure padding!
+1 -1
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
··· 326 326 * committed a buffer_to_host operation to the mmal 327 327 * port without the buffer to back it up (underflow 328 328 * handling) and there is no obvious way to deal with 329 - * this - how is the mmal servie going to react when 329 + * this - how is the mmal service going to react when 330 330 * we fail to do the xfer and reschedule a buffer when 331 331 * it arrives? perhaps a starved flag to indicate a 332 332 * waiting bulk receive?
+1 -1
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
··· 115 115 116 116 /* enable a mmal port 117 117 * 118 - * enables a port and if a buffer callback provided enque buffer 118 + * enables a port and, if a buffer callback provided, enqueues buffer 119 119 * headers as appropriate for the port. 120 120 */ 121 121 int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,