Commit Graph

643 Commits

Author SHA1 Message Date
chao.an
c3b84b9b3b wireless/bcm43xxx: remove unused tx_queue_count
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-26 16:06:20 +08:00
chao.an
43497df78b wireless/bcm43xxx: add dynamic kso control support
1. PMU control by KeepSdioOn(KSO) if firmware support save restore
2. Remove watchdog timer

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-25 19:52:13 +08:00
chao.an
2eb1124db5 wireless/bcm43xxx: correct the return value
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-25 16:45:34 +08:00
chao.an
15864ff109 wireless/bcm43xxx: add get country code support
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-23 21:48:08 +08:00
chao.an
442e75575e wireless/bcm43xxx: add set country code support
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-23 00:08:10 +08:00
chao.an
04fcbb5cb8 wireless/bcm43xxx: add auto power saving support
switch firmware power mode between PM_MAX/PM_FAST

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-21 02:33:18 +08:00
chao.an
2772efc862 wireless/bcm43xxx: remove small chunks to improve clm download speed
Chunk length is fine as long as it does not exceed 1400

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 23:12:10 +08:00
chao.an
2e3ed3ae67 wireless/bcm43xxx: prefer HPWORK if bcmf task has higher priority than HPWORK
Use high priority queue if the bcmf daemon task has a higher priority
than HPWORK, which will bring better performance especially on devices
that focus on real-time of network.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 23:11:52 +08:00
chao.an
47ebec34e3 wireless/bcm43xxx: merge frame send to once to improve the performance
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 20:59:50 +08:00
chao.an
fa6ea23101 wireless/bcm43xxx: enable power saving on netdev up/down
Move sdio/firmware de/initialize to ifup/down

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 19:08:00 +08:00
chao.an
0ec74ec6dd wireless/bcm43xxx: remove global variable for bcmf_sdio_thread
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 11:43:25 +08:00
chao.an
fbddae8813 wireless/bcm43xxx: add customized MAC address support
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-19 10:13:23 +08:00
chao.an
e498e5308a wireless/bcm43xxx: handle disassoc correctly
1. use WLC_DISASSOC to deal disconnect event
2. carrier net device status

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-18 19:43:13 +08:00
chao.an
e6a23e7b8a wireless/bcm43xxx: sort scan result by rssi
1. Replace SCAN_RESULT_SIZE to SCAN_RESULT_ENTRIES
2. filter scan result with better rssi
3. Sort scan result by rssi

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-18 19:42:30 +08:00
Xiang Xiao
0de089e2e8 wireless/bcm43xxx: Don't call bcmf_board_setup_oob_irq in bcmf_sdio_thread
since oob irq is already setup in bcmf_bus_setup_interrupts, it waste
time and energy to do the same thing repeatly in the work thread.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-17 20:12:41 +08:00
chao.an
2992b10fbb wireless/bcm43xxx: add more ioctl command support
Support command:
  SIOCGIWFREQ
  SIOCGIWMODE
  SIOCSIWAP
  SIOCGIWAP
  SIOCGIWESSID
  SIOCGIWRATE
  SIOCGIWTXPOW
  SIOCGIWSENS
  SIOCGIWRANGE

Before:                                    After:
 cp> wapi show wlan0                          cp> wapi show wlan0
 wlan0 Configuration:                         wlan0 Configuration:
        IP: 192.168.31.202                           IP: 192.168.31.202
   NetMask: 255.255.255.0                       NetMask: 255.255.255.0
 ioctl(SIOCGIWFREQ): 88                       Frequency: 5785
 ERROR: wapi_get_freq() failed: -88                Flag: WAPI_FREQ_AUTO
 ioctl(SIOCGIWESSID): 88                        Channel: 157
 ERROR: wapi_get_essid() failed: -88          Frequency: 5785
 ioctl(SIOCGIWMODE): 88                           ESSID: archer5
 ERROR: wapi_get_mode() failed: -88                Flag: WAPI_ESSID_ON
 ioctl(SIOCGIWAP): 88                              Mode: WAPI_MODE_MANAGED
 ERROR: wapi_get_ap() failed: -88                    AP: ec:41:18:e0:76:7f
 ioctl(SIOCGIWRATE): 88                         BitRate: 58500
 ERROR: wapi_get_bitrate() failed: -88             Flag: WAPI_BITRATE_FIXED
 ioctl(SIOCGIWTXPOW): 88                        TxPower: 31
 ERROR: wapi_get_txpower() failed: -88             Flag: WAPI_TXPOWER_DBM
 ioctl(SIOCGIWSENS): 25                           Sense: -17

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 18:27:12 +08:00
chao.an
9c68064024 wireless/bcm43xxx: add status print on bcmf_wl_auth_event_handler()
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 16:17:01 +08:00
chao.an
e2c154dffe wireless/bcm43xxx: configurable buffer size of escan result
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 23:36:40 +08:00
chao.an
29dd12283c wireless/bcm43xxx: replace all busy delay to nxsig_usleep
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 23:02:09 +08:00
chao.an
b33a709213 wireless/bcm43xxx: improve throughput of net driver
1. Wake up tx if there is data alreay to sent after rx update
2. Try tx queue again after every data frame sent

iperf test:

```
TCP RX  4M->16M
⁣TCP TX  2M->14M
⁣UDP RX 18M->26M
UDP TX  2M->18M
```

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 21:08:28 +09:00
Xiang Xiao
f75f100954 bcm43xxx: Remove bcmf_txavail_work and resue bcmf_tx_poll_work
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-16 09:13:16 +03:00
chao.an
6d85e9b320 wireless/bcm43xx: replace sem_wait to uninterruptible version
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 02:44:47 +08:00
chao.an
0951d859d3 wireless/bcm43xxx: configurable schedule priority of daemon thread
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 01:41:50 +08:00
chao.an
4712307ecc wireless/bcm43xxx: fix typo sq_init() -> dq_init()
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-16 01:40:41 +08:00
chao.an
e75c88df5b wireless/bcm43xxx: load nvram from file system
added an option to load nvram from file system, which will help developers
easily to tuning the firmware parameters without compile firmware.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-15 22:19:02 +08:00
chao.an
f6b8cc1407 wireless/bcm430xx: rename chip minor id to 'x'
rename 4301x chip minor id to 'x' to compatible more versions of variant of bcm430xx

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-15 02:01:37 +08:00
chao.an
4659e00fac wireless/bcm43xxx: add extended join parameters
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-15 00:56:31 +08:00
chao.an
28b46bd381 wirless/sdio: frame length should with guard bound
some SDIO device will return the larger frames out of bound

error log:
bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536
bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536
bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-14 18:31:22 +03:00
chao.an
c7fd1a113f wireless/bcm43xxx: add support of bcm43013 chip
Reference:
https://www.broadcom.cn/bcm43013

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-13 21:03:05 +08:00
Xiang Xiao
f1236da21c fs: Make the binary(no process) mode as the default
POSIX require file system shouldn't enable the \r and \n conversion by default
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-07 20:22:26 +03:00
zhanghongyu
035d925864 devif: remove all devif_timer
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-06-02 20:11:50 -03:00
Xiang Xiao
7ec6b4c7dd Change dpends on SCHED_[L|H]PWORK to SCHED_WORKQUEUE
since the code could map the unsupported work to the
supported one and remove select SCHED_WORKQUEUE from
Kconfig since SCHED_[L|H]PWORK already do the selection

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-28 18:41:51 +03:00
Xiang Xiao
1fb8c13e5e Replace nxsem_timedwait_uninterruptible with nxsem_tickwait_uninterruptible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 13:55:58 +03:00
Xiang Xiao
816ce73ab4 Replace nxsem_timedwait with nxsem_tickwait
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 13:55:58 +03:00
Xiang Xiao
22e4f1c59a sched: Remove start from nxsem_tickwait[_uninterruptible]
to simplify both caller and callee

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 13:55:58 +03:00
Petro Karashchenko
09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Petro Karashchenko
68902d8732 pid_t: unify usage of special task IDs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 21:22:32 +08:00
Xiang Xiao
98976176e1 drivers/wireless/gs2200m: Fix compiler warning
wireless/gs2200m.c: In function 'gs2200m_send_cmd':
Error: wireless/gs2200m.c:1555:32: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
 1555 |       memset(pkt_dat, 0, sizeof(pkt_dat));
      |                                ^
Error: wireless/gs2200m.c:1570:36: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
 1570 |           memset(pkt_dat, 0, sizeof(pkt_dat));
      |                                    ^
wireless/gs2200m.c: In function 'gs2200m_ioctl':
Error: wireless/gs2200m.c:318:25: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
  318 |   snprintf(str, 5, "%04d", num);
      |                         ^
wireless/gs2200m.c:318:3: note: 'snprintf' output between 5 and 6 bytes into a destination of size 5
  318 |   snprintf(str, 5, "%04d", num);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-10 19:46:01 +02:00
Alin Jerpelea
32401a0adb drivers: wireless: spirit: exclude BSD components from build
Unless ALLOW_BSD_COMPONENTS is enabled support will not be built

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 22:48:47 +08:00
Alin Jerpelea
bbfed12fd9 drivers: wireless: bluetooth: exclude BSD components from build
Unless ALLOW_BSD_COMPONENTS is enabled support will not be built

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 22:48:47 +08:00
Xiang Xiao
d7fe0127b0 Replece clock_gettime(CLOCK_REALTIME) with clock_systime_timespec if suitable
it's better to call the kernrel api insteaad user space api in kernel

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-24 01:06:36 +08:00
Masayuki Ishikawa
0258968abd drivers: wireless: Fix gs2200m_ioctl_accept()
Summary:
- I received an issue report that multiwebcam in Spresense SDK 2.4.0
  has a problem with the Chrome browser
- Actually, the browser tries to establish 2 connections but
  the multiwebcam can handle only 1 connection. And if accept() for
  the second connection is delayed, the connection no longer exists
  in the gs2200m hardware
- This commit fixes this issue by checking if the cid is valid or not.

Impact:
- gs2200m driver only

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-02-15 10:22:42 +08:00
Alexander Lunev
a597e66070 bcm43xxx: fixed several warnings:
warning: ISO C forbids 'return' with expression, in function returning void [-Wpedantic]
warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'uint8_t * {aka unsigned char *}' [-Wformat=]
warning: too many arguments for format [-Wformat-extra-args]
2022-02-04 15:26:42 -03:00
Petro Karashchenko
08043fb5bc net: unify FAR keyword usage for all net buffer memory mapped buffers
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-20 01:42:56 +08:00
Petro Karashchenko
9551de7115 net: use HTONS, NTOHS, HTONL, NTOHL macro in kernel code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-18 10:59:47 +01:00
Petro Karashchenko
8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
Petro Karashchenko
a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
Xiang Xiao
828f04f0e5 sdio: Move sdio utils functions to drivers/mmcsd
so all sdio client driver can reuse them

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-04 17:44:24 +01:00
Alexander Lunev
76bb5f5a61 bcm43xxx: supported ARM CR4 core and bcm43455 chip in particular 2021-12-30 01:33:13 +08:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00