mbox series

[RFC,v2,00/96] wireless: cl8k driver for Celeno IEEE 802.11ax devices

Message ID 20220524113502.1094459-1-viktor.barna@celeno.com
Headers show
Series wireless: cl8k driver for Celeno IEEE 802.11ax devices | expand

Message

Viktor Barna May 24, 2022, 11:33 a.m. UTC
From: Viktor Barna <viktor.barna@celeno.com>

Celeno Communications publishes to the opensource new wireless driver
for an own 802.11 chipset family - 80xx. The main chip supports multiple
simultaneous bands functioning (2.4G/5.2G or 5.2G/6G) over PCIe 3.0
dual-lane interface. Basically, the chip is dual-band concurrent up to
8x8 in total, and up to 6x6 per band, including 802.11ax 160MHz support
and functioning of AP/STA/MESH modes. The driver architecture is strong
SoftMAC.

The current patchset is the second one and is considered to be published 
in form of RFC (Request for Comments, version 2). If there are any
suggestions/propositions - we will be glad to fix them and
eventually share the driver with the community in form of an official patch
(including the firmware binaries).

The RFC is divided into separate patches on a per-file basis to simplify
the review process.

Known issues:
- driver may be configured via config files, that is discouraged by
  upstream and may be changed in the future.

Signed-off-by: Aviad Brikman <aviad.brikman@celeno.com>
Signed-off-by: Eliav Farber <eliav.farber@gmail.com>
Signed-off-by: Maksym Kokhan <maksym.kokhan@celeno.com>
Signed-off-by: Oleksandr Savchenko <oleksandr.savchenko@celeno.com>
Signed-off-by: Shay Bar <shay.bar@celeno.com>
Signed-off-by: Viktor Barna <viktor.barna@celeno.com>
---
v2: 
- Reduce files amount from 256 to 98 (including 43 source files).
- Fix Kconfig vs code inconsistencies.
- Remove Celeno-specific wrappers like cl_snprintf, cl_timer, string
  processors.
- Namespace more functions (with cl_<something>).
- Remove DEV_COREDUMP support (temporary. to minimize size of the RFC).
- Remove CLI handling in the driver (forever, reimplement some of the features
  in the debugfs). 
- Remove netlink vendor-specific commands.
- Remove debugfs code.
- Fix sparse warnings.
- Fix more checkpatch errors/warnings/checks.
- Update codebase to the most recent internal codebase (as of 20.05.22).
- Adjust patch to support Kernel 5.18-rc7.
 
v1: 
- https://lore.kernel.org/linux-wireless/20210617160223.160998-1-viktor.barna@celeno.com/

Viktor Barna (96):
  celeno: add Kconfig
  celeno: add Makefile
  cl8k: add Kconfig
  cl8k: add Makefile
  cl8k: add ampdu.c
  cl8k: add ampdu.h
  cl8k: add bf.c
  cl8k: add bf.h
  cl8k: add calib.c
  cl8k: add calib.h
  cl8k: add channel.c
  cl8k: add channel.h
  cl8k: add chip.c
  cl8k: add chip.h
  cl8k: add config.c
  cl8k: add config.h
  cl8k: add debug.c
  cl8k: add debug.h
  cl8k: add def.h
  cl8k: add dfs.c
  cl8k: add dfs.h
  cl8k: add dsp.c
  cl8k: add dsp.h
  cl8k: add e2p.c
  cl8k: add e2p.h
  cl8k: add eeprom.h
  cl8k: add ela.c
  cl8k: add ela.h
  cl8k: add enhanced_tim.c
  cl8k: add enhanced_tim.h
  cl8k: add fw.c
  cl8k: add fw.h
  cl8k: add hw.c
  cl8k: add hw.h
  cl8k: add ipc_shared.h
  cl8k: add key.c
  cl8k: add key.h
  cl8k: add mac80211.c
  cl8k: add mac80211.h
  cl8k: add mac_addr.c
  cl8k: add mac_addr.h
  cl8k: add main.c
  cl8k: add main.h
  cl8k: add maintenance.c
  cl8k: add maintenance.h
  cl8k: add motion_sense.c
  cl8k: add motion_sense.h
  cl8k: add pci.c
  cl8k: add pci.h
  cl8k: add phy.c
  cl8k: add phy.h
  cl8k: add platform.c
  cl8k: add platform.h
  cl8k: add power.c
  cl8k: add power.h
  cl8k: add radio.c
  cl8k: add radio.h
  cl8k: add rates.c
  cl8k: add rates.h
  cl8k: add recovery.c
  cl8k: add recovery.h
  cl8k: add regdom.c
  cl8k: add regdom.h
  cl8k: add reg/reg_access.h
  cl8k: add reg/reg_defs.h
  cl8k: add rfic.c
  cl8k: add rfic.h
  cl8k: add rx.c
  cl8k: add rx.h
  cl8k: add scan.c
  cl8k: add scan.h
  cl8k: add sounding.c
  cl8k: add sounding.h
  cl8k: add sta.c
  cl8k: add sta.h
  cl8k: add stats.c
  cl8k: add stats.h
  cl8k: add tcv.c
  cl8k: add tcv.h
  cl8k: add temperature.c
  cl8k: add temperature.h
  cl8k: add traffic.c
  cl8k: add traffic.h
  cl8k: add tx.c
  cl8k: add tx.h
  cl8k: add utils.c
  cl8k: add utils.h
  cl8k: add version.c
  cl8k: add version.h
  cl8k: add vif.c
  cl8k: add vif.h
  cl8k: add vns.c
  cl8k: add vns.h
  cl8k: add wrs.c
  cl8k: add wrs.h
  wireless: add Celeno vendor

 drivers/net/wireless/Kconfig                  |    1 +
 drivers/net/wireless/Makefile                 |    1 +
 drivers/net/wireless/celeno/Kconfig           |   17 +
 drivers/net/wireless/celeno/Makefile          |    2 +
 drivers/net/wireless/celeno/cl8k/Kconfig      |   41 +
 drivers/net/wireless/celeno/cl8k/Makefile     |   66 +
 drivers/net/wireless/celeno/cl8k/ampdu.c      |  331 +
 drivers/net/wireless/celeno/cl8k/ampdu.h      |   39 +
 drivers/net/wireless/celeno/cl8k/bf.c         |  346 +
 drivers/net/wireless/celeno/cl8k/bf.h         |   52 +
 drivers/net/wireless/celeno/cl8k/calib.c      | 2266 ++++
 drivers/net/wireless/celeno/cl8k/calib.h      |  390 +
 drivers/net/wireless/celeno/cl8k/channel.c    | 1656 +++
 drivers/net/wireless/celeno/cl8k/channel.h    |  401 +
 drivers/net/wireless/celeno/cl8k/chip.c       |  580 +
 drivers/net/wireless/celeno/cl8k/chip.h       |  182 +
 drivers/net/wireless/celeno/cl8k/config.c     |   46 +
 drivers/net/wireless/celeno/cl8k/config.h     |  405 +
 drivers/net/wireless/celeno/cl8k/debug.c      |  442 +
 drivers/net/wireless/celeno/cl8k/debug.h      |  160 +
 drivers/net/wireless/celeno/cl8k/def.h        |  235 +
 drivers/net/wireless/celeno/cl8k/dfs.c        |  768 ++
 drivers/net/wireless/celeno/cl8k/dfs.h        |  146 +
 drivers/net/wireless/celeno/cl8k/dsp.c        |  627 ++
 drivers/net/wireless/celeno/cl8k/dsp.h        |   27 +
 drivers/net/wireless/celeno/cl8k/e2p.c        |  771 ++
 drivers/net/wireless/celeno/cl8k/e2p.h        |   25 +
 drivers/net/wireless/celeno/cl8k/eeprom.h     |  283 +
 drivers/net/wireless/celeno/cl8k/ela.c        |  230 +
 drivers/net/wireless/celeno/cl8k/ela.h        |   48 +
 .../net/wireless/celeno/cl8k/enhanced_tim.c   |  173 +
 .../net/wireless/celeno/cl8k/enhanced_tim.h   |   19 +
 drivers/net/wireless/celeno/cl8k/fw.c         | 3167 ++++++
 drivers/net/wireless/celeno/cl8k/fw.h         | 1462 +++
 drivers/net/wireless/celeno/cl8k/hw.c         |  432 +
 drivers/net/wireless/celeno/cl8k/hw.h         |  280 +
 drivers/net/wireless/celeno/cl8k/ipc_shared.h | 1386 +++
 drivers/net/wireless/celeno/cl8k/key.c        |  382 +
 drivers/net/wireless/celeno/cl8k/key.h        |   37 +
 drivers/net/wireless/celeno/cl8k/mac80211.c   | 2392 ++++
 drivers/net/wireless/celeno/cl8k/mac80211.h   |  197 +
 drivers/net/wireless/celeno/cl8k/mac_addr.c   |  418 +
 drivers/net/wireless/celeno/cl8k/mac_addr.h   |   61 +
 drivers/net/wireless/celeno/cl8k/main.c       |  603 ++
 drivers/net/wireless/celeno/cl8k/main.h       |   16 +
 .../net/wireless/celeno/cl8k/maintenance.c    |   81 +
 .../net/wireless/celeno/cl8k/maintenance.h    |   17 +
 .../net/wireless/celeno/cl8k/motion_sense.c   |  244 +
 .../net/wireless/celeno/cl8k/motion_sense.h   |   46 +
 drivers/net/wireless/celeno/cl8k/pci.c        | 2468 +++++
 drivers/net/wireless/celeno/cl8k/pci.h        |  194 +
 drivers/net/wireless/celeno/cl8k/phy.c        | 9648 +++++++++++++++++
 drivers/net/wireless/celeno/cl8k/phy.h        | 3680 +++++++
 drivers/net/wireless/celeno/cl8k/platform.c   |  392 +
 drivers/net/wireless/celeno/cl8k/platform.h   |  196 +
 drivers/net/wireless/celeno/cl8k/power.c      | 1123 ++
 drivers/net/wireless/celeno/cl8k/power.h      |   90 +
 drivers/net/wireless/celeno/cl8k/radio.c      | 1113 ++
 drivers/net/wireless/celeno/cl8k/radio.h      |  130 +
 drivers/net/wireless/celeno/cl8k/rates.c      | 1570 +++
 drivers/net/wireless/celeno/cl8k/rates.h      |  154 +
 drivers/net/wireless/celeno/cl8k/recovery.c   |  280 +
 drivers/net/wireless/celeno/cl8k/recovery.h   |   39 +
 .../net/wireless/celeno/cl8k/reg/reg_access.h |  199 +
 .../net/wireless/celeno/cl8k/reg/reg_defs.h   | 5494 ++++++++++
 drivers/net/wireless/celeno/cl8k/regdom.c     |  301 +
 drivers/net/wireless/celeno/cl8k/regdom.h     |   11 +
 drivers/net/wireless/celeno/cl8k/rfic.c       |  232 +
 drivers/net/wireless/celeno/cl8k/rfic.h       |   29 +
 drivers/net/wireless/celeno/cl8k/rx.c         | 1845 ++++
 drivers/net/wireless/celeno/cl8k/rx.h         |  505 +
 drivers/net/wireless/celeno/cl8k/scan.c       |  392 +
 drivers/net/wireless/celeno/cl8k/scan.h       |   53 +
 drivers/net/wireless/celeno/cl8k/sounding.c   | 1121 ++
 drivers/net/wireless/celeno/cl8k/sounding.h   |  151 +
 drivers/net/wireless/celeno/cl8k/sta.c        |  507 +
 drivers/net/wireless/celeno/cl8k/sta.h        |   99 +
 drivers/net/wireless/celeno/cl8k/stats.c      |  438 +
 drivers/net/wireless/celeno/cl8k/stats.h      |  108 +
 drivers/net/wireless/celeno/cl8k/tcv.c        | 1259 +++
 drivers/net/wireless/celeno/cl8k/tcv.h        |  283 +
 .../net/wireless/celeno/cl8k/temperature.c    |  634 ++
 .../net/wireless/celeno/cl8k/temperature.h    |   71 +
 drivers/net/wireless/celeno/cl8k/traffic.c    |  254 +
 drivers/net/wireless/celeno/cl8k/traffic.h    |   77 +
 drivers/net/wireless/celeno/cl8k/tx.c         | 3397 ++++++
 drivers/net/wireless/celeno/cl8k/tx.h         |  467 +
 drivers/net/wireless/celeno/cl8k/utils.c      |  642 ++
 drivers/net/wireless/celeno/cl8k/utils.h      |  185 +
 drivers/net/wireless/celeno/cl8k/version.c    |  147 +
 drivers/net/wireless/celeno/cl8k/version.h    |   23 +
 drivers/net/wireless/celeno/cl8k/vif.c        |  162 +
 drivers/net/wireless/celeno/cl8k/vif.h        |   81 +
 drivers/net/wireless/celeno/cl8k/vns.c        |  354 +
 drivers/net/wireless/celeno/cl8k/vns.h        |   65 +
 drivers/net/wireless/celeno/cl8k/wrs.c        | 3323 ++++++
 drivers/net/wireless/celeno/cl8k/wrs.h        |  565 +
 97 files changed, 66548 insertions(+)
 create mode 100755 drivers/net/wireless/celeno/Kconfig
 create mode 100755 drivers/net/wireless/celeno/Makefile
 create mode 100644 drivers/net/wireless/celeno/cl8k/Kconfig
 create mode 100644 drivers/net/wireless/celeno/cl8k/Makefile
 create mode 100644 drivers/net/wireless/celeno/cl8k/ampdu.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/ampdu.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/bf.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/bf.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/calib.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/calib.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/channel.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/channel.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/chip.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/chip.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/config.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/config.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/debug.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/debug.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/def.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/dfs.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/dfs.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/dsp.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/dsp.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/e2p.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/e2p.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/eeprom.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/ela.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/ela.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/enhanced_tim.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/enhanced_tim.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/fw.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/fw.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/hw.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/hw.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/ipc_shared.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/key.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/key.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/mac80211.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/mac80211.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/mac_addr.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/mac_addr.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/main.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/main.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/maintenance.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/maintenance.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/motion_sense.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/motion_sense.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/pci.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/pci.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/phy.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/phy.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/platform.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/platform.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/power.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/power.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/radio.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/radio.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/rates.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/rates.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/recovery.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/recovery.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/reg/reg_access.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/reg/reg_defs.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/regdom.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/regdom.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/rfic.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/rfic.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/rx.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/rx.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/scan.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/scan.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/sounding.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/sounding.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/sta.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/sta.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/stats.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/stats.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/tcv.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/tcv.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/temperature.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/temperature.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/traffic.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/traffic.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/tx.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/tx.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/utils.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/utils.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/version.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/version.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/vif.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/vif.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/vns.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/vns.h
 create mode 100644 drivers/net/wireless/celeno/cl8k/wrs.c
 create mode 100644 drivers/net/wireless/celeno/cl8k/wrs.h

Comments

Johannes Berg May 26, 2022, 6:18 p.m. UTC | #1
On Tue, 2022-05-24 at 14:33 +0300, viktor.barna@celeno.com wrote:
> +
> +config CL8K_VERSION
> +	string "Version"
> +	depends on CL8K
> +	default "8.1.x"
> +	help
> +	  Sets module version, which may be important for FW compatibility
> +	  analysis and syncing upstream codebase with the internal codebase.
> 

This, along with the def.h stuff using it, and MODULE_VERSION(), is all
rather pointless, I think you should remove it.

johannes
Johannes Berg May 26, 2022, 7:52 p.m. UTC | #2
On Tue, 2022-05-24 at 14:34 +0300, viktor.barna@celeno.com wrote:
> 
> +#define PPE_0US 0
> +#define PPE_8US 1
> +#define PPE_16US 2
> +
> +/*
> + * Extended Channel Switching capability to be set in the 1st byte of
> + * the @WLAN_EID_EXT_CAPABILITY information element
> + */
> +#define WLAN_EXT_CAPA1_2040_BSS_COEX_MGMT_ENABLED BIT(0)
> +
> +/* WLAN_EID_BSS_COEX_2040 = 72 */
> +/* 802.11n 7.3.2.61 */
> +struct ieee80211_bss_coex_20_40_ie {
> +	u8 element_id;
> +	u8 len;
> +	u8 info_req : 1;
> +	/* Inter-BSS set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS */
> +	u8 intolerant40 : 1;
> +	/* Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS */
> +	u8 bss20_width_req : 1;
> +	u8 obss_scan_exemp_req : 1;
> +	u8 obss_scan_exemp_grant : 1;
> +	u8 rsv : 3;
> +} __packed;

You should add these kinds of things to ieee80211.h, but of course they
should be endian safe and not use bitfields.


> +/* WLAN_EID_BSS_INTOLERANT_CHL_REPORT = 73 */
> +/*802.11n 7.3.2.59 */
> +struct ieee80211_bss_intolerant_chl_report_ie {
> +	u8 element_id;
> +	u8 len;
> +	u8 regulatory_class;
> +	u8 ch_list[0];

use [] not [0]

> +} __packed;
> +
> +/* Union options that are not included in 'struct ieee80211_mgmt' */

just add them

johannes
Johannes Berg May 26, 2022, 7:54 p.m. UTC | #3
On Tue, 2022-05-24 at 14:34 +0300, viktor.barna@celeno.com wrote:
> 
> +/*
> + * sw_ctrl includes eights bits (16 - 23) to be used by software.


that makes it sound like these are firmware things and should be endian
safe?

johannes
Jeff Johnson May 26, 2022, 10:31 p.m. UTC | #4
On 5/24/2022 4:34 AM, viktor.barna@celeno.com wrote:
[snip]

> +	/* Determine the bits necessary to cover the number of BSSIDs. */
> +	u8 num_bits_to_mask[ARRAY_SIZE(cl_hw->addresses) * TCV_MAX] = {

is there a reason this isn't static const?

> +		0, /* 0 : 00:1C:51:BD:FB:(0b 0000 0000) -> 0-bit diff (no LAM, original MAC) */
> +		0, /* 1 : 02:1C:51:BD:FB:(0b 0000 0000) -> 0-bit diff (LAM) */
> +
> +		1, /* 2 : 02:1C:51:BD:FB:(0b 0000 0001) -> 1-bit diff (LAM, between address #1) */
> +
> +		2, /* 3 : 02:1C:51:BD:FB:(0b 0000 0011) -> 2-bit diff (LAM) */
> +		2, /* 4 : 02:1C:51:BD:FB:(0b 0000 0010) -> 2-bit diff (LAM) */
> +
> +		3, /* 5 : 02:1C:51:BD:FB:(0b 0000 0111) -> 3-bit diff (LAM) */
> +		3, /* 6 : 02:1C:51:BD:FB:(0b 0000 0100) -> 3-bit diff (LAM) */
> +		3, /* 7 : 02:1C:51:BD:FB:(0b 0000 0101) -> 3-bit diff (LAM) */
> +		3, /* 8 : 02:1C:51:BD:FB:(0b 0000 0110) -> 3-bit diff (LAM) */
> +
> +		4, /* 9 : 02:1C:51:BD:FB:(0b 0000 1111) -> 4-bit diff (LAM) */
> +		4, /* 10: 02:1C:51:BD:FB:(0b 0000 1000) -> 4-bit diff (LAM) */
> +		4, /* 11: 02:1C:51:BD:FB:(0b 0000 1001) -> 4-bit diff (LAM) */
> +		4, /* 12: 02:1C:51:BD:FB:(0b 0000 1010) -> 4-bit diff (LAM) */
> +		4, /* 13: 02:1C:51:BD:FB:(0b 0000 1100) -> 4-bit diff (LAM) */
> +		4, /* 14: 02:1C:51:BD:FB:(0b 0000 1110) -> 4-bit diff (LAM) */
> +		4, /* 15: 02:1C:51:BD:FB:(0b 0000 1011) -> 4-bit diff (LAM) */
> +	};
> +

[snip]

> +	u8 lam_bit_mask[ARRAY_SIZE(cl_hw->addresses) * TCV_MAX] = {

static const?

> +		0b0000, /* 1 addr,  0-bit diff between MAC addrs, LAM is not affecting it */
> +		0b0000, /* 2 addrs, 0-bit diff between MAC addrs, first differs by LAM !!! */
> +		0b0001, /* 3 addrs, 1-bit diff */
> +		0b0011, /* 4 addrs, 2-bit diff */
> +		0b0011, /* 5 addrs, 2-bit diff */
> +
> +		0b0111, /* 6 addrs, 3-bit diff */
> +		0b0111, /* 7 addrs, 3-bit diff */
> +		0b0111, /* 8 addrs, 3-bit diff */
> +		0b0111, /* 9 addrs, 3-bit diff */
> +
> +		0b1111, /* 10 addrs, 4-bit diff */
> +		0b1111, /* 11 addrs, 4-bit diff */
> +		0b1111, /* 12 addrs, 4-bit diff */
> +		0b1111, /* 13 addrs, 4-bit diff */
> +		0b1111, /* 14 addrs, 4-bit diff */
> +		0b1111, /* 15 addrs, 4-bit diff */
> +		0b1111, /* 16 addrs, 4-bit diff */
> +	};
Kalle Valo May 27, 2022, 6:09 a.m. UTC | #5
Johannes Berg <johannes@sipsolutions.net> writes:

> On Tue, 2022-05-24 at 14:33 +0300, viktor.barna@celeno.com wrote:
>> +
>> +config CL8K_VERSION
>> +	string "Version"
>> +	depends on CL8K
>> +	default "8.1.x"
>> +	help
>> +	  Sets module version, which may be important for FW compatibility
>> +	  analysis and syncing upstream codebase with the internal codebase.
>> 
>
> This, along with the def.h stuff using it, and MODULE_VERSION(), is all
> rather pointless, I think you should remove it.

s/should/need to/ :)
Viktor Barna July 11, 2022, 11:04 p.m. UTC | #6
On Fri, 27 May 2022 09:09:19 +0300, kvalo@kernel.org wrote:
>
>> On Thu, 26 May 2022 20:18:35 +0200, johannes@sipsolutions.net wrote:
>> 
>> This, along with the def.h stuff using it, and MODULE_VERSION(), is all
>> rather pointless, I think you should remove it.
>
> s/should/need to/ :)
>

That is an unexpected comment:) Can you please clarify what is wrong with that
place and why it is pointless (regarding the fact that it can be used to keep
track of versions of the code, that were upstreamed)? I can see multiple
drivers with that macro and related defines.

Best regards,
Viktor Barna
Viktor Barna July 11, 2022, 11:17 p.m. UTC | #7
On Thu, 26 May 2022 21:54:36 +0200, johannes@sipsolutions.net wrote:
> that makes it sound like these are firmware things and should be endian
> safe? 

Yes, it should, thanks! PS: can you, please, clarify whether it is ok to reply
with “ACK” for all comments, those does not imply anything special in response?
Just to show, that we saw the comment and will take it into account. Or …is it
enough to mention that in RFCv3 changelist? We are grateful for the review!

Best regards,
Viktor Barna
Johannes Berg July 12, 2022, 7:17 a.m. UTC | #8
On Tue, 2022-07-12 at 02:17 +0300, Viktor Barna wrote:
> On Thu, 26 May 2022 21:54:36 +0200, johannes@sipsolutions.net wrote:
> > that makes it sound like these are firmware things and should be endian
> > safe? 
> 
> Yes, it should, thanks! PS: can you, please, clarify whether it is ok to reply
> with “ACK” for all comments, those does not imply anything special in response?
> Just to show, that we saw the comment and will take it into account. Or …is it
> enough to mention that in RFCv3 changelist? We are grateful for the review!
>