Re: [PATCH] staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'

2020-12-07 Thread Linus Walleij
On Sun, Dec 6, 2020 at 11:53 AM Sergio Paracuellos
 wrote:

> If the gpio DT node has the 'gpio-ranges' property, the range will be
> added by the gpio core and doesn't need to be added by the pinctrl
> driver.
>
> By having the gpio-ranges property, we can map every pin between
> gpio node and pinctrl node and we can stop using the deprecated
> pinctrl_add_gpio_range() function.
>
> Signed-off-by: Sergio Paracuellos 

Reviewed-by: Linus Walleij 

After this I think the driver looks good and can graduate from staging.
Can you send a patch to move this to drivers/pinctrl next?

I think drivers/pinctrl/pinctrl-rt2880.c since we don't expect a lot
more of them.

Yours,
Linus Walleij
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'

2020-12-07 Thread Sergio Paracuellos
Hi Linus,

On Mon, Dec 7, 2020 at 2:05 PM Linus Walleij  wrote:
>
> On Sun, Dec 6, 2020 at 11:53 AM Sergio Paracuellos
>  wrote:
>
> > If the gpio DT node has the 'gpio-ranges' property, the range will be
> > added by the gpio core and doesn't need to be added by the pinctrl
> > driver.
> >
> > By having the gpio-ranges property, we can map every pin between
> > gpio node and pinctrl node and we can stop using the deprecated
> > pinctrl_add_gpio_range() function.
> >
> > Signed-off-by: Sergio Paracuellos 
>
> Reviewed-by: Linus Walleij 
>
> After this I think the driver looks good and can graduate from staging.
> Can you send a patch to move this to drivers/pinctrl next

>
> I think drivers/pinctrl/pinctrl-rt2880.c since we don't expect a lot
> more of them.


Perfect, let me write the bindings yaml file and send the patch moving this.

What git tree do you prefer the patch to be rebased onto?

>
> Yours,
> Linus Walleij

Best regards,
Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 10/10] staging: rtl8723bs: replace unique macros and ELEMENT_ID

2020-12-07 Thread Greg KH
On Sat, Dec 05, 2020 at 09:45:17PM -0600, Ross Schmidt wrote:
> Replace unique macros and ELEMENT_ID with kernel provided ieee80211_eid
> enum.
> 
> In a several cases multiple macros or constants are replaced by one
> constant.
> 
> WLAN_EID_HT_CAP, _HT_CAPABILITY_IE_, and EID_HTCapability are replace by
> WLAN_EID_HT_CAPABILITY.
> 
> _WPA2_IE_ID_, EID_WPA2, and _RSN_IE_2_ are replaced by WLAN_EID_RSN.
> 
> _HT_EXTRA_INFO_IE_ and _HT_ADD_INFO_IE_ are replaced by
> WLAN_EID_HT_OPERATION.
> 
> WLAN_EID_GENERIC, _WPA_IE_ID_, _SSN_IE_1_, and _VENDOR_SPECIFIC_IE_ are
> replaced by WLAN_EID_VENDOR_SPECIFIC.
> 
> Signed-off-by: Ross Schmidt 

All other patches in this series applied cleanly, please rebase this one
and resend.

You might want to break it up into one-patch-per-constant replacement

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: mf6x4: Fix AI end-of-conversion detection

2020-12-07 Thread Ian Abbott
I have had reports from two different people that attempts to read the
analog input channels of the MF624 board fail with an `ETIMEDOUT` error.

After triggering the conversion, the code calls `comedi_timeout()` with
`mf6x4_ai_eoc()` as the callback function to check if the conversion is
complete.  The callback returns 0 if complete or `-EBUSY` if not yet
complete.  `comedi_timeout()` returns `-ETIMEDOUT` if it has not
completed within a timeout period which is propagated as an error to the
user application.

The existing code considers the conversion to be complete when the EOLC
bit is high.  However, according to the user manuals for the MF624 and
MF634 boards, this test is incorrect because EOLC is an active low
signal that goes high when the conversion is triggered, and goes low
when the conversion is complete.  Fix the problem by inverting the test
of the EOLC bit state.

Fixes: 04b565021a83 ("comedi: Humusoft MF634 and MF624 DAQ cards driver")
Cc:  # v4.4+
Cc: Rostislav Lisovy 
Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/mf6x4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/mf6x4.c 
b/drivers/staging/comedi/drivers/mf6x4.c
index ea430237efa7..9da8dd748078 100644
--- a/drivers/staging/comedi/drivers/mf6x4.c
+++ b/drivers/staging/comedi/drivers/mf6x4.c
@@ -112,8 +112,9 @@ static int mf6x4_ai_eoc(struct comedi_device *dev,
struct mf6x4_private *devpriv = dev->private;
unsigned int status;
 
+   /* EOLC goes low at end of conversion. */
status = ioread32(devpriv->gpioc_reg);
-   if (status & MF6X4_GPIOC_EOLC)
+   if ((status & MF6X4_GPIOC_EOLC) == 0)
return 0;
return -EBUSY;
 }
-- 
2.29.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'

2020-12-07 Thread Linus Walleij
On Mon, Dec 7, 2020 at 2:57 PM Sergio Paracuellos
 wrote:
> On Mon, Dec 7, 2020 at 2:05 PM Linus Walleij  wrote:

> > After this I think the driver looks good and can graduate from staging.
> > Can you send a patch to move this to drivers/pinctrl next
> >
> > I think drivers/pinctrl/pinctrl-rt2880.c since we don't expect a lot
> > more of them.
>
> Perfect, let me write the bindings yaml file and send the patch moving this.
>
> What git tree do you prefer the patch to be rebased onto?

I suppose Gregs since he has some changes to it that it need to
be based on. After v5.11-rc1 it could be the pinctrl tree as well.
I don't know if Greg has a favourite way to de-stage drivers?

Yours,
Linus Walleij
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'

2020-12-07 Thread Greg KH
On Mon, Dec 07, 2020 at 04:40:06PM +0100, Linus Walleij wrote:
> On Mon, Dec 7, 2020 at 2:57 PM Sergio Paracuellos
>  wrote:
> > On Mon, Dec 7, 2020 at 2:05 PM Linus Walleij  
> > wrote:
> 
> > > After this I think the driver looks good and can graduate from staging.
> > > Can you send a patch to move this to drivers/pinctrl next
> > >
> > > I think drivers/pinctrl/pinctrl-rt2880.c since we don't expect a lot
> > > more of them.
> >
> > Perfect, let me write the bindings yaml file and send the patch moving this.
> >
> > What git tree do you prefer the patch to be rebased onto?
> 
> I suppose Gregs since he has some changes to it that it need to
> be based on. After v5.11-rc1 it could be the pinctrl tree as well.
> I don't know if Greg has a favourite way to de-stage drivers?

It all depends on what the subsystem maintainer wants to do.

Sometimes we just do a "add a new driver to the real spot" that goes
through the subsystem tree, and when that is accepted, I delete the
driver in the staging tree.  This is most often in networking.

Or you can wait until -rc1 and do a move in your tree, or just tell me
to do the move in my tree with an ack, and I can handle it all.

Whatever is easier for you is fine with me, I'm flexible :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: Enclose macros in parentheses

2020-12-07 Thread Ferdinand Schober
Enclose macros in parentheses to ensure correct casting behaviour as
suggested by checkpatch.

Co-developed-by: Philipp Bruegmann 
Signed-off-by: Philipp Bruegmann 
Signed-off-by: Ferdinand Schober 
---
 drivers/staging/ks7010/ks_hostif.h | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/ks_hostif.h
index 39138191a556..c62a494ed6bb 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -498,20 +498,20 @@ struct hostif_mic_failure_request {
 #define TX_RATE_FIXED  5
 
 /* 11b rate */
-#define TX_RATE_1M (u8)(10 / 5)/* 11b 11g basic rate */
-#define TX_RATE_2M (u8)(20 / 5)/* 11b 11g basic rate */
-#define TX_RATE_5M (u8)(55 / 5)/* 11g basic rate */
-#define TX_RATE_11M(u8)(110 / 5)   /* 11g basic rate */
+#define TX_RATE_1M ((u8)(10 / 5))  /* 11b 11g basic rate */
+#define TX_RATE_2M ((u8)(20 / 5))  /* 11b 11g basic rate */
+#define TX_RATE_5M ((u8)(55 / 5))  /* 11g basic rate */
+#define TX_RATE_11M((u8)(110 / 5)) /* 11g basic rate */
 
 /* 11g rate */
-#define TX_RATE_6M (u8)(60 / 5)/* 11g basic rate */
-#define TX_RATE_12M(u8)(120 / 5)   /* 11g basic rate */
-#define TX_RATE_24M(u8)(240 / 5)   /* 11g basic rate */
-#define TX_RATE_9M (u8)(90 / 5)
-#define TX_RATE_18M(u8)(180 / 5)
-#define TX_RATE_36M(u8)(360 / 5)
-#define TX_RATE_48M(u8)(480 / 5)
-#define TX_RATE_54M(u8)(540 / 5)
+#define TX_RATE_6M ((u8)(60 / 5))  /* 11g basic rate */
+#define TX_RATE_12M((u8)(120 / 5)) /* 11g basic rate */
+#define TX_RATE_24M((u8)(240 / 5)) /* 11g basic rate */
+#define TX_RATE_9M ((u8)(90 / 5))
+#define TX_RATE_18M((u8)(180 / 5))
+#define TX_RATE_36M((u8)(360 / 5))
+#define TX_RATE_48M((u8)(480 / 5))
+#define TX_RATE_54M((u8)(540 / 5))
 
 static inline bool is_11b_rate(u8 rate)
 {
-- 
2.29.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: ks7010: Enclose macros in parentheses

2020-12-07 Thread Greg KH
On Mon, Dec 07, 2020 at 05:56:46PM +0100, Ferdinand Schober wrote:
> Enclose macros in parentheses to ensure correct casting behaviour as
> suggested by checkpatch.

checkpatch is wrong here :)

always use your brain when making changes like this, checkpatch is just
a perl script, and while it is quite smart, it does have limitations.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/3] pinctrl: ralink: pinctrl driver for the rt2880 family

2020-12-07 Thread Sergio Paracuellos
This series adds a pinctrl driver for ralink rt2880 SoC.

After last cleanup in staging I was told [0] this driver is ready to be
promoted from staging.

This series are rebased on the top of staging-testing.

Thanks in advance for your time.

Best regards,
Sergio Paracuellos

[0]: 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2020-December/149178.html
Sergio Paracuellos (3):
  dt-bindings: pinctrl: rt2880: add binding document
  pinctrl: ralink: add a pinctrl driver for the rt2880 family
  staging: mt7621-pinctrl: remove driver from staging

 .../pinctrl/ralink,rt2880-pinmux.yaml | 82 +++
 drivers/pinctrl/Kconfig   |  6 ++
 drivers/pinctrl/Makefile  |  1 +
 .../pinctrl-rt2880.c  |  0
 drivers/staging/Kconfig   |  2 -
 drivers/staging/Makefile  |  1 -
 drivers/staging/mt7621-pinctrl/Kconfig|  6 --
 drivers/staging/mt7621-pinctrl/Makefile   |  4 -
 drivers/staging/mt7621-pinctrl/TODO   |  6 --
 9 files changed, 89 insertions(+), 19 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
 rename drivers/{staging/mt7621-pinctrl => pinctrl}/pinctrl-rt2880.c (100%)
 delete mode 100644 drivers/staging/mt7621-pinctrl/Kconfig
 delete mode 100644 drivers/staging/mt7621-pinctrl/Makefile
 delete mode 100644 drivers/staging/mt7621-pinctrl/TODO

-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] pinctrl: ralink: add a pinctrl driver for the rt2880 family

2020-12-07 Thread Sergio Paracuellos
These Socs have 1-3 banks of 8-32 gpios. Rather then setting the muxing of each
pin individually, these socs have mux groups that when set will effect 1-N pins.
Pin groups have a 2, 4 or 8 different muxes.

Signed-off-by: Sergio Paracuellos 
---
 drivers/pinctrl/Kconfig  |   6 +
 drivers/pinctrl/Makefile |   1 +
 drivers/pinctrl/pinctrl-rt2880.c | 370 +++
 3 files changed, 377 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-rt2880.c

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 815095326e2d..e97970ec1210 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -215,6 +215,12 @@ config PINCTRL_ROCKCHIP
select MFD_SYSCON
select OF_GPIO
 
+config PINCTRL_RT2880
+bool "RT2880 pinctrl driver for RALINK/Mediatek SOCs"
+depends on RALINK
+select PINMUX
+select GENERIC_PINCONF
+
 config PINCTRL_SINGLE
tristate "One-register-per-pin type device tree based pinctrl driver"
depends on OF
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index f53933b2ff02..0ebc24dad259 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_PINCTRL_STMFX)   += pinctrl-stmfx.o
 obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
 obj-$(CONFIG_PINCTRL_INGENIC)  += pinctrl-ingenic.o
 obj-$(CONFIG_PINCTRL_RK805)+= pinctrl-rk805.o
+obj-$(CONFIG_PINCTRL_RT2880)   += pinctrl-rt2880.o
 obj-$(CONFIG_PINCTRL_OCELOT)   += pinctrl-ocelot.o
 obj-$(CONFIG_PINCTRL_EQUILIBRIUM)   += pinctrl-equilibrium.o
 
diff --git a/drivers/pinctrl/pinctrl-rt2880.c b/drivers/pinctrl/pinctrl-rt2880.c
new file mode 100644
index ..e61dbe186bc9
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-rt2880.c
@@ -0,0 +1,370 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ *  Copyright (C) 2013 John Crispin 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "pinctrl-utils.h"
+
+#define SYSC_REG_GPIO_MODE 0x60
+#define SYSC_REG_GPIO_MODE20x64
+
+struct rt2880_priv {
+   struct device *dev;
+
+   struct pinctrl_pin_desc *pads;
+   struct pinctrl_desc *desc;
+
+   struct rt2880_pmx_func **func;
+   int func_count;
+
+   struct rt2880_pmx_group *groups;
+   const char **group_names;
+   int group_count;
+
+   u8 *gpio;
+   int max_pins;
+};
+
+static int rt2880_get_group_count(struct pinctrl_dev *pctrldev)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   return p->group_count;
+}
+
+static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
+unsigned int group)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   return (group >= p->group_count) ? NULL : p->group_names[group];
+}
+
+static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
+unsigned int group,
+const unsigned int **pins,
+unsigned int *num_pins)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   if (group >= p->group_count)
+   return -EINVAL;
+
+   *pins = p->groups[group].func[0].pins;
+   *num_pins = p->groups[group].func[0].pin_count;
+
+   return 0;
+}
+
+static const struct pinctrl_ops rt2880_pctrl_ops = {
+   .get_groups_count   = rt2880_get_group_count,
+   .get_group_name = rt2880_get_group_name,
+   .get_group_pins = rt2880_get_group_pins,
+   .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
+   .dt_free_map= pinconf_generic_dt_free_map,
+};
+
+static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   return p->func_count;
+}
+
+static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev,
+   unsigned int func)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   return p->func[func]->name;
+}
+
+static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev,
+  unsigned int func,
+  const char * const **groups,
+  unsigned int * const num_groups)
+{
+   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+
+   if (p->func[func]->group_count == 1)
+   *groups = &p->group_names[p->func[func]->groups[0]];
+   else
+   *groups = p->group_names;
+
+   *num_groups = p->func[func]->group_count;
+
+   return 0;
+}
+
+static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
+  unsigned int func, unsigned int group)
+{
+  

[PATCH 1/3] dt-bindings: pinctrl: rt2880: add binding document

2020-12-07 Thread Sergio Paracuellos
The commit adds rt2880 compatible node in binding document.

Signed-off-by: Sergio Paracuellos 
---
 .../pinctrl/ralink,rt2880-pinmux.yaml | 82 +++
 1 file changed, 82 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml

diff --git 
a/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml 
b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
new file mode 100644
index ..d946219a115c
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/ralink,rt2880-pinmux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ralink rt2880 pinmux controller
+
+maintainers:
+  - Sergio Paracuellos 
+
+description:
+  The rt2880 pinmux can only set the muxing of pin groups. muxing indiviual 
pins
+  is not supported. There is no pinconf support.
+
+properties:
+  compatible:
+enum:
+  - ralink,rt2880-pinmux
+
+  pinctrl-0:
+description:
+  A phandle to the node containing the subnodes containing default
+  configurations.
+
+  pinctrl-names:
+description:
+  A pinctrl state named "default" must be defined.
+const: default
+
+required:
+  - compatible
+  - pinctrl-names
+  - pinctrl-0
+
+patternProperties:
+  '^.*$':
+if:
+  type: object
+  description: |
+A pinctrl node should contain at least one subnodes representing the
+pinctrl groups available on the machine.
+  $ref: "pinmux-node.yaml"
+  required:
+- groups
+- function
+  additionalProperties: false
+then:
+  properties:
+groups:
+  description:
+Name of the pin group to use for the functions.
+  $ref: "/schemas/types.yaml#/definitions/string"
+  enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
+ pcie, sdhci]
+function:
+  description:
+The mux function to select
+  $ref: "/schemas/types.yaml#/definitions/string"
+  enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
+ mdio, nand1, nand2, sdhci]
+
+additionalProperties: false
+
+examples:
+  # Pinmux controller node
+  - |
+pinctrl {
+  compatible = "ralink,rt2880-pinmux";
+  pinctrl-names = "default";
+  pinctrl-0 = <&state_default>;
+
+  state_default: pinctrl0 {
+  };
+
+  i2c_pins: i2c0 {
+i2c0 {
+  groups = "i2c";
+  function = "i2c";
+};
+  };
+};
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: mt7621-pinctrl: remove driver from staging

2020-12-07 Thread Sergio Paracuellos
Remove this driver from staging because it has been moved
into its properly place in the kernel.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/Kconfig   |   2 -
 drivers/staging/Makefile  |   1 -
 drivers/staging/mt7621-pinctrl/Kconfig|   6 -
 drivers/staging/mt7621-pinctrl/Makefile   |   4 -
 drivers/staging/mt7621-pinctrl/TODO   |   6 -
 .../staging/mt7621-pinctrl/pinctrl-rt2880.c   | 370 --
 6 files changed, 389 deletions(-)
 delete mode 100644 drivers/staging/mt7621-pinctrl/Kconfig
 delete mode 100644 drivers/staging/mt7621-pinctrl/Makefile
 delete mode 100644 drivers/staging/mt7621-pinctrl/TODO
 delete mode 100644 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 9b7cb7c5766a..c42708e60afc 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -94,8 +94,6 @@ source "drivers/staging/mt7621-pci/Kconfig"
 
 source "drivers/staging/mt7621-pci-phy/Kconfig"
 
-source "drivers/staging/mt7621-pinctrl/Kconfig"
-
 source "drivers/staging/mt7621-dma/Kconfig"
 
 source "drivers/staging/ralink-gdma/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 38226737c9f3..ebcc646d7b51 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_BCM2835_VCHIQ)   += vc04_services/
 obj-$(CONFIG_PI433)+= pi433/
 obj-$(CONFIG_PCI_MT7621)   += mt7621-pci/
 obj-$(CONFIG_PCI_MT7621_PHY)   += mt7621-pci-phy/
-obj-$(CONFIG_PINCTRL_RT2880)   += mt7621-pinctrl/
 obj-$(CONFIG_SOC_MT7621)   += mt7621-dma/
 obj-$(CONFIG_DMA_RALINK)   += ralink-gdma/
 obj-$(CONFIG_SOC_MT7621)   += mt7621-dts/
diff --git a/drivers/staging/mt7621-pinctrl/Kconfig 
b/drivers/staging/mt7621-pinctrl/Kconfig
deleted file mode 100644
index f42974026480..
--- a/drivers/staging/mt7621-pinctrl/Kconfig
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-config PINCTRL_RT2880
-   bool "RT2800 pinctrl driver for RALINK/Mediatek SOCs"
-   depends on RALINK
-   select PINMUX
-   select GENERIC_PINCONF
diff --git a/drivers/staging/mt7621-pinctrl/Makefile 
b/drivers/staging/mt7621-pinctrl/Makefile
deleted file mode 100644
index 49445f40c3cd..
--- a/drivers/staging/mt7621-pinctrl/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_PINCTRL_RT2880)   += pinctrl-rt2880.o
-
-ccflags-y += -I$(srctree)/drivers/pinctrl
diff --git a/drivers/staging/mt7621-pinctrl/TODO 
b/drivers/staging/mt7621-pinctrl/TODO
deleted file mode 100644
index b2c235a16d5c..
--- a/drivers/staging/mt7621-pinctrl/TODO
+++ /dev/null
@@ -1,6 +0,0 @@
-
-- general code review and cleanup
-- should probably be always selected by 'config RALINK'
-- ensure device-tree requirements are documented
-
-Cc: NeilBrown 
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
deleted file mode 100644
index e61dbe186bc9..
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ /dev/null
@@ -1,370 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *  Copyright (C) 2013 John Crispin 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-#include "core.h"
-#include "pinctrl-utils.h"
-
-#define SYSC_REG_GPIO_MODE 0x60
-#define SYSC_REG_GPIO_MODE20x64
-
-struct rt2880_priv {
-   struct device *dev;
-
-   struct pinctrl_pin_desc *pads;
-   struct pinctrl_desc *desc;
-
-   struct rt2880_pmx_func **func;
-   int func_count;
-
-   struct rt2880_pmx_group *groups;
-   const char **group_names;
-   int group_count;
-
-   u8 *gpio;
-   int max_pins;
-};
-
-static int rt2880_get_group_count(struct pinctrl_dev *pctrldev)
-{
-   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
-
-   return p->group_count;
-}
-
-static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
-unsigned int group)
-{
-   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
-
-   return (group >= p->group_count) ? NULL : p->group_names[group];
-}
-
-static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
-unsigned int group,
-const unsigned int **pins,
-unsigned int *num_pins)
-{
-   struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
-
-   if (group >= p->group_count)
-   return -EINVAL;
-
-   *pins = p->groups[group].func[0].pins;
-   *num_pins = p->groups[group].func[0].pin_count;
-
-   return 0;
-}
-
-static const struct pinctrl_ops rt2880_pctrl_ops = {
-   .get_groups_count   = rt2880_get_group_count,
-   .get_group_name 

[PATCH 00/12] media: atomisp: Codingstyle

2020-12-07 Thread Philipp Gerlesberger
Hello!

This series fix some codingstyle errors in the files
rmgr_vbuf.c, ia_css_rmgr.h, timer.c, spctrl.c and queue.c
in the drivers/staging/media area.

Best regards
Philipp

--
  media: atomsip: Convert comments to C99 initializers
  media: atomisp: Fix Block Comments
  media: atomisp: Fix EMBEDDED_FUNCTION_NAME warning
  media: atomisp: Fix OPEN_ENDED_LINE
  media: atomisp: Fix overlong line
  media: atomisp: Add parentheses
  media: atomisp: Fix funciton decleration
  media: atomisp: Delete braces
  media: atomisp: Fix PARENTHESIS_ALIGNMENT
  media: atomisp: Fix BLOCK_COMMENT_STYLE
  media: atomisp: Write function decleration in one line
  media: atomisp: Fix LOGICAL_CONTINUATIONS

 .../atomisp/pci/runtime/queue/src/queue.c | 48 +-
 .../pci/runtime/rmgr/interface/ia_css_rmgr.h  |  4 +-
 .../atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c  | 49 +--
 .../atomisp/pci/runtime/spctrl/src/spctrl.c   |  7 ++-
 .../atomisp/pci/runtime/timer/src/timer.c |  7 +--
 5 files changed, 44 insertions(+), 71 deletions(-)

-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/12] media: atomsip: Convert comments to C99 initializers

2020-12-07 Thread Philipp Gerlesberger
The struct initalizers have been changed as recommended on
https://kernelnewbies.org/KernelJanitors/Todo

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 .../atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c  | 30 +--
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index b4f53be18e7f..af61d05e88d3 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -31,33 +31,33 @@ static struct ia_css_rmgr_vbuf_handle 
handle_table[NUM_HANDLES];
  * @brief VBUF resource pool - refpool
  */
 static struct ia_css_rmgr_vbuf_pool refpool = {
-   false,  /* copy_on_write */
-   false,  /* recycle */
-   0,  /* size */
-   0,  /* index */
-   NULL,   /* handles */
+   .copy_on_write  = false,
+   .recycle= false,
+   .size   = 0,
+   .index  = 0,
+   .handles= NULL,
 };
 
 /*
  * @brief VBUF resource pool - writepool
  */
 static struct ia_css_rmgr_vbuf_pool writepool = {
-   true,   /* copy_on_write */
-   false,  /* recycle */
-   0,  /* size */
-   0,  /* index */
-   NULL,   /* handles */
+   .copy_on_write  = true,
+   .recycle= false,
+   .size   = 0,
+   .index  = 0,
+   .handles= NULL,
 };
 
 /*
  * @brief VBUF resource pool - hmmbufferpool
  */
 static struct ia_css_rmgr_vbuf_pool hmmbufferpool = {
-   true,   /* copy_on_write */
-   true,   /* recycle */
-   32, /* size */
-   0,  /* index */
-   NULL,   /* handles */
+   .copy_on_write  = true,
+   .recycle= true,
+   .size   = 32,
+   .index  = 0,
+   .handles= NULL,
 };
 
 struct ia_css_rmgr_vbuf_pool *vbuf_ref = &refpool;
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/12] media: atomisp: Fix PARENTHESIS_ALIGNMENT

2020-12-07 Thread Philipp Gerlesberger
You can sum up the two lines, because the maximum line length of
100 columns is not exceeded.

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c 
b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
index 753a99703f1e..38f86764ccfc 100644
--- a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
+++ b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
@@ -37,8 +37,7 @@ static struct spctrl_context_info spctrl_cofig_info[N_SP_ID];
 static bool spctrl_loaded[N_SP_ID] = {0};
 
 /* Load firmware */
-int ia_css_spctrl_load_fw(sp_ID_t sp_id,
- ia_css_spctrl_cfg *spctrl_cfg)
+int ia_css_spctrl_load_fw(sp_ID_t sp_id, ia_css_spctrl_cfg *spctrl_cfg)
 {
ia_css_ptr code_addr = mmgr_NULL;
struct ia_css_sp_init_dmem_cfg *init_dmem_cfg;
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/12] media: atomisp: Delete braces

2020-12-07 Thread Philipp Gerlesberger
WARNING:BRACES: braces {} are not necessary for single statement blocks

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c 
b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
index 00b54a0613bb..08f5c3ea6d29 100644
--- a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
+++ b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
@@ -23,9 +23,7 @@ int ia_css_timer_get_current_tick(struct ia_css_clock_tick 
*curr_ts)
 {
assert(curr_ts);
if (!curr_ts)
-   {
return -EINVAL;
-   }
curr_ts->ticks = (clock_value_t)gp_timer_read(GP_TIMER_SEL);
return 0;
 }
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/12] media: atomisp: Fix Block Comments

2020-12-07 Thread Philipp Gerlesberger
Block comments should use * on subsequent lines and
should use a trailing */ on a separate line.

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 .../staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index af61d05e88d3..4ba5b8f88a7d 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -98,7 +98,7 @@ void ia_css_rmgr_refcount_retain_vbuf(struct 
ia_css_rmgr_vbuf_handle **handle)
}
}
/* if the loop dus not break and *handle == NULL
-  this is an error handle and report it.
+* this is an error handle and report it.
 */
if (!*handle) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
@@ -253,7 +253,8 @@ void rmgr_pop_handle(struct ia_css_rmgr_vbuf_pool *pool,
*handle = pool->handles[i];
pool->handles[i] = NULL;
/* dont release, we are returning it...
-  ia_css_rmgr_refcount_release_vbuf(handle); */
+* ia_css_rmgr_refcount_release_vbuf(handle);
+*/
return;
}
}
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/12] media: atomisp: Add parentheses

2020-12-07 Thread Philipp Gerlesberger
ERROR:COMPLEX_MACRO: Macros with complex values should be
enclosed in parentheses

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 .../media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
index 9cd3d92b34c9..2c02dd1cf27a 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
@@ -22,8 +22,8 @@
 #define STORAGE_CLASS_RMGR_H extern
 #define STORAGE_CLASS_RMGR_C
 #else  /* __INLINE_RMGR__ */
-#define STORAGE_CLASS_RMGR_H static inline
-#define STORAGE_CLASS_RMGR_C static inline
+#define STORAGE_CLASS_RMGR_H (static inline)
+#define STORAGE_CLASS_RMGR_C (static inline)
 #endif /* __INLINE_RMGR__ */
 
 /**
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/12] media: atomisp: Fix OPEN_ENDED_LINE

2020-12-07 Thread Philipp Gerlesberger
Lines should not end with a '('

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index 3fb3c8c48f0b..e4483d41ec7a 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -190,8 +190,7 @@ void ia_css_rmgr_uninit_vbuf(struct ia_css_rmgr_vbuf_pool 
*pool)
/* free memory */
hmm_free(pool->handles[i]->vptr);
/* remove from refcount admin */
-   ia_css_rmgr_refcount_release_vbuf(
-   &pool->handles[i]);
+   
ia_css_rmgr_refcount_release_vbuf(&pool->handles[i]);
}
}
/* now free the pool handles list */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/12] media: atomisp: Fix LOGICAL_CONTINUATIONS

2020-12-07 Thread Philipp Gerlesberger
Logical continuations should be on the previous line

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c 
b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
index 2f1c2df59f71..7d44070c7114 100644
--- a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
+++ b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
@@ -24,8 +24,8 @@
  */
 int ia_css_queue_local_init(ia_css_queue_t *qhandle, ia_css_queue_local_t 
*desc)
 {
-   if (NULL == qhandle || NULL == desc
-   || NULL == desc->cb_elems || NULL == desc->cb_desc) {
+   if (NULL == qhandle || NULL == desc ||
+   NULL == desc->cb_elems || NULL == desc->cb_desc) {
/* Invalid parameters, return error*/
return -EINVAL;
}
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/12] media: atomisp: Fix overlong line

2020-12-07 Thread Philipp Gerlesberger
Line length of 105 exceeds 100 columns.

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index e4483d41ec7a..e4ce8bbacd54 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -294,7 +294,8 @@ void ia_css_rmgr_acq_vbuf(struct ia_css_rmgr_vbuf_pool 
*pool,
}
if ((*handle)->vptr == 0x0) {
/* we need to allocate */
-   (*handle)->vptr = hmm_alloc((*handle)->size, 
HMM_BO_PRIVATE, 0, NULL, 0);
+   (*handle)->vptr = hmm_alloc((*handle)->size,
+HMM_BO_PRIVATE, 0, 
NULL, 0);
} else {
/* we popped a buffer */
return;
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/12] media: atomisp: Fix EMBEDDED_FUNCTION_NAME warning

2020-12-07 Thread Philipp Gerlesberger
Use the automatically defined __func__ macro instead of the function name,
so it stays correct when the function is renamed.

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 .../media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c| 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c 
b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index 4ba5b8f88a7d..3fb3c8c48f0b 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -119,8 +119,7 @@ void ia_css_rmgr_refcount_retain_vbuf(struct 
ia_css_rmgr_vbuf_handle **handle)
 void ia_css_rmgr_refcount_release_vbuf(struct ia_css_rmgr_vbuf_handle **handle)
 {
if ((!handle) || ((*handle) == NULL) || (((*handle)->count) == 0)) {
-   ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
-   "ia_css_rmgr_refcount_release_vbuf() 
invalid arguments!\n");
+   ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR, "%s invalid 
arguments!\n", __func__);
return;
}
/* decrease reference count */
@@ -175,10 +174,9 @@ void ia_css_rmgr_uninit_vbuf(struct ia_css_rmgr_vbuf_pool 
*pool)
 {
u32 i;
 
-   ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_rmgr_uninit_vbuf()\n");
+   ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%s\n", __func__);
if (!pool) {
-   ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
-   "ia_css_rmgr_uninit_vbuf(): NULL 
argument\n");
+   ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR, "%s NULL argument\n", 
__func__);
return;
}
if (pool->handles) {
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/12] media: atomisp: Fix BLOCK_COMMENT_STYLE

2020-12-07 Thread Philipp Gerlesberger
Block comments should align the * on each line

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c 
b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
index 38f86764ccfc..7f4592565af6 100644
--- a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
+++ b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c
@@ -105,8 +105,8 @@ int ia_css_spctrl_load_fw(sp_ID_t sp_id, ia_css_spctrl_cfg 
*spctrl_cfg)
 void sh_css_spctrl_reload_fw(sp_ID_t sp_id)
 {
/* now we program the base address into the icache and
-   * invalidate the cache.
-   */
+* invalidate the cache.
+*/
sp_ctrl_store(sp_id, SP_ICACHE_ADDR_REG,
  (hrt_data)spctrl_cofig_info[sp_id].code_addr);
sp_ctrl_setbit(sp_id, SP_ICACHE_INV_REG, SP_ICACHE_INV_BIT);
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/12] media: atomisp: Fix funciton decleration

2020-12-07 Thread Philipp Gerlesberger
Write return_type, function_name and parameters in one line
because lines should not end with a '(' [OPEN_ENDED_LINE]
Write open brace ’{’ on the next line to fix OPEN_BRACE Error

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c 
b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
index 679ef8242574..00b54a0613bb 100644
--- a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
+++ b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c
@@ -19,9 +19,8 @@
 #include "gp_timer.h" /*gp_timer_read()*/
 #include "assert_support.h"
 
-int
-ia_css_timer_get_current_tick(
-struct ia_css_clock_tick *curr_ts) {
+int ia_css_timer_get_current_tick(struct ia_css_clock_tick *curr_ts)
+{
assert(curr_ts);
if (!curr_ts)
{
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/12] media: atomisp: Write function decleration in one line

2020-12-07 Thread Philipp Gerlesberger
CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
WARNING:LEADING_SPACE: please, no spaces at the start of a line
Avoid these errors by writing the function decleration in one line.

Co-developed-by: Andrey Khlopkov 
Signed-off-by: Andrey Khlopkov 
Signed-off-by: Philipp Gerlesberger 
---
 .../atomisp/pci/runtime/queue/src/queue.c | 44 +--
 1 file changed, 11 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c 
b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
index aea6c66a3cee..2f1c2df59f71 100644
--- a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
+++ b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c
@@ -22,9 +22,7 @@
 /*
  * Queue Public APIs
  */
-int ia_css_queue_local_init(
-ia_css_queue_t *qhandle,
-ia_css_queue_local_t *desc)
+int ia_css_queue_local_init(ia_css_queue_t *qhandle, ia_css_queue_local_t 
*desc)
 {
if (NULL == qhandle || NULL == desc
|| NULL == desc->cb_elems || NULL == desc->cb_desc) {
@@ -43,9 +41,7 @@ int ia_css_queue_local_init(
return 0;
 }
 
-int ia_css_queue_remote_init(
-ia_css_queue_t *qhandle,
-ia_css_queue_remote_t *desc)
+int ia_css_queue_remote_init(ia_css_queue_t *qhandle, ia_css_queue_remote_t 
*desc)
 {
if (NULL == qhandle || NULL == desc) {
/* Invalid parameters, return error*/
@@ -69,8 +65,7 @@ int ia_css_queue_remote_init(
return 0;
 }
 
-int ia_css_queue_uninit(
-ia_css_queue_t *qhandle)
+int ia_css_queue_uninit(ia_css_queue_t *qhandle)
 {
if (!qhandle)
return -EINVAL;
@@ -84,9 +79,7 @@ int ia_css_queue_uninit(
return 0;
 }
 
-int ia_css_queue_enqueue(
-ia_css_queue_t *qhandle,
-uint32_t item)
+int ia_css_queue_enqueue(ia_css_queue_t *qhandle, uint32_t item)
 {
int error = 0;
 
@@ -143,9 +136,7 @@ int ia_css_queue_enqueue(
return 0;
 }
 
-int ia_css_queue_dequeue(
-ia_css_queue_t *qhandle,
-uint32_t *item)
+int ia_css_queue_dequeue(ia_css_queue_t *qhandle, uint32_t *item)
 {
int error = 0;
 
@@ -200,9 +191,7 @@ int ia_css_queue_dequeue(
return 0;
 }
 
-int ia_css_queue_is_full(
-ia_css_queue_t *qhandle,
-bool *is_full)
+int ia_css_queue_is_full(ia_css_queue_t *qhandle, bool *is_full)
 {
int error = 0;
 
@@ -234,9 +223,7 @@ int ia_css_queue_is_full(
return -EINVAL;
 }
 
-int ia_css_queue_get_free_space(
-ia_css_queue_t *qhandle,
-uint32_t *size)
+int ia_css_queue_get_free_space(ia_css_queue_t *qhandle, uint32_t *size)
 {
int error = 0;
 
@@ -268,9 +255,7 @@ int ia_css_queue_get_free_space(
return -EINVAL;
 }
 
-int ia_css_queue_get_used_space(
-ia_css_queue_t *qhandle,
-uint32_t *size)
+int ia_css_queue_get_used_space(ia_css_queue_t *qhandle, uint32_t *size)
 {
int error = 0;
 
@@ -302,10 +287,7 @@ int ia_css_queue_get_used_space(
return -EINVAL;
 }
 
-int ia_css_queue_peek(
-ia_css_queue_t *qhandle,
-u32 offset,
-uint32_t *element)
+int ia_css_queue_peek(ia_css_queue_t *qhandle, u32 offset, uint32_t *element)
 {
u32 num_elems = 0;
int error = 0;
@@ -354,9 +336,7 @@ int ia_css_queue_peek(
return -EINVAL;
 }
 
-int ia_css_queue_is_empty(
-ia_css_queue_t *qhandle,
-bool *is_empty)
+int ia_css_queue_is_empty(ia_css_queue_t *qhandle, bool *is_empty)
 {
int error = 0;
 
@@ -388,9 +368,7 @@ int ia_css_queue_is_empty(
return -EINVAL;
 }
 
-int ia_css_queue_get_size(
-ia_css_queue_t *qhandle,
-uint32_t *size)
+int ia_css_queue_get_size(ia_css_queue_t *qhandle, uint32_t *size)
 {
int error = 0;
 
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range'

2020-12-07 Thread Linus Walleij
On Mon, Dec 7, 2020 at 4:49 PM Greg KH  wrote:

> Sometimes we just do a "add a new driver to the real spot" that goes
> through the subsystem tree, and when that is accepted, I delete the
> driver in the staging tree.  This is most often in networking.

That's unnice, it will loose the history, it is so nice to git blame
the source.

> Or you can wait until -rc1 and do a move in your tree, or just tell me
> to do the move in my tree with an ack, and I can handle it all.
>
> Whatever is easier for you is fine with me, I'm flexible :)

I say let's move it to my subsystem before the merge window
if there is time. I'll provide ACK.

Yours,
Linus Walleij
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/3] dt-bindings: pinctrl: rt2880: add binding document

2020-12-07 Thread Linus Walleij
Hi Sergio,

thanks for driving this!

On Mon, Dec 7, 2020 at 8:21 PM Sergio Paracuellos
 wrote:

> The commit adds rt2880 compatible node in binding document.
>
> Signed-off-by: Sergio Paracuellos 
(...)
> +description:
> +  The rt2880 pinmux can only set the muxing of pin groups. muxing indiviual 
> pins
> +  is not supported. There is no pinconf support.

OK!

> +properties:
> +  compatible:
> +enum:
> +  - ralink,rt2880-pinmux
> +
> +  pinctrl-0:
> +description:
> +  A phandle to the node containing the subnodes containing default
> +  configurations.

As it is a node on the pin controller itself, this is a hog so write something
about that this is for pinctrl hogs.

> +  pinctrl-names:
> +description:
> +  A pinctrl state named "default" must be defined.
> +const: default

Is it really compulsory?

> +required:
> +  - compatible
> +  - pinctrl-names
> +  - pinctrl-0

I wonder if the hogs are really compulsory.

> +patternProperties:
> +  '^.*$':

That's liberal node naming!
What about [a-z0-9_-]+ or something?

> +if:
> +  type: object
> +  description: |
> +A pinctrl node should contain at least one subnodes representing the
> +pinctrl groups available on the machine.
> +  $ref: "pinmux-node.yaml"
> +  required:
> +- groups
> +- function
> +  additionalProperties: false
> +then:
> +  properties:
> +groups:
> +  description:
> +Name of the pin group to use for the functions.
> +  $ref: "/schemas/types.yaml#/definitions/string"
> +  enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
> + pcie, sdhci]
> +function:
> +  description:
> +The mux function to select
> +  $ref: "/schemas/types.yaml#/definitions/string"
> +  enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
> + mdio, nand1, nand2, sdhci]

Why do we have this complex if: clause?
$ref: "pinmux-node.yaml" should bring in the groups and
function properties. Then you can add some further restrictions
on top of that, right?

I would just do:

patternProperties:
  '^[a-z0-9_]+$':
type: object
  description: node for pinctrl
  $ref "pinmux-node.yaml"

  properties:
groups:
  description: groups...
  enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
pcie, sdhci]
function:
  description: function...
  enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
mdio, nand1, nand2, sdhci]

Note: the function names are fine but the group names are a bit
confusion since often a group can be used for more than one
function, and e.g.

function = "i2c";
group = "uart1";

to use the uart1 pins for an i2c is gonna look mildly confusing.

But if this is what the hardware calls it I suppose it is
fine.

Yours,
Linus Walleij
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] pinctrl: ralink: add a pinctrl driver for the rt2880 family

2020-12-07 Thread Linus Walleij
Hi Serigio,

I dug around some to try to understand the patch I think I get
it now :)

Squash this with the third patch so it becomes a
"move" of this file, preserving history. With that:
Acked-by: Linus Walleij 

I have ideas, but it is better to move the driver out
of staging and improve it in pinctrl.

Since there might be many sub-SoCs for this pin
controller, what about creating
drivers/pinctrl/ralink/* for this at the same time?

On Mon, Dec 7, 2020 at 8:21 PM Sergio Paracuellos
 wrote:
>
> These Socs have 1-3 banks of 8-32 gpios. Rather then setting the muxing of 
> each
> pin individually, these socs have mux groups that when set will effect 1-N 
> pins.
> Pin groups have a 2, 4 or 8 different muxes.
>
> Signed-off-by: Sergio Paracuellos 
(...)
> +#include 
> +#include 
> +#include 

I think in the next step we should move the contents of
rt2880_pinmux_data into this driver, then we can drop these
mach-headers and show the way for the rest of the ralink
chips to push their data down into this driver (or subdrivers)
and depopulate mach-ralink a bit.

> +   p->groups = rt2880_pinmux_data;

So this is where the driver actually gets a pointer to all
groups and functions, and these groups and functions all
come from arch/mips/ralink/mt7621.c right?

I think after this first step we should move mt7621.c
to pinctrl and become a subdriver for this pin controller
and then we can hopefully move the rest as well once
you set the pattern for how we do this.

Yours,
Linus Walleij
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 00/21] replace unique macros and ELEMENT_ID

2020-12-07 Thread Ross Schmidt
This patch set replaces many macros and the ELEMENT_ID enum with the
ieee80211_eid enum from linux/ieee80211.h. In several cases more than
one macro or constant is replaced by one constant. As suggested, each
constant replacement is separated into a distinct patch.

Changes in v2:
- Single patch divided into per-constant replacement patches

v1 can be found here:
https://lore.kernel.org/driverdev-devel/20201206034517.4276-10-ross.schm@gmail.com/

Ross Schmidt (21):
  staging: rtl8723bs: use WLAN_EID_HT_CAPABILITY
  staging: rtl8723bs: use WLAN_EID_VENDOR_SPECIFIC
  staging: rtl8723bs: use WLAN_EID_RSN
  staging: rtl8723bs: use WLAN_EID_HT_OPERATION
  staging: rtl8723bs: replace WLAN_EID_VHT_OP_MODE_NOTIFY
  staging: rtl8723bs: replace _SSID_IE_
  staging: rtl8723bs: replace _SUPPORTEDRATES_IE_
  staging: rtl8723bs: replace _DSSET_IE_
  staging: rtl8723bs: replace _TIM_IE_
  staging: rtl8723bs: replace _IBSS_PARA_IE_
  staging: rtl8723bs: replace _COUNTRY_IE_
  staging: rtl8723bs: replace _CHLGETXT_IE_
  staging: rtl8723bs: replace _ERPINFO_IE_
  staging: rtl8723bs: replace _EXT_SUPPORTEDRATES_IE_
  staging: rtl8723bs: replace _WAPI_IE_
  staging: rtl8723bs: replace _MME_IE_
  staging: rtl8723bs: replace EID_BSSCoexistence
  staging: rtl8723bs: replace EID_BSSIntolerantChlReport
  staging: rtl8723bs: replace EID_EXTCapability
  staging: rtl8723bs: remove unused macros
  staging: rtl8723bs: remove ELEMENT_ID enum

 drivers/staging/rtl8723bs/core/rtw_ap.c   |  62 
 drivers/staging/rtl8723bs/core/rtw_cmd.c  |   4 +-
 .../staging/rtl8723bs/core/rtw_ieee80211.c|  44 +++---
 drivers/staging/rtl8723bs/core/rtw_mlme.c |  26 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 146 +-
 drivers/staging/rtl8723bs/core/rtw_recv.c |   4 +-
 drivers/staging/rtl8723bs/core/rtw_security.c |   2 +-
 .../staging/rtl8723bs/core/rtw_wlan_util.c|  26 ++--
 drivers/staging/rtl8723bs/core/rtw_xmit.c |  12 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c  |  20 +--
 drivers/staging/rtl8723bs/include/ieee80211.h |   8 -
 .../staging/rtl8723bs/include/rtw_security.h  |   3 -
 drivers/staging/rtl8723bs/include/wifi.h  | 108 -
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c |   4 +-
 .../staging/rtl8723bs/os_dep/ioctl_linux.c|  14 +-
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |   2 +-
 16 files changed, 183 insertions(+), 302 deletions(-)

-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 03/21] staging: rtl8723bs: use WLAN_EID_RSN

2020-12-07 Thread Ross Schmidt
Replace unique _WPA2_IE_ID_, EID_WPA2, and _RSN_IE_2_ with kernel provided
WLAN_EID_RSN from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c  | 4 ++--
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c   | 6 +++---
 drivers/staging/rtl8723bs/core/rtw_mlme.c| 8 
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c| 4 ++--
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c   | 2 +-
 drivers/staging/rtl8723bs/include/rtw_security.h | 2 --
 drivers/staging/rtl8723bs/include/wifi.h | 1 -
 7 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index c8953b442734..7cab9889140e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1080,7 +1080,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _RSN_IE_2_,
+   WLAN_EID_RSN,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
@@ -1780,7 +1780,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _RSN_IE_2_:
+   case WLAN_EID_RSN:
 
update_bcn_rsn_ie(padapter);
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 86a5114d1241..4ab34d71b09b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -424,7 +424,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int 
*wpa_ie_len, int limit)
 
 unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
 {
-   return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit);
+   return rtw_get_ie(pie, WLAN_EID_RSN, rsn_ie_len, limit);
 }
 
 int rtw_get_wpa_cipher_suite(u8 *s)
@@ -544,7 +544,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int 
*group_cipher, int *pairwi
return _FAIL;
}
 
-   if ((*rsn_ie != _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) 
{
+   if ((*rsn_ie != WLAN_EID_RSN) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) 
{
return _FAIL;
}
 
@@ -683,7 +683,7 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 
*rsn_len, u8 *wpa_ie
*wpa_len = in_ie[cnt+1]+2;
cnt += in_ie[cnt+1]+2;  /* get next */
} else {
-   if (authmode == _WPA2_IE_ID_) {
+   if (authmode == WLAN_EID_RSN) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, 
("\n get_rsn_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));
 
if (rsn_ie) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 50129a3e67e0..1d4e565a314b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -736,7 +736,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct 
wlan_network *pnetwor
bselected = false;
 
if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
-   p = rtw_get_ie(pnetwork->network.IEs + 
_BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - 
_BEACON_IE_OFFSET_));
+   p = rtw_get_ie(pnetwork->network.IEs + 
_BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - 
_BEACON_IE_OFFSET_));
if (p && ie_len > 0)
bselected = true;
else
@@ -2361,13 +2361,13 @@ sint rtw_restruct_sec_ie(struct adapter *adapter, u8 
*in_ie, u8 *out_ie, uint in
if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == 
Ndis802_11AuthModeWPAPSK))
authmode = WLAN_EID_VENDOR_SPECIFIC;
if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == 
Ndis802_11AuthModeWPA2PSK))
-   authmode = _WPA2_IE_ID_;
+   authmode = WLAN_EID_RSN;
 
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
memcpy(out_ie+ielength, psecuritypriv->wps_ie, 
psecuritypriv->wps_ie_len);
 
ielength += psecuritypriv->wps_ie_len;
-   } else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == 
_WPA2_IE_ID_)) {
+   } else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == 
WLAN_EID_RSN)) {
/* copy RSN or SSN */
memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], 
psecuritypriv->supplicant_ie[1]+2);
/* debug for CONFIG_IEEE80211W
@@ -2386,7 +2386,7 @@ sint rtw_restruct_sec_ie(struct adapter *adapter, u8

[PATCH v2 01/21] staging: rtl8723bs: use WLAN_EID_HT_CAPABILITY

2020-12-07 Thread Ross Schmidt
Replace unique WLAN_EID_HT_CAP, _HT_CAPABILITY_IE_, and EID_HTCapability
with kernel provided WLAN_EID_HT_CAPABILITY from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c|  8 
 drivers/staging/rtl8723bs/core/rtw_cmd.c   |  2 +-
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c |  4 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme.c  |  4 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  | 14 +++---
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c |  2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h  |  1 -
 drivers/staging/rtl8723bs/include/wifi.h   |  1 -
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c |  6 +++---
 9 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 04d5852d0d3e..87605d425a31 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1172,7 +1172,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/* parsing HT_CAP_IE */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _HT_CAPABILITY_IE_,
+   WLAN_EID_HT_CAPABILITY,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
@@ -1774,7 +1774,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _HT_CAPABILITY_IE_:
+   case WLAN_EID_HT_CAPABILITY:
 
update_bcn_htcap_ie(padapter);
 
@@ -2052,7 +2052,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
}
 
if (rtw_ht_operation_update(padapter) > 0) {
-   update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, false);
+   update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
}
 
@@ -2116,7 +2116,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, 
struct sta_info *psta)
}
 
if (rtw_ht_operation_update(padapter) > 0) {
-   update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, false);
+   update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
}
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c 
b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index f6160f1cca43..1d0a7690acde 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -842,7 +842,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct 
wlan_network *pnetwork)
}
 
phtpriv->ht_option = false;
-   ptmp = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, 
&tmp_len, pnetwork->network.IELength-12);
+   ptmp = rtw_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY, 
&tmp_len, pnetwork->network.IELength-12);
if (pregistrypriv->ht_enable && ptmp && tmp_len > 0) {
/*  Added by Albert 2010/06/23 */
/*  For the WEP mode, we will use the bg mode to do the 
connection to avoid some IOT issue. */
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e80b957f947f..23ba4160ab21 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1056,7 +1056,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
elems->timeout_int = pos;
elems->timeout_int_len = elen;
break;
-   case WLAN_EID_HT_CAP:
+   case WLAN_EID_HT_CAPABILITY:
elems->ht_capabilities = pos;
elems->ht_capabilities_len = elen;
break;
@@ -1209,7 +1209,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
 
/* get bwmode and ch_offset */
/* parsing HT_CAP_IE */
-   p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, 
_HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
+   p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, 
WLAN_EID_HT_CAPABILITY, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
if (p && len > 0) {
pht_cap = (struct ieee80211_ht_cap *)(p + 2);
pnetwork->BcnInfo.ht_cap_info = 
le16_to_cpu(pht_cap->cap_info);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b1737fbeb33f..f32cf36ea949 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2718,7 +2718,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter 
*padapter, u8 *in_ie, u8 *out_
else
ht_capie.ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSIT

[PATCH v2 02/21] staging: rtl8723bs: use WLAN_EID_VENDOR_SPECIFIC

2020-12-07 Thread Ross Schmidt
Replace unique WLAN_EID_GENERIC, _WPA_IE_ID_, _SSN_IE_1_, and
_VENDOR_SPECIFIC_IE_ macros with kernel provided WLAN_EID_VENDOR_SPECIFIC
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c   |  6 +++---
 .../staging/rtl8723bs/core/rtw_ieee80211.c| 12 +--
 drivers/staging/rtl8723bs/core/rtw_mlme.c |  6 +++---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 20 +--
 .../staging/rtl8723bs/core/rtw_wlan_util.c|  6 +++---
 drivers/staging/rtl8723bs/include/ieee80211.h |  1 -
 .../staging/rtl8723bs/include/rtw_security.h  |  1 -
 drivers/staging/rtl8723bs/include/wifi.h  |  2 --
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  4 ++--
 .../staging/rtl8723bs/os_dep/ioctl_linux.c|  8 
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |  2 +-
 11 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 87605d425a31..c8953b442734 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1110,7 +1110,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
p = rtw_get_ie(
p,
-   _SSN_IE_1_,
+   WLAN_EID_VENDOR_SPECIFIC,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len 
+ 2))
);
@@ -1146,7 +1146,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
p = rtw_get_ie(
p,
-   _VENDOR_SPECIFIC_IE_,
+   WLAN_EID_VENDOR_SPECIFIC,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_ - 
(ie_len + 2))
);
@@ -1792,7 +1792,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _VENDOR_SPECIFIC_IE_:
+   case WLAN_EID_VENDOR_SPECIFIC:
 
update_bcn_vendor_spec_ie(padapter, oui);
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 23ba4160ab21..86a5114d1241 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -383,7 +383,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int 
*wpa_ie_len, int limit)
__le16 le_tmp;
 
while (1) {
-   pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
+   pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &len, 
limit_new);
 
if (pbuf) {
/* check if oui matches... */
@@ -471,7 +471,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int 
*group_cipher, int *pairwis
return _FAIL;
}
 
-   if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
+   if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie+1) != 
(u8)(wpa_ie_len - 2)) ||
   (memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) {
return _FAIL;
}
@@ -667,7 +667,7 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 
*rsn_len, u8 *wpa_ie
while (cnt < in_len) {
authmode = in_ie[cnt];
 
-   if ((authmode == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt+2], 
&wpa_oui[0], 4))) {
+   if ((authmode == WLAN_EID_VENDOR_SPECIFIC) && 
(!memcmp(&in_ie[cnt+2], &wpa_oui[0], 4))) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, 
("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, 
in_ie[cnt+1]+2));
 
if (wpa_ie) {
@@ -715,7 +715,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
 
eid = ie_ptr[0];
 
-   if ((eid == _WPA_IE_ID_) && (!memcmp(&ie_ptr[2], wps_oui, 4))) {
+   if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&ie_ptr[2], wps_oui, 
4))) {
/* DBG_8192C("==> found WPS_IE.\n"); */
*wps_ielen = ie_ptr[1]+2;
match = true;
@@ -749,7 +749,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint 
*wps_ielen)
while (cnt < in_len) {
eid = in_ie[cnt];
 
-   if ((eid == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt+2], wps_oui, 
4))) {
+   if ((eid == WLAN_EID_VENDOR_SPECIFIC) && 
(!memcmp(&in_ie[cnt+2], wps_oui, 4))) {
wpsie_ptr = &in_ie[cnt];
 
if (wps_ie)
@@ -788,7 +788,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 
target_attr_id, u8 *buf_att
if (len_attr)
*len_attr = 0;
 
-   if ((wps_ie[0] != _V

[PATCH v2 05/21] staging: rtl8723bs: replace WLAN_EID_VHT_OP_MODE_NOTIFY

2020-12-07 Thread Ross Schmidt
Replace unique WLAN_EID_VHT_OP_MODE_NOFITY macro with kernel provided
WLAN_EID_OPMODE_NOTIF from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index ff4f493e8dcd..182cc8c0b7d3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1072,7 +1072,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
elems->vht_operation = pos;
elems->vht_operation_len = elen;
break;
-   case WLAN_EID_VHT_OP_MODE_NOTIFY:
+   case WLAN_EID_OPMODE_NOTIF:
elems->vht_op_mode_notify = pos;
elems->vht_op_mode_notify_len = elen;
break;
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h 
b/drivers/staging/rtl8723bs/include/ieee80211.h
index 880d3f0a32fa..20c53c290aa1 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -352,7 +352,6 @@ struct ieee80211_snap_hdr {
 #define WLAN_EID_20_40_BSS_COEXISTENCE 72
 #define WLAN_EID_20_40_BSS_INTOLERANT 73
 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
-#define WLAN_EID_VHT_OP_MODE_NOTIFY 199
 
 #define IEEE80211_MGMT_HDR_LEN 24
 #define IEEE80211_DATA_HDR3_LEN 24
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 09/21] staging: rtl8723bs: replace _TIM_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _TIM_IE_ macro with kernel provided WLAN_EID_DS_PARAMS
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c   | 10 +-
 drivers/staging/rtl8723bs/core/rtw_cmd.c  |  2 +-
 drivers/staging/rtl8723bs/core/rtw_recv.c |  4 ++--
 drivers/staging/rtl8723bs/core/rtw_xmit.c |  8 
 drivers/staging/rtl8723bs/include/wifi.h  |  1 -
 5 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 1514975f23bc..139350288d1b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -76,7 +76,7 @@ static void update_BCNTIM(struct adapter *padapter)
 
p = rtw_get_ie(
pie + _FIXED_IE_LENGTH_,
-   _TIM_IE_,
+   WLAN_EID_TIM,
&tim_ielen,
pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_
);
@@ -133,7 +133,7 @@ static void update_BCNTIM(struct adapter *padapter)
memcpy(pbackup_remainder_ie, premainder_ie, 
remainder_ielen);
}
 
-   *dst_ie++ = _TIM_IE_;
+   *dst_ie++ = WLAN_EID_TIM;
 
if ((pstapriv->tim_bitmap & 0xff00) && (pstapriv->tim_bitmap & 
0x00fe))
tim_ielen = 5;
@@ -301,7 +301,7 @@ void expire_timeout_chk(struct adapter *padapter)
 
/* to update bcn with tim_bitmap for 
this station */
pstapriv->tim_bitmap |= BIT(psta->aid);
-   update_beacon(padapter, _TIM_IE_, NULL, 
true);
+   update_beacon(padapter, WLAN_EID_TIM, 
NULL, true);
 
if (!pmlmeext->active_keep_alive_check)
continue;
@@ -922,7 +922,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
);
 
if (pmlmeext->bstart_bss) {
-   update_beacon(padapter, _TIM_IE_, NULL, true);
+   update_beacon(padapter, WLAN_EID_TIM, NULL, true);
 
 #ifndef CONFIG_INTERRUPT_BASED_TXBCN /* other case will  tx beacon when bcn 
interrupt coming in. */
/* issue beacon frame */
@@ -1762,7 +1762,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _TIM_IE_:
+   case WLAN_EID_TIM:
 
update_BCNTIM(padapter);
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c 
b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 1d0a7690acde..3fe79169a811 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1703,7 +1703,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
pstapriv->sta_dz_bitmap &= ~BIT(0);
 
if (update_tim)
-   update_beacon(padapter, _TIM_IE_, NULL, true);
+   update_beacon(padapter, WLAN_EID_TIM, NULL, 
true);
} else {/* re check again */
rtw_chk_hi_queue_cmd(padapter);
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c 
b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 2bb501f2113c..3c9dbd7443d9 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1158,7 +1158,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, 
union recv_frame *precv_
 
/* update BCN for TIM IE */
/* update_BCNTIM(padapter); */
-   update_beacon(padapter, _TIM_IE_, NULL, 
true);
+   update_beacon(padapter, WLAN_EID_TIM, 
NULL, true);
}
 
/* spin_unlock_bh(&psta->sleep_q.lock); */
@@ -1184,7 +1184,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, 
union recv_frame *precv_
 
/* update BCN for TIM IE */
/* update_BCNTIM(padapter); */
-   update_beacon(padapter, _TIM_IE_, NULL, 
true);
+   update_beacon(padapter, WLAN_EID_TIM, 
NULL, true);
}
}
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c 
b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index f9ef7dc84e55..1d62ce501e80 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -2251,7 +2251,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter 
*padapter, struct xmit_fr
pstapriv->sta_dz_bitmap |= BIT(0);
 
  

[PATCH v2 06/21] staging: rtl8723bs: replace _SSID_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _SSID_IE_ macro with kernel provided WLAN_EID_SSID from
linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c   |  4 ++--
 .../staging/rtl8723bs/core/rtw_ieee80211.c|  2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 20 +--
 .../staging/rtl8723bs/core/rtw_wlan_util.c|  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c  |  6 +++---
 drivers/staging/rtl8723bs/include/wifi.h  |  1 -
 6 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index e44c01de3b10..aaa7edbebe2c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -100,7 +100,7 @@ static void update_BCNTIM(struct adapter *padapter)
/* get ssid_ie len */
p = rtw_get_ie(
pie + _BEACON_IE_OFFSET_,
-   _SSID_IE_,
+   WLAN_EID_SSID,
&tmp_len,
(pnetwork_mlmeext->IELength - 
_BEACON_IE_OFFSET_)
);
@@ -1004,7 +1004,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/* SSID */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _SSID_IE_,
+   WLAN_EID_SSID,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 182cc8c0b7d3..daaa826add35 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -326,7 +326,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
ie += 2;
 
/* SSID */
-   ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, 
pdev_network->Ssid.Ssid, &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_SSID, pdev_network->Ssid.SsidLength, 
pdev_network->Ssid.Ssid, &sz);
 
/* supported rates */
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index b829264b8aff..983fcaae6eca 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -728,7 +728,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union 
recv_frame *precv_frame)
 
 #endif /* CONFIG_AUTO_AP_MODE */
 
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, 
_SSID_IE_, (int *)&ielen,
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, 
WLAN_EID_SSID, (int *)&ielen,
len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
 
 
@@ -1251,7 +1251,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union 
recv_frame *precv_frame)
 
/*  now we should check all the fields... */
/*  checking SSID */
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len,
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, WLAN_EID_SSID, 
&ie_len,
pkt_len - WLAN_HDR_A3_LEN - ie_offset);
 
if (!p || ie_len == 0) {
@@ -2536,7 +2536,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pattrib->pktlen += 2;
 
/*  SSID */
-   pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, 
cur_network->Ssid.Ssid, &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 
cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen);
 
/*  supported rates... */
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
@@ -2692,7 +2692,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
u8 buf[MAX_IE_SZ];
u8 *ies = 
pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr);
 
-   ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, _SSID_IE_, 
&ssid_ielen,
+   ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, 
WLAN_EID_SSID, &ssid_ielen,
(pframe-ies)-_FIXED_IE_LENGTH_);
 
ssid_ielen_diff = cur_network->Ssid.SsidLength - 
ssid_ielen;
@@ -2740,7 +2740,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
/* below for ad-hoc mode */
 
/*  SSID */
-   pframe = rtw_set_ie(pframe, _SSID_IE_, 
cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 
cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen);
 
/*  supported rates... */
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
@@ -2870,9 +287

[PATCH v2 04/21] staging: rtl8723bs: use WLAN_EID_HT_OPERATION

2020-12-07 Thread Ross Schmidt
Replace unique _HT_EXTRA_INFO_IE_ and _HT_ADD_INFO_IE_ macros with kernel
provided WLAN_EID_HT_OPERATION from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c| 10 +-
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c |  2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme.c  |  8 
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  |  8 
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c |  6 +++---
 drivers/staging/rtl8723bs/include/wifi.h   |  2 --
 6 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 7cab9889140e..e44c01de3b10 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -855,7 +855,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
/* set channel, bwmode */
p = rtw_get_ie(
(pnetwork->IEs + sizeof(struct ndis_802_11_fix_ie)),
-   _HT_ADD_INFO_IE_,
+   WLAN_EID_HT_OPERATION,
&ie_len,
(pnetwork->IELength - sizeof(struct ndis_802_11_fix_ie))
);
@@ -1235,7 +1235,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/* parsing HT_INFO_IE */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _HT_ADD_INFO_IE_,
+   WLAN_EID_HT_OPERATION,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
@@ -1786,7 +1786,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _HT_ADD_INFO_IE_:
+   case WLAN_EID_HT_OPERATION:
 
update_bcn_htinfo_ie(padapter);
 
@@ -2053,7 +2053,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
 
if (rtw_ht_operation_update(padapter) > 0) {
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
-   update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
+   update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
 
/* update associated stations cap. */
@@ -2117,7 +2117,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, 
struct sta_info *psta)
 
if (rtw_ht_operation_update(padapter) > 0) {
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
-   update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
+   update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
 
/* update associated stations cap. */
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 4ab34d71b09b..ff4f493e8dcd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1217,7 +1217,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
pnetwork->BcnInfo.ht_cap_info = 0;
}
/* parsing HT_INFO_IE */
-   p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, 
_HT_ADD_INFO_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
+   p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, 
WLAN_EID_HT_OPERATION, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
if (p && len > 0) {
pht_info = (struct HT_info_element *)(p + 2);
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 1d4e565a314b..d05338015744 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2616,7 +2616,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter 
*padapter, u8 *in_ie, u8 *out_
/* TDLS: TODO 40? */
operation_bw = CHANNEL_WIDTH_40;
} else {
-   p = rtw_get_ie(in_ie, _HT_ADD_INFO_IE_, &ielen, in_len);
+   p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len);
if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) {
struct HT_info_element *pht_info = (struct 
HT_info_element *)(p+2);
 
@@ -2724,10 +2724,10 @@ unsigned int rtw_restructure_ht_ie(struct adapter 
*padapter, u8 *in_ie, u8 *out_
phtpriv->ht_option = true;
 
if (in_ie) {
-   p = rtw_get_ie(in_ie, _HT_ADD_INFO_IE_, &ielen, in_len);
+   p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len);
if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) {
out_len = *pout_len;
-   pframe = rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, 
ielen, p+2, pout_len);
+   pframe = rtw_set_ie(out_ie+out_len, 
WLAN_EID_HT_OPERATION, ielen, p+2, pout_le

[PATCH v2 11/21] staging: rtl8723bs: replace _COUNTRY_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _COUNTRY_IE_ macro with kernel provided WLAN_EID_COUNTRY
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 drivers/staging/rtl8723bs/include/wifi.h  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 546e4a31142b..319a99833a49 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -4788,7 +4788,7 @@ static void process_80211d(struct adapter *padapter, 
struct wlan_bssid_ex *bssid
u8 noc; /*  number of channel */
u8 j, k;
 
-   ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _COUNTRY_IE_, 
&len, bssid->IELength - _FIXED_IE_LENGTH_);
+   ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, 
WLAN_EID_COUNTRY, &len, bssid->IELength - _FIXED_IE_LENGTH_);
if (!ie)
return;
if (len < 6)
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index 3adeb3c23a3c..6df50468200e 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -387,7 +387,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 
 #define _FIXED_IE_LENGTH_  _BEACON_IE_OFFSET_
 
-#define _COUNTRY_IE_   7
 #define _CHLGETXT_IE_  16
 #define _SUPPORTED_CH_IE_  36
 #define _CH_SWTICH_ANNOUNCE_   37  /* Secondary Channel Offset */
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 13/21] staging: rtl8723bs: replace _ERPINFO_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _ERPINFO_IE_ macro with kernel provided WLAN_EID_ERP_INFO
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c| 12 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  |  6 +++---
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c |  2 +-
 drivers/staging/rtl8723bs/core/rtw_xmit.c  |  2 +-
 drivers/staging/rtl8723bs/include/wifi.h   |  1 -
 5 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 139350288d1b..5e93a85cb6ce 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1059,7 +1059,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/* parsing ERP_IE */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _ERPINFO_IE_,
+   WLAN_EID_ERP_INFO,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
@@ -1585,7 +1585,7 @@ static void update_bcn_erpinfo_ie(struct adapter 
*padapter)
/* parsing ERP_IE */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _ERPINFO_IE_,
+   WLAN_EID_ERP_INFO,
&len,
(pnetwork->IELength - _BEACON_IE_OFFSET_)
);
@@ -1768,7 +1768,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 
*oui, u8 tx)
 
break;
 
-   case _ERPINFO_IE_:
+   case WLAN_EID_ERP_INFO:
 
update_bcn_erpinfo_ie(padapter);
 
@@ -1964,7 +1964,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
 
if (pmlmepriv->num_sta_non_erp == 1) {
beacon_updated = true;
-   update_beacon(padapter, _ERPINFO_IE_, NULL, 
true);
+   update_beacon(padapter, WLAN_EID_ERP_INFO, 
NULL, true);
}
}
} else {
@@ -1975,7 +1975,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
 
if (pmlmepriv->num_sta_non_erp == 0) {
beacon_updated = true;
-   update_beacon(padapter, _ERPINFO_IE_, NULL, 
true);
+   update_beacon(padapter, WLAN_EID_ERP_INFO, 
NULL, true);
}
}
}
@@ -2086,7 +2086,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, 
struct sta_info *psta)
pmlmepriv->num_sta_non_erp--;
if (pmlmepriv->num_sta_non_erp == 0) {
beacon_updated = true;
-   update_beacon(padapter, _ERPINFO_IE_, NULL, true);
+   update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, true);
}
}
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 93380493e8dc..5d56fbf0c1fe 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1705,7 +1705,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, union 
recv_frame *precv_frame)
HT_info_handler(padapter, pIE);
break;
 
-   case _ERPINFO_IE_:
+   case WLAN_EID_ERP_INFO:
ERP_IE_handler(padapter, pIE);
break;
 
@@ -2555,7 +2555,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned 
char *)(&ATIMWindow), &pattrib->pktlen);
 
/* ERP IE */
-   pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, 
&pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, 
&pattrib->pktlen);
}
 
 
@@ -2758,7 +2758,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, 
(unsigned char *)(&ATIMWindow), &pattrib->pktlen);
 
/* ERP IE */
-   pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, 
&pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, 
&erpinfo, &pattrib->pktlen);
}
 
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index ff5125b33749..e8e91e24c04d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1479,7 +1479,7 @@ void update_beacon_info(struct adapter *padapter, u8 
*pframe, uint pkt_len, stru
bwmode_update_check(padapter, pIE);
break;
 
-   case _ERPINFO_IE_:
+ 

[PATCH v2 16/21] staging: rtl8723bs: replace _MME_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _MME_IE_ macro with kernel provided WLAN_EID_MMIE from
linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 2 +-
 drivers/staging/rtl8723bs/include/wifi.h  | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c 
b/drivers/staging/rtl8723bs/core/rtw_security.c
index 33f5d3c5ac36..a83d8f7f611c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -1819,7 +1819,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 
*precvframe)
/* save the frame body + MME */
memcpy(BIP_AAD+BIP_AAD_SIZE, pframe+WLAN_HDR_A3_LEN, 
pattrib->pkt_len-WLAN_HDR_A3_LEN);
/* find MME IE pointer */
-   p = rtw_get_ie(BIP_AAD+BIP_AAD_SIZE, _MME_IE_, &len, 
pattrib->pkt_len-WLAN_HDR_A3_LEN);
+   p = rtw_get_ie(BIP_AAD+BIP_AAD_SIZE, WLAN_EID_MMIE, &len, 
pattrib->pkt_len-WLAN_HDR_A3_LEN);
/* Baron */
if (p) {
u16 keyid = 0;
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c 
b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 187a2aa77a55..41632fa0b3c8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -1292,7 +1292,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, 
_pkt *pkt, struct xmit
pmlmeext->mgnt_80211w_IPN++;
 
/* add MME IE with MIC all zero, MME string doesn't include 
element id and length */
-   pframe = rtw_set_ie(pframe, _MME_IE_, 16,
+   pframe = rtw_set_ie(pframe, WLAN_EID_MMIE, 16,
MME, &pattrib->pktlen);
pattrib->last_txcmdsz = pattrib->pktlen;
/*  total frame length - header length */
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index 29621fce6a83..82dfdafb38fc 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -395,7 +395,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 #define _SRC_IE_   59
 
 #define _RIC_Descriptor_IE_75
-#define _MME_IE_   76 /* 802.11w 
Management MIC element */
 #define _LINK_ID_IE_   101
 #define _CH_SWITCH_TIMING_ 104
 #define _PTI_BUFFER_STATUS_106
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 17/21] staging: rtl8723bs: replace EID_BSSCoexistence

2020-12-07 Thread Ross Schmidt
Replace unique EID_BSSCoexistence constant with kernel provided
WLAN_EID_BSS_COEX_2040 from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index e9b14fc8b10f..b6e255f6cdc5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -4096,7 +4096,7 @@ static void issue_action_BSSCoexistPacket(struct adapter 
*padapter)
 
iedata |= BIT(2);/* 20 MHz BSS Width Request */
 
-   pframe = rtw_set_ie(pframe, EID_BSSCoexistence,  1, &iedata, 
&(pattrib->pktlen));
+   pframe = rtw_set_ie(pframe, WLAN_EID_BSS_COEX_2040,  1, 
&iedata, &(pattrib->pktlen));
 
}
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 08/21] staging: rtl8723bs: replace _DSSET_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _DSSET_IE_ macro with kernel provdied WLAN_EID_DS_PARAMS
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c|  2 +-
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c |  2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  | 10 +-
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c |  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c   |  2 +-
 drivers/staging/rtl8723bs/include/wifi.h   |  1 -
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 99a34c059f6d..1514975f23bc 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1019,7 +1019,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
pbss_network->Configuration.Length = 0;
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _DSSET_IE_, &ie_len,
+   WLAN_EID_DS_PARAMS, &ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
if (p && ie_len > 0)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e0896e128dda..58e29314c8f8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -350,7 +350,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
}
 
/* DS parameter set */
-   ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 
*)&(pdev_network->Configuration.DSConfig), &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, (u8 
*)&(pdev_network->Configuration.DSConfig), &sz);
 
/* IBSS Parameter Set */
 
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index b9e612e1e162..1f6c1e441744 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -2543,7 +2543,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : 
rate_len), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
-   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
 
/* if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */
{
@@ -2747,7 +2747,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 
8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
-   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned 
char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
 
if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
u8 erpinfo = 0;
@@ -2884,7 +2884,7 @@ static int _issue_probereq(struct adapter *padapter,
}
 
if (ch)
-   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, &ch, 
&pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, &ch, 
&pattrib->pktlen);
 
if (append_wps) {
/* add wps_ie for wps2.0 */
@@ -4509,7 +4509,7 @@ u8 collect_bss_info(struct adapter *padapter, union 
recv_frame *precv_frame, str
return _FAIL;
 
/*  Checking for DSConfig */
-   p = rtw_get_ie(bssid->IEs + ie_offset, _DSSET_IE_, &len, 
bssid->IELength - ie_offset);
+   p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_DS_PARAMS, &len, 
bssid->IELength - ie_offset);
 
bssid->Configuration.DSConfig = 0;
bssid->Configuration.Length = 0;
@@ -5982,7 +5982,7 @@ static int rtw_auto_ap_start_beacon(struct adapter 
*adapter)
} else {
oper_channel = adapter_to_dvobj(adapter)->oper_channel;
}
-   ie = rtw_set_ie(ie, _DSSET_IE_, 1, &oper_channel, &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, &oper_channel, &sz);
 
/* ext supported rates */
if (rateLen > 8) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 5ad2ed6af593..ff5125b33749 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1321,7 +1321,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 
*pframe, u32 packet_len)
}
 
/* Checking for channel */
-   p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, 
bssid->IELength - _FIXED_IE_LENGTH_)

[PATCH v2 10/21] staging: rtl8723bs: replace _IBSS_PARA_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _IBSS_PARA_IE_ macro with kernel provided
WLAN_EID_IBSS_PARAMS from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  | 4 ++--
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c   | 2 +-
 drivers/staging/rtl8723bs/include/wifi.h   | 1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 58e29314c8f8..b899f511ff9f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -354,7 +354,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
 
/* IBSS Parameter Set */
 
-   ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 
*)&(pdev_network->Configuration.ATIMWindow), &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2, (u8 
*)&(pdev_network->Configuration.ATIMWindow), &sz);
 
if (rateLen > 8) {
ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 1f6c1e441744..546e4a31142b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -2552,7 +2552,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
/*  IBSS Parameter Set... */
/* ATIMWindow = cur->Configuration.ATIMWindow; */
ATIMWindow = 0;
-   pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char 
*)(&ATIMWindow), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned 
char *)(&ATIMWindow), &pattrib->pktlen);
 
/* ERP IE */
pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, 
&pattrib->pktlen);
@@ -2755,7 +2755,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
/*  IBSS Parameter Set... */
/* ATIMWindow = cur->Configuration.ATIMWindow; */
ATIMWindow = 0;
-   pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, 
(unsigned char *)(&ATIMWindow), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, 
(unsigned char *)(&ATIMWindow), &pattrib->pktlen);
 
/* ERP IE */
pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, 
&pattrib->pktlen);
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c 
b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index ac6677212086..f6073ecef2e2 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -189,7 +189,7 @@ static void ConstructBeacon(struct adapter *padapter, u8 
*pframe, u32 *pLength)
/*  IBSS Parameter Set... */
/* ATIMWindow = cur->Configuration.ATIMWindow; */
ATIMWindow = 0;
-   pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char 
*)(&ATIMWindow), &pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned 
char *)(&ATIMWindow), &pktlen);
}
 
 
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index dc11ba28d469..3adeb3c23a3c 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -387,7 +387,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 
 #define _FIXED_IE_LENGTH_  _BEACON_IE_OFFSET_
 
-#define _IBSS_PARA_IE_ 6
 #define _COUNTRY_IE_   7
 #define _CHLGETXT_IE_  16
 #define _SUPPORTED_CH_IE_  36
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 15/21] staging: rtl8723bs: replace _WAPI_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _WAPI_IE_ macro with kernel provided
WLAN_EID_BSS_AC_ACCESS_DELAY from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 ++--
 drivers/staging/rtl8723bs/include/wifi.h   | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 28d5892d8bda..be4cffce4f5d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -623,8 +623,8 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, 
u16 *wapi_len)
while (cnt < in_len) {
authmode = in_ie[cnt];
 
-   /* if (authmode == _WAPI_IE_) */
-   if (authmode == _WAPI_IE_ && (!memcmp(&in_ie[cnt+6], wapi_oui1, 
4) ||
+   /* if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY) */
+   if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY && 
(!memcmp(&in_ie[cnt+6], wapi_oui1, 4) ||
!memcmp(&in_ie[cnt+6], wapi_oui2, 4))) {
if (wapi_ie) {
memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt+1]+2);
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index e221d4574f32..29621fce6a83 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -393,7 +393,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 #define _FTIE_ 55
 #define _TIMEOUT_ITVL_IE_  56
 #define _SRC_IE_   59
-#define _WAPI_IE_  68
 
 #define _RIC_Descriptor_IE_75
 #define _MME_IE_   76 /* 802.11w 
Management MIC element */
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 21/21] staging: rtl8723bs: remove ELEMENT_ID enum

2020-12-07 Thread Ross Schmidt
The ELEMENT_ID enum is no longer used, remove it.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/include/wifi.h | 76 
 1 file changed, 76 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index 7f482a45705b..fe984fcb66a9 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -387,82 +387,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 
 #define _FIXED_IE_LENGTH_  _BEACON_IE_OFFSET_
 
-enum ELEMENT_ID {
-   EID_SsId= 0, /* service set 
identifier (0:32) */
-   EID_SupRates= 1, /* supported rates (1:8) */
-   EID_FHParms = 2, /* FH parameter set (5) */
-   EID_DSParms = 3, /* DS parameter set (1) */
-   EID_CFParms = 4, /* CF parameter set (6) */
-   EID_Tim = 5, /* Traffic 
Information Map (4:254) */
-   EID_IbssParms   = 6, /* IBSS parameter set (2) 
*/
-   EID_Country = 7, /* */
-
-   /*  Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */
-   EID_QBSSLoad= 11,
-   EID_EDCAParms   = 12,
-   EID_TSpec   = 13,
-   EID_TClass  = 14,
-   EID_Schedule= 15,
-   /*  */
-
-   EID_Ctext   = 16, /* challenge 
text*/
-   EID_POWER_CONSTRAINT= 32, /* Power Constraint*/
-
-   /* vivi for WIFITest, 802.11h AP, 20100427 */
-   /*  2010/12/26 MH The definition we can declare always!! */
-   EID_PowerCap= 33,
-   EID_SupportedChannels   = 36,
-   EID_ChlSwitchAnnounce   = 37,
-
-   EID_MeasureRequest  = 38, /*  Measurement Request */
-   EID_MeasureReport   = 39, /*  Measurement Report */
-
-   EID_ERPInfo = 42,
-
-   /*  Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */
-   EID_TSDelay = 43,
-   EID_TCLASProc   = 44,
-   EID_HTCapability= 45,
-   EID_QoSCap  = 46,
-   /*  */
-
-   EID_WPA2= 48,
-   EID_ExtSupRates = 50,
-
-   EID_FTIE= 55, /*  Defined in 
802.11r */
-   EID_Timeout = 56, /*  Defined in 802.11r */
-
-   EID_SupRegulatory   = 59, /*  Supported Requlatory 
Classes 802.11y */
-   EID_HTInfo  = 61,
-   EID_SecondaryChnlOffset = 62,
-
-   EID_BSSCoexistence  = 72, /*  20/40 BSS Coexistence 
*/
-   EID_BSSIntolerantChlReport  = 73,
-   EID_OBSS= 74, /*  Overlapping 
BSS Scan Parameters */
-
-   EID_LinkIdentifier  = 101, /*  Defined in 802.11z */
-   EID_WakeupSchedule  = 102, /*  Defined in 802.11z */
-   EID_ChnlSwitchTimeing   = 104, /*  Defined in 802.11z */
-   EID_PTIControl  = 105, /*  Defined in 802.11z */
-   EID_PUBufferStatus  = 106, /*  Defined in 802.11z */
-
-   EID_EXTCapability   = 127, /*  Extended 
Capabilities */
-   /*  From S19:Aironet IE and S21:AP IP address IE in CCX v1.13, p16 and 
p18. */
-   EID_Aironet = 133, /*  0x85: 
Aironet Element for Cisco CCX */
-   EID_CiscoIP = 149, /*  0x95: IP 
Address IE for Cisco CCX */
-
-   EID_CellPwr = 150, /*  0x96: Cell 
Power Limit IE. Ref. 0x96. */
-
-   EID_CCKM= 156,
-
-   EID_Vendor  = 221, /*  0xDD: Vendor 
Specific */
-
-   EID_WAPI= 68,
-   EID_VHTCapability   = 191, /*  Based on 802.11ac 
D2.0 */
-   EID_VHTOperation= 192, /*  Based on 802.11ac 
D2.0 */
-   EID_OpModeNotification  = 199, /*  Based on 802.11ac D3.0 */
-};
-
 /* ---
Below is the fixed elements...
 -*/
-- 
2.25.1

___
devel mailing list
d

[PATCH v2 07/21] staging: rtl8723bs: replace _SUPPORTEDRATES_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _SUPPORTEDRATES_IE_ macro with kernel provided
WLAN_EID_SUPP_RATES from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c   |  4 ++--
 .../staging/rtl8723bs/core/rtw_ieee80211.c|  4 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 24 +--
 .../staging/rtl8723bs/core/rtw_wlan_util.c|  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c  |  6 ++---
 drivers/staging/rtl8723bs/include/wifi.h  |  1 -
 6 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index aaa7edbebe2c..99a34c059f6d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -110,7 +110,7 @@ static void update_BCNTIM(struct adapter *padapter)
/*  get supported rates len */
p = rtw_get_ie(
pie + _BEACON_IE_OFFSET_,
-   _SUPPORTEDRATES_IE_, &tmp_len,
+   WLAN_EID_SUPP_RATES, &tmp_len,
(pnetwork_mlmeext->IELength - 
_BEACON_IE_OFFSET_)
);
if (p)
@@ -1031,7 +1031,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/*  get supported rates */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _SUPPORTEDRATES_IE_,
+   WLAN_EID_SUPP_RATES,
&ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)
);
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index daaa826add35..e0896e128dda 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -343,10 +343,10 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
 
if (rateLen > 8) {
-   ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, 
pdev_network->SupportedRates, &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, 
pdev_network->SupportedRates, &sz);
/* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz); */
} else {
-   ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, 
pdev_network->SupportedRates, &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, 
pdev_network->SupportedRates, &sz);
}
 
/* DS parameter set */
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 983fcaae6eca..b9e612e1e162 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1271,7 +1271,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union 
recv_frame *precv_frame)
goto OnAssocReqFail;
 
/*  check if the supported rate is ok */
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, 
_SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, 
WLAN_EID_SUPP_RATES, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
if (p == NULL) {
DBG_871X("Rx a sta assoc-req which supported rate is empty!\n");
/*  use our own rate set as statoin used */
@@ -2540,7 +2540,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
 
/*  supported rates... */
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
-   pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : 
rate_len), cur_network->SupportedRates, &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : 
rate_len), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
@@ -2744,7 +2744,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
 
/*  supported rates... */
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
-   pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 
8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 
8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
@@ -2877,10 +2877,10 @@ static int _issue_probereq(struct adapter *padapter,
get_rate_set(padapter, bssrate, &bssrate_len);
 
if (bss

[PATCH v2 18/21] staging: rtl8723bs: replace EID_BSSIntolerantChlReport

2020-12-07 Thread Ross Schmidt
Replace unique EID_BSSIntolerantChlReport constant with kernel provided
WLAN_EID_BSS_INTOLERANT_CHL_REPORT from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index b6e255f6cdc5..9d172bd23911 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -4160,7 +4160,7 @@ static void issue_action_BSSCoexistPacket(struct adapter 
*padapter)
}
}
 
-   pframe = rtw_set_ie(pframe, 
EID_BSSIntolerantChlReport, k, InfoContent, &(pattrib->pktlen));
+   pframe = rtw_set_ie(pframe, 
WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, InfoContent, &(pattrib->pktlen));
 
}
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 12/21] staging: rtl8723bs: replace _CHLGETXT_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _CHLGETXT_IE_ macro with kernel provided WLAN_EID_CHALLENGE
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 
 drivers/staging/rtl8723bs/include/wifi.h  | 1 -
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 319a99833a49..93380493e8dc 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1028,7 +1028,7 @@ unsigned int OnAuth(struct adapter *padapter, union 
recv_frame *precv_frame)
/* checking for challenging txt... */
DBG_871X("checking for challenging txt...\n");
 
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + 
_AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&ie_len,
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + 
_AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&ie_len,
len - WLAN_HDR_A3_LEN - 
_AUTH_IE_OFFSET_ - 4);
 
if ((p == NULL) || (ie_len <= 0)) {
@@ -1124,7 +1124,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union 
recv_frame *precv_fram
if (seq == 2) {
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) {
 /*  legendary shared system */
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 
_AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&len,
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 
_AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len,
pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);
 
if (p == NULL) {
@@ -3026,7 +3026,7 @@ void issue_auth(struct adapter *padapter, struct sta_info 
*psta, unsigned short
 
/*  added challenging text... */
if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) 
&& (use_shared_key == 1))
-   pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, 
psta->chg_txt, &(pattrib->pktlen));
+   pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, 
psta->chg_txt, &(pattrib->pktlen));
 
} else {
memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), 
ETH_ALEN);
@@ -3066,7 +3066,7 @@ void issue_auth(struct adapter *padapter, struct sta_info 
*psta, unsigned short
 
/*  then checking to see if sending challenging text... */
if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & 
WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) {
-   pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, 
pmlmeinfo->chg_txt, &(pattrib->pktlen));
+   pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, 
pmlmeinfo->chg_txt, &(pattrib->pktlen));
 
SetPrivacy(fctrl);
 
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index 6df50468200e..2f13bbe38f74 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -387,7 +387,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 
 #define _FIXED_IE_LENGTH_  _BEACON_IE_OFFSET_
 
-#define _CHLGETXT_IE_  16
 #define _SUPPORTED_CH_IE_  36
 #define _CH_SWTICH_ANNOUNCE_   37  /* Secondary Channel Offset */
 #define _ERPINFO_IE_   42
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 19/21] staging: rtl8723bs: replace EID_EXTCapability

2020-12-07 Thread Ross Schmidt
Replace unique EID_EXTCapability constant with kernel provided
WLAN_EID_EXT_CAPABILITY from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index d05338015744..2c9425e2a1e9 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2912,7 +2912,7 @@ void rtw_append_exented_cap(struct adapter *padapter, u8 
*out_ie, uint *pout_len
if (phtpriv->bss_coexist)
SET_EXT_CAPABILITY_ELE_BSS_COEXIST(cap_content, 1);
 
-   rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content, 
pout_len);
+   rtw_set_ie(out_ie + *pout_len, WLAN_EID_EXT_CAPABILITY, 8, cap_content, 
pout_len);
 }
 
 inline void rtw_set_to_roam(struct adapter *adapter, u8 to_roam)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 9d172bd23911..fa4b0259c5ae 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -3381,9 +3381,9 @@ void issue_assocreq(struct adapter *padapter)
}
break;
 
-   case EID_EXTCapability:
+   case WLAN_EID_EXT_CAPABILITY:
if (padapter->mlmepriv.htpriv.ht_option)
-   pframe = rtw_set_ie(pframe, EID_EXTCapability, 
pIE->Length, pIE->data, &(pattrib->pktlen));
+   pframe = rtw_set_ie(pframe, 
WLAN_EID_EXT_CAPABILITY, pIE->Length, pIE->data, &(pattrib->pktlen));
break;
default:
break;
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 14/21] staging: rtl8723bs: replace _EXT_SUPPORTEDRATES_IE_

2020-12-07 Thread Ross Schmidt
Replace unique _EXT_SUPPORTEDRATES_IE_ macro with kernel provided
WLAN_EID_EXT_SUPP_RATES from linux/ieee80211.h.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c|  2 +-
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c |  4 ++--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  | 18 +-
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c |  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c   |  4 ++--
 drivers/staging/rtl8723bs/include/wifi.h   |  1 -
 6 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 5e93a85cb6ce..b6f944b37b08 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1043,7 +1043,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
/* get ext_supported rates */
p = rtw_get_ie(
ie + _BEACON_IE_OFFSET_,
-   _EXT_SUPPORTEDRATES_IE_,
+   WLAN_EID_EXT_SUPP_RATES,
&ie_len,
pbss_network->IELength - _BEACON_IE_OFFSET_
);
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index b899f511ff9f..28d5892d8bda 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -344,7 +344,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
 
if (rateLen > 8) {
ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, 
pdev_network->SupportedRates, &sz);
-   /* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz); */
+   /* ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz); */
} else {
ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, 
pdev_network->SupportedRates, &sz);
}
@@ -357,7 +357,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
ie = rtw_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2, (u8 
*)&(pdev_network->Configuration.ATIMWindow), &sz);
 
if (rateLen > 8) {
-   ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz);
+   ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), 
(pdev_network->SupportedRates + 8), &sz);
}
 
/* HT Cap. */
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 5d56fbf0c1fe..e9b14fc8b10f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -783,7 +783,7 @@ unsigned int OnBeacon(struct adapter *padapter, union 
recv_frame *precv_frame)
u8 *p = NULL;
u32 ielen = 0;
 
-   p = rtw_get_ie(pframe + sizeof(struct ieee80211_hdr_3addr) + 
_BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ielen, precv_frame->u.hdr.len - 
sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_);
+   p = rtw_get_ie(pframe + sizeof(struct ieee80211_hdr_3addr) + 
_BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES, &ielen, precv_frame->u.hdr.len - 
sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_);
if (p && ielen > 0) {
if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D)) {
/* Invalid value 0x2D is detected in Extended Supported 
Rates (ESR) IE. Try to fix the IE length to avoid failed Beacon parsing. */
@@ -1284,7 +1284,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union 
recv_frame *precv_frame)
memcpy(supportRate, p+2, ie_len);
supportRateNum = ie_len;
 
-   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, 
_EXT_SUPPORTEDRATES_IE_, &ie_len,
+   p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, 
WLAN_EID_EXT_SUPP_RATES, &ie_len,
pkt_len - WLAN_HDR_A3_LEN - ie_offset);
if (p !=  NULL) {
 
@@ -2561,7 +2561,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
 
/*  EXTERNDED SUPPORTED RATE */
if (rate_len > 8) {
-   pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len 
- 8), (cur_network->SupportedRates + 8), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len 
- 8), (cur_network->SupportedRates + 8), &pattrib->pktlen);
}
 
 
@@ -2764,7 +2764,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
 
/*  EXTERNDED SUPPORTED RATE */
if (rate_len > 8) {
-   pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, 
(rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, 
(rate_len - 8), (cur_network->SupportedRates + 8), &pattr

[PATCH v2 20/21] staging: rtl8723bs: remove unused macros

2020-12-07 Thread Ross Schmidt
Remove many macros from wifi.h and ieee80211.h because they are unused.

Signed-off-by: Ross Schmidt 
---
 drivers/staging/rtl8723bs/include/ieee80211.h |  5 -
 drivers/staging/rtl8723bs/include/wifi.h  | 15 ---
 2 files changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h 
b/drivers/staging/rtl8723bs/include/ieee80211.h
index 20c53c290aa1..d9ff8c8e7f36 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -348,11 +348,6 @@ struct ieee80211_snap_hdr {
 #define WLAN_REASON_JOIN_WRONG_CHANNEL   65534
 #define WLAN_REASON_EXPIRATION_CHK 65535
 
-/* EIDs defined by IEEE 802.11h - END */
-#define WLAN_EID_20_40_BSS_COEXISTENCE 72
-#define WLAN_EID_20_40_BSS_INTOLERANT 73
-#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
-
 #define IEEE80211_MGMT_HDR_LEN 24
 #define IEEE80211_DATA_HDR3_LEN 24
 #define IEEE80211_DATA_HDR4_LEN 30
diff --git a/drivers/staging/rtl8723bs/include/wifi.h 
b/drivers/staging/rtl8723bs/include/wifi.h
index 82dfdafb38fc..7f482a45705b 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -387,21 +387,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 
 #define _FIXED_IE_LENGTH_  _BEACON_IE_OFFSET_
 
-#define _SUPPORTED_CH_IE_  36
-#define _CH_SWTICH_ANNOUNCE_   37  /* Secondary Channel Offset */
-
-#define _FTIE_ 55
-#define _TIMEOUT_ITVL_IE_  56
-#define _SRC_IE_   59
-
-#define _RIC_Descriptor_IE_75
-#define _LINK_ID_IE_   101
-#define _CH_SWITCH_TIMING_ 104
-#define _PTI_BUFFER_STATUS_106
-#define _EXT_CAP_IE_   127
-
-#define_RESERVED47_47
-
 enum ELEMENT_ID {
EID_SsId= 0, /* service set 
identifier (0:32) */
EID_SupRates= 1, /* supported rates (1:8) */
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: (subset) [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-07 Thread Martin K. Petersen
On Fri, 20 Nov 2020 12:21:39 -0600, Gustavo A. R. Silva wrote:

> This series aims to fix almost all remaining fall-through warnings in
> order to enable -Wimplicit-fallthrough for Clang.
> 
> In preparation to enable -Wimplicit-fallthrough for Clang, explicitly
> add multiple break/goto/return/fallthrough statements instead of just
> letting the code fall through to the next case.
> 
> [...]

Applied to 5.11/scsi-queue, thanks!

[054/141] target: Fix fall-through warnings for Clang
  https://git.kernel.org/mkp/scsi/c/492096ecfa39

-- 
Martin K. Petersen  Oracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing] BUILD SUCCESS 19cf9d7afc2e7b91f47b8f2638ec08b29de55060

2020-12-07 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-testing
branch HEAD: 19cf9d7afc2e7b91f47b8f2638ec08b29de55060  staging: rtl8723bs: 
remove LIST_CONTAINOR

elapsed time: 742m

configs tested: 139
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm defconfig
arm64allyesconfig
arm64   defconfig
arm  allyesconfig
arm  allmodconfig
powerpc  walnut_defconfig
arm  simpad_defconfig
nds32   defconfig
powerpc tqm8555_defconfig
arm palmz72_defconfig
arc  axs103_defconfig
powerpc  mpc885_ads_defconfig
mips   ip28_defconfig
powerpc pq2fads_defconfig
powerpc mpc832x_rdb_defconfig
c6x dsk6455_defconfig
m68km5272c3_defconfig
m68k  hp300_defconfig
s390  debug_defconfig
arm ezx_defconfig
mipsgpr_defconfig
microblaze  defconfig
microblazenommu_defconfig
powerpc   motionpro_defconfig
arm   imx_v4_v5_defconfig
powerpc mpc834x_itx_defconfig
powerpc wii_defconfig
mips cobalt_defconfig
m68kstmark2_defconfig
arm  colibri_pxa300_defconfig
powerpc powernv_defconfig
m68kmvme16x_defconfig
powerpc tqm8540_defconfig
mips rt305x_defconfig
powerpc   lite5200b_defconfig
arm mv78xx0_defconfig
powerpc   currituck_defconfig
sparc   sparc32_defconfig
sh   rts7751r2dplus_defconfig
sh  defconfig
powerpc  pasemi_defconfig
arc haps_hs_defconfig
armmulti_v5_defconfig
mips   ci20_defconfig
arm eseries_pxa_defconfig
ia64  tiger_defconfig
i386defconfig
sh   se7780_defconfig
arm   omap2plus_defconfig
arm lpc18xx_defconfig
sh  sdk7780_defconfig
m68k   m5275evb_defconfig
mips tb0287_defconfig
m68k alldefconfig
arm   omap1_defconfig
umkunit_defconfig
sh kfr2r09-romimage_defconfig
powerpcfsp2_defconfig
powerpc   eiger_defconfig
arm   tegra_defconfig
shhp6xx_defconfig
powerpcadder875_defconfig
arm at91_dt_defconfig
armshmobile_defconfig
sh   se7751_defconfig
riscv  rv32_defconfig
ia64 allmodconfig
ia64defconfig
ia64 allyesconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
c6x  allyesconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386   tinyconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a005-20201207
i386 randconfig-a004-20201207
i386 randconfig-a001-20201207
i386

Re: [PATCH 1/3] dt-bindings: pinctrl: rt2880: add binding document

2020-12-07 Thread Sergio Paracuellos
Hi Linus,

Thanks for the review. There weren't too many yaml samples for this so
as you had seen this was a bit messy and I really needed this review,
especially in the 'if' clause part :).

On Mon, Dec 7, 2020 at 11:42 PM Linus Walleij  wrote:
>
> Hi Sergio,
>
> thanks for driving this!
>
> On Mon, Dec 7, 2020 at 8:21 PM Sergio Paracuellos
>  wrote:
>
> > The commit adds rt2880 compatible node in binding document.
> >
> > Signed-off-by: Sergio Paracuellos 
> (...)
> > +description:
> > +  The rt2880 pinmux can only set the muxing of pin groups. muxing 
> > indiviual pins
> > +  is not supported. There is no pinconf support.
>
> OK!
>
> > +properties:
> > +  compatible:
> > +enum:
> > +  - ralink,rt2880-pinmux
> > +
> > +  pinctrl-0:
> > +description:
> > +  A phandle to the node containing the subnodes containing default
> > +  configurations.
>
> As it is a node on the pin controller itself, this is a hog so write something
> about that this is for pinctrl hogs.

Ok, will do.

>
> > +  pinctrl-names:
> > +description:
> > +  A pinctrl state named "default" must be defined.
> > +const: default
>
> Is it really compulsory?

Not really, I guess. The current device tree contains one so I added
here because of this.
>
> > +required:
> > +  - compatible
> > +  - pinctrl-names
> > +  - pinctrl-0
>
> I wonder if the hogs are really compulsory.

Ok, so I guess I should remove both 'pinctrl-names' and ' pinctrl-0'
from the required but maintain its desciption.

>
> > +patternProperties:
> > +  '^.*$':
>
> That's liberal node naming!
> What about [a-z0-9_-]+ or something?

hahaha. Yeah, I like freedom :), but yes, you are right, I will change
the pattern using the one proposed here.

>
> > +if:
> > +  type: object
> > +  description: |
> > +A pinctrl node should contain at least one subnodes representing 
> > the
> > +pinctrl groups available on the machine.
> > +  $ref: "pinmux-node.yaml"
> > +  required:
> > +- groups
> > +- function
> > +  additionalProperties: false
> > +then:
> > +  properties:
> > +groups:
> > +  description:
> > +Name of the pin group to use for the functions.
> > +  $ref: "/schemas/types.yaml#/definitions/string"
> > +  enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
> > + pcie, sdhci]
> > +function:
> > +  description:
> > +The mux function to select
> > +  $ref: "/schemas/types.yaml#/definitions/string"
> > +  enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
> > + mdio, nand1, nand2, sdhci]
>
> Why do we have this complex if: clause?

To be honest to avoid problems with other pinctrl root nodes because
they are not type 'object' and not having real idea in what way this
should be achieved :).

> $ref: "pinmux-node.yaml" should bring in the groups and
> function properties. Then you can add some further restrictions
> on top of that, right?
>
> I would just do:
>
> patternProperties:
>   '^[a-z0-9_]+$':
> type: object
>   description: node for pinctrl
>   $ref "pinmux-node.yaml"
>
>   properties:
> groups:
>   description: groups...
>   enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
> pcie, sdhci]
> function:
>   description: function...
>   enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
> mdio, nand1, nand2, sdhci]
>
> Note: the function names are fine but the group names are a bit
> confusion since often a group can be used for more than one
> function, and e.g.
>
> function = "i2c";
> group = "uart1";
>
> to use the uart1 pins for an i2c is gonna look mildly confusing.
>
> But if this is what the hardware calls it I suppose it is
> fine.

This is the way is currently being used in the device tree.

>
> Yours,
> Linus Walleij

Thanks again. I will change this and send v2.

Best regards,
 Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] pinctrl: ralink: add a pinctrl driver for the rt2880 family

2020-12-07 Thread Sergio Paracuellos
Hi Linus,

On Tue, Dec 8, 2020 at 12:00 AM Linus Walleij  wrote:
>
> Hi Serigio,
>
> I dug around some to try to understand the patch I think I get
> it now :)
>
> Squash this with the third patch so it becomes a
> "move" of this file, preserving history. With that:
> Acked-by: Linus Walleij 

Ok, will squash those two if you prefer that way with your 'Acked-by'.

>
> I have ideas, but it is better to move the driver out
> of staging and improve it in pinctrl.
>
> Since there might be many sub-SoCs for this pin
> controller, what about creating
> drivers/pinctrl/ralink/* for this at the same time?

Ok, I will put this inside a ralink subdirectory in pinctrl.

>
> On Mon, Dec 7, 2020 at 8:21 PM Sergio Paracuellos
>  wrote:
> >
> > These Socs have 1-3 banks of 8-32 gpios. Rather then setting the muxing of 
> > each
> > pin individually, these socs have mux groups that when set will effect 1-N 
> > pins.
> > Pin groups have a 2, 4 or 8 different muxes.
> >
> > Signed-off-by: Sergio Paracuellos 
> (...)
> > +#include 
> > +#include 
> > +#include 
>
> I think in the next step we should move the contents of
> rt2880_pinmux_data into this driver, then we can drop these
> mach-headers and show the way for the rest of the ralink
> chips to push their data down into this driver (or subdrivers)
> and depopulate mach-ralink a bit.

Agree. Doing that no arch dependencies are included and we can cleanly
enable the driver also for COMPILE_TEST without adding special flags
in pinctrl Makefile.

>
> > +   p->groups = rt2880_pinmux_data;
>
> So this is where the driver actually gets a pointer to all
> groups and functions, and these groups and functions all
> come from arch/mips/ralink/mt7621.c right?

Yes, all of that is defined there.

>
> I think after this first step we should move mt7621.c
> to pinctrl and become a subdriver for this pin controller
> and then we can hopefully move the rest as well once
> you set the pattern for how we do this.

I see. Thanks for advices.

>
> Yours,
> Linus Walleij

Best regards,
Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] pinctrl: ralink: pinctrl driver for the rt2880 family

2020-12-07 Thread Sergio Paracuellos
This series adds a pinctrl driver for ralink rt2880 SoC.

After last cleanup in staging I was told [0] this driver is ready to be
promoted from staging.

This series are rebased on the top of staging-testing.

Thanks in advance for your time.

Changes in v2:
- Squash PATCH 2/3 and PATCH 3/3 in only one.
- Put driver inside 'ralink' subdir of pinctrl.
- Add Linus'Acked-by for driver after squashing two patches. 
- Make changes suggested by Linus in bindings doc: [1].
  NOTE that I simplified but not removes if-clause because without
  that I am not be able to validate using 'dt_binding_check' with errors
  in all pinctrl nodes because are not of type 'object'.

Best regards,
Sergio Paracuellos

[0]: 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2020-December/149178.html
[1]: 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2020-December/149204.html

*** BLURB HERE ***

Sergio Paracuellos (2):
  dt-bindings: pinctrl: rt2880: add binding document
  pinctrl: ralink: add a pinctrl driver for the rt2880 family

 .../pinctrl/ralink,rt2880-pinmux.yaml | 70 +++
 drivers/pinctrl/Kconfig   |  1 +
 drivers/pinctrl/Makefile  |  1 +
 drivers/pinctrl/ralink/Kconfig| 14 
 .../ralink}/Makefile  |  2 -
 .../ralink}/pinctrl-rt2880.c  |  4 +-
 drivers/staging/Kconfig   |  2 -
 drivers/staging/Makefile  |  1 -
 drivers/staging/mt7621-pinctrl/Kconfig|  6 --
 drivers/staging/mt7621-pinctrl/TODO   |  6 --
 10 files changed, 88 insertions(+), 19 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
 create mode 100644 drivers/pinctrl/ralink/Kconfig
 rename drivers/{staging/mt7621-pinctrl => pinctrl/ralink}/Makefile (66%)
 rename drivers/{staging/mt7621-pinctrl => pinctrl/ralink}/pinctrl-rt2880.c 
(99%)
 delete mode 100644 drivers/staging/mt7621-pinctrl/Kconfig
 delete mode 100644 drivers/staging/mt7621-pinctrl/TODO

-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] dt-bindings: pinctrl: rt2880: add binding document

2020-12-07 Thread Sergio Paracuellos
The commit adds rt2880 compatible node in binding document.

Signed-off-by: Sergio Paracuellos 
---
 .../pinctrl/ralink,rt2880-pinmux.yaml | 70 +++
 1 file changed, 70 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml

diff --git 
a/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml 
b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
new file mode 100644
index ..7dea3e26d99e
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/ralink,rt2880-pinmux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ralink rt2880 pinmux controller
+
+maintainers:
+  - Sergio Paracuellos 
+
+description:
+  The rt2880 pinmux can only set the muxing of pin groups. muxing indiviual 
pins
+  is not supported. There is no pinconf support.
+
+properties:
+  compatible:
+enum:
+  - ralink,rt2880-pinmux
+
+  pinctrl-0:
+description:
+  A phandle to the node containing the subnodes containing default
+  configurations. This is for pinctrl hogs.
+
+  pinctrl-names:
+description:
+  A pinctrl state named "default" can be defined.
+const: default
+
+required:
+  - compatible
+
+patternProperties:
+  '[a-z0-9_-]+':
+if:
+  type: object
+  description: node for pinctrl.
+  $ref: "pinmux-node.yaml"
+then:
+  properties:
+groups:
+  description: Name of the pin group to use for the functions.
+  enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio,
+ pcie, sdhci]
+function:
+  description: The mux function to select
+  enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2,
+ mdio, nand1, nand2, sdhci]
+
+additionalProperties: false
+
+examples:
+  # Pinmux controller node
+  - |
+pinctrl {
+  compatible = "ralink,rt2880-pinmux";
+  pinctrl-names = "default";
+  pinctrl-0 = <&state_default>;
+
+  state_default: pinctrl0 {
+  };
+
+  i2c_pins: i2c0 {
+i2c0 {
+  groups = "i2c";
+  function = "i2c";
+};
+  };
+};
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] pinctrl: ralink: add a pinctrl driver for the rt2880 family

2020-12-07 Thread Sergio Paracuellos
These Socs have 1-3 banks of 8-32 gpios. Rather then setting the muxing of each
pin individually, these socs have mux groups that when set will effect 1-N pins.
Pin groups have a 2, 4 or 8 different muxes.

Acked-by: Linus Walleij 
Signed-off-by: Sergio Paracuellos 
---
 drivers/pinctrl/Kconfig|  1 +
 drivers/pinctrl/Makefile   |  1 +
 drivers/pinctrl/ralink/Kconfig | 14 ++
 .../mt7621-pinctrl => pinctrl/ralink}/Makefile |  2 --
 .../ralink}/pinctrl-rt2880.c   |  4 ++--
 drivers/staging/Kconfig|  2 --
 drivers/staging/Makefile   |  1 -
 drivers/staging/mt7621-pinctrl/Kconfig |  6 --
 drivers/staging/mt7621-pinctrl/TODO|  6 --
 9 files changed, 18 insertions(+), 19 deletions(-)
 create mode 100644 drivers/pinctrl/ralink/Kconfig
 rename drivers/{staging/mt7621-pinctrl => pinctrl/ralink}/Makefile (66%)
 rename drivers/{staging/mt7621-pinctrl => pinctrl/ralink}/pinctrl-rt2880.c 
(99%)
 delete mode 100644 drivers/staging/mt7621-pinctrl/Kconfig
 delete mode 100644 drivers/staging/mt7621-pinctrl/TODO

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 815095326e2d..453acce3d0c3 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -385,6 +385,7 @@ source "drivers/pinctrl/nomadik/Kconfig"
 source "drivers/pinctrl/nuvoton/Kconfig"
 source "drivers/pinctrl/pxa/Kconfig"
 source "drivers/pinctrl/qcom/Kconfig"
+source "drivers/pinctrl/ralink/Kconfig"
 source "drivers/pinctrl/renesas/Kconfig"
 source "drivers/pinctrl/samsung/Kconfig"
 source "drivers/pinctrl/spear/Kconfig"
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index f53933b2ff02..3cdb6529db95 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -59,6 +59,7 @@ obj-y += nomadik/
 obj-$(CONFIG_ARCH_NPCM7XX) += nuvoton/
 obj-$(CONFIG_PINCTRL_PXA)  += pxa/
 obj-$(CONFIG_ARCH_QCOM)+= qcom/
+obj-$(CONFIG_PINCTRL_RALINK)   += ralink/
 obj-$(CONFIG_PINCTRL_RENESAS)  += renesas/
 obj-$(CONFIG_PINCTRL_SAMSUNG)  += samsung/
 obj-$(CONFIG_PINCTRL_SPEAR)+= spear/
diff --git a/drivers/pinctrl/ralink/Kconfig b/drivers/pinctrl/ralink/Kconfig
new file mode 100644
index ..8c5f6341477f
--- /dev/null
+++ b/drivers/pinctrl/ralink/Kconfig
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menu "Ralink pinctrl drivers"
+depends on RALINK
+
+config PINCTRL_RALINK
+bool "Ralink pin control support"
+default y if RALINK
+
+config PINCTRL_RT2880
+bool "RT2880 pinctrl driver for RALINK/Mediatek SOCs"
+select PINMUX
+select GENERIC_PINCONF
+
+endmenu
diff --git a/drivers/staging/mt7621-pinctrl/Makefile 
b/drivers/pinctrl/ralink/Makefile
similarity index 66%
rename from drivers/staging/mt7621-pinctrl/Makefile
rename to drivers/pinctrl/ralink/Makefile
index 49445f40c3cd..242554298d07 100644
--- a/drivers/staging/mt7621-pinctrl/Makefile
+++ b/drivers/pinctrl/ralink/Makefile
@@ -1,4 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_PINCTRL_RT2880)   += pinctrl-rt2880.o
-
-ccflags-y += -I$(srctree)/drivers/pinctrl
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
b/drivers/pinctrl/ralink/pinctrl-rt2880.c
similarity index 99%
rename from drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
rename to drivers/pinctrl/ralink/pinctrl-rt2880.c
index e61dbe186bc9..42b1c6cecb57 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c
@@ -20,8 +20,8 @@
 #include 
 #include 
 
-#include "core.h"
-#include "pinctrl-utils.h"
+#include "../core.h"
+#include "../pinctrl-utils.h"
 
 #define SYSC_REG_GPIO_MODE 0x60
 #define SYSC_REG_GPIO_MODE20x64
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 9b7cb7c5766a..c42708e60afc 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -94,8 +94,6 @@ source "drivers/staging/mt7621-pci/Kconfig"
 
 source "drivers/staging/mt7621-pci-phy/Kconfig"
 
-source "drivers/staging/mt7621-pinctrl/Kconfig"
-
 source "drivers/staging/mt7621-dma/Kconfig"
 
 source "drivers/staging/ralink-gdma/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 38226737c9f3..ebcc646d7b51 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_BCM2835_VCHIQ)   += vc04_services/
 obj-$(CONFIG_PI433)+= pi433/
 obj-$(CONFIG_PCI_MT7621)   += mt7621-pci/
 obj-$(CONFIG_PCI_MT7621_PHY)   += mt7621-pci-phy/
-obj-$(CONFIG_PINCTRL_RT2880)   += mt7621-pinctrl/
 obj-$(CONFIG_SOC_MT7621)   += mt7621-dma/
 obj-$(CONFIG_DMA_RALINK)   += ralink-gdma/
 obj-$(CONFIG_SOC_MT7621)   += mt7621-dts/
diff --git a/drivers/staging/mt7621-pinctrl/Kconfig 
b/drivers/staging/mt7621-pinctrl/Kconfig
deleted file mode 100644
index f42974026480..000