2022-02-24 18:49:33

by Srinivasan Raju

[permalink] [raw]
Subject: [PATCH v22 0/2] wireless: New Driver submission for pureLiFi STA devices

This introduces the pureLiFi LiFi driver for LiFi-X, LiFi-XC
and LiFi-XL USB devices.

LiFi is a mobile wireless technology that uses light
rather than radio frequencies to transmit data.

802.11 bb is focused on introducing necessary changes to
IEEE 802.11 Stds to enable communications in the light medium

---
v22:
- Fix function names to match driver
- Change non constant global to per device
- Remove unused workqueue
v21:
- Address style related comments
- Fix static analysis warnings
v20:
- Remove unused static variable
v19:
- Fix kmemdup null case
v18:
- Use light communication band
v16:
- Fixed atomic variable misuses
- Fixed comments spacing
- Removed static variables used
- Moved #defines to header file
- Removed doxygen style comments
- Removed magic numbers and cleanup code
v15:
- resubmit v14 of the patch
v14:
- Endianess comments addressed
- Sparse checked and fixed warnings
- Firmware files renamed to lowercase
- All other review comments in v13 addressed
v13:
- Removed unused #defines
v12:
- Removed sysfs, procfs related code
- Addressed race condition bug
- Used macros instead of magic numbers in firmware.c
- Added copyright in all files
v11, v10:
- Addressed review comment on readability
- Changed firmware names to match products
v9:
- Addressed review comments on style and content defects
- Used kmemdup instead of alloc and memcpy
v7 , v8:
- Magic numbers removed and used IEEE80211 macors
- Other code style and timer function fixes (mod_timer)
v6:
- Code style fix patch from Joe Perches
v5:
- Code refactoring for clarity and redundnacy removal
- Fix warnings from kernel test robot
v4:
- Code refactoring based on kernel code guidelines
- Remove multi level macors and use kernel debug macros
v3:
- Code style fixes kconfig fix
v2:
- Driver submitted to wireless-next
- Code style fixes and copyright statement fix
v1:
- Driver submitted to staging

Srinivasan Raju (2):
[v21 1/2] nl80211: Add LC placeholder band definition to nl80211_band
[v21 2/2] wireless: Initial driver submission for pureLiFi STA devices

MAINTAINERS | 6 +
drivers/net/wireless/Kconfig | 1 +
drivers/net/wireless/Makefile | 1 +
drivers/net/wireless/purelifi/Kconfig | 17 +
drivers/net/wireless/purelifi/Makefile | 2 +
drivers/net/wireless/purelifi/plfxlc/Kconfig | 14 +
drivers/net/wireless/purelifi/plfxlc/Makefile | 3 +
drivers/net/wireless/purelifi/plfxlc/chip.c | 95 ++
drivers/net/wireless/purelifi/plfxlc/chip.h | 70 ++
.../net/wireless/purelifi/plfxlc/firmware.c | 276 ++++++
drivers/net/wireless/purelifi/plfxlc/intf.h | 52 +
drivers/net/wireless/purelifi/plfxlc/mac.c | 764 +++++++++++++++
drivers/net/wireless/purelifi/plfxlc/mac.h | 184 ++++
drivers/net/wireless/purelifi/plfxlc/usb.c | 908 ++++++++++++++++++
drivers/net/wireless/purelifi/plfxlc/usb.h | 197 ++++
include/uapi/linux/nl80211.h | 2 +
net/mac80211/mlme.c | 1 +
net/mac80211/sta_info.c | 1 +
net/mac80211/tx.c | 3 +-
net/wireless/nl80211.c | 1 +
net/wireless/util.c | 2 +
21 files changed, 2599 insertions(+), 1 deletion(-)
create mode 100644 drivers/net/wireless/purelifi/Kconfig
create mode 100644 drivers/net/wireless/purelifi/Makefile
create mode 100644 drivers/net/wireless/purelifi/plfxlc/Kconfig
create mode 100644 drivers/net/wireless/purelifi/plfxlc/Makefile
create mode 100644 drivers/net/wireless/purelifi/plfxlc/chip.c
create mode 100644 drivers/net/wireless/purelifi/plfxlc/chip.h
create mode 100644 drivers/net/wireless/purelifi/plfxlc/firmware.c
create mode 100644 drivers/net/wireless/purelifi/plfxlc/intf.h
create mode 100644 drivers/net/wireless/purelifi/plfxlc/mac.c
create mode 100644 drivers/net/wireless/purelifi/plfxlc/mac.h
create mode 100644 drivers/net/wireless/purelifi/plfxlc/usb.c
create mode 100644 drivers/net/wireless/purelifi/plfxlc/usb.h

--
2.25.1


2022-02-24 20:49:37

by Srinivasan Raju

[permalink] [raw]
Subject: [PATCH v22 1/2] nl80211: Add LC placeholder band definition to nl80211_band

Define LC band which is a draft under IEEE 802.11 bb
Current NL80211_BAND_LC is a placeholder band
The band will be redefined as IEEE 802.11 bb progresses

Signed-off-by: Srinivasan Raju <[email protected]>
---
include/uapi/linux/nl80211.h | 2 ++
net/mac80211/mlme.c | 1 +
net/mac80211/sta_info.c | 1 +
net/mac80211/tx.c | 3 ++-
net/wireless/nl80211.c | 1 +
net/wireless/util.c | 2 ++
6 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c2efea98e060..cb06fb604a60 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4929,6 +4929,7 @@ enum nl80211_txrate_gi {
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
* @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
* @NL80211_BAND_S1GHZ: around 900MHz, supported by S1G PHYs
+ * @NL80211_BAND_LC: light communication band (placeholder)
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
* since newer kernel versions may support more bands
*/
@@ -4938,6 +4939,7 @@ enum nl80211_band {
NL80211_BAND_60GHZ,
NL80211_BAND_6GHZ,
NL80211_BAND_S1GHZ,
+ NL80211_BAND_LC,

NUM_NL80211_BANDS,
};
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c0ea3b1aa9e1..c577d03ab128 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1490,6 +1490,7 @@ ieee80211_find_80211h_pwr_constr(struct ieee80211_sub_if_data *sdata,
fallthrough;
case NL80211_BAND_2GHZ:
case NL80211_BAND_60GHZ:
+ case NL80211_BAND_LC:
chan_increment = 1;
break;
case NL80211_BAND_5GHZ:
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 2b5acb37587f..36524101d11f 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -444,6 +444,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,

switch (i) {
case NL80211_BAND_2GHZ:
+ case NL80211_BAND_LC:
/*
* We use both here, even if we cannot really know for
* sure the station will support both, but the only use
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2d1193ed3eb5..d311937f2add 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -146,7 +146,8 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
rate = DIV_ROUND_UP(r->bitrate, 1 << shift);

switch (sband->band) {
- case NL80211_BAND_2GHZ: {
+ case NL80211_BAND_2GHZ:
+ case NL80211_BAND_LC: {
u32 flag;
if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
flag = IEEE80211_RATE_MANDATORY_G;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index bf7cd4752547..cf1434049abb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -853,6 +853,7 @@ nl80211_match_band_rssi_policy[NUM_NL80211_BANDS] = {
[NL80211_BAND_5GHZ] = { .type = NLA_S32 },
[NL80211_BAND_6GHZ] = { .type = NLA_S32 },
[NL80211_BAND_60GHZ] = { .type = NLA_S32 },
+ [NL80211_BAND_LC] = { .type = NLA_S32 },
};

static const struct nla_policy
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 18dba3d7c638..2991f711491a 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -80,6 +80,7 @@ u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band)
return 0; /* not supported */
switch (band) {
case NL80211_BAND_2GHZ:
+ case NL80211_BAND_LC:
if (chan == 14)
return MHZ_TO_KHZ(2484);
else if (chan < 14)
@@ -209,6 +210,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband)
WARN_ON(want);
break;
case NL80211_BAND_2GHZ:
+ case NL80211_BAND_LC:
want = 7;
for (i = 0; i < sband->n_bitrates; i++) {
switch (sband->bitrates[i].bitrate) {
--
2.25.1

2022-02-25 10:07:37

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v22 1/2] nl80211: Add LC placeholder band definition to nl80211_band

Srinivasan Raju <[email protected]> writes:

> Define LC band which is a draft under IEEE 802.11 bb
> Current NL80211_BAND_LC is a placeholder band
> The band will be redefined as IEEE 802.11 bb progresses
>
> Signed-off-by: Srinivasan Raju <[email protected]>

No need to submit this patch anymore, Johannes has already applied it:

https://git.kernel.org/linus/63fa04266629

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches