Re: Anybody working on gdm72xx?
On Mon, Jun 23, 2014 at 2:33 PM, Kristina Martšenko wrote: > > Here is an example of another driver being moved out: > http://www.spinics.net/lists/linux-usb/msg100924.html > Thanks Kristina. checkpatch reports 1 errors and 17 warnings on the current driver. I guess I need to first submit patches to staging-next to address these issues, and then submit another patch to move it out of staging, right? The last reported error does seem like a false positive to me. Thanks, Ben ### WARNING: please write a paragraph that describes the config symbol fully #100: FILE: drivers/net/wimax/gdm72xx/Kconfig:5: +menuconfig WIMAX_GDM72XX WARNING: please write a paragraph that describes the config symbol fully #108: FILE: drivers/net/wimax/gdm72xx/Kconfig:13: +config WIMAX_GDM72XX_QOS WARNING: please write a paragraph that describes the config symbol fully #112: FILE: drivers/net/wimax/gdm72xx/Kconfig:17: +config WIMAX_GDM72XX_K_MODE WARNING: please write a paragraph that describes the config symbol fully #123: FILE: drivers/net/wimax/gdm72xx/Kconfig:28: +config WIMAX_GDM72XX_USB CHECK: spinlock_t definition without comment #200: FILE: drivers/net/wimax/gdm72xx/gdm_qos.c:33: + spinlock_t lock; CHECK: spinlock_t definition without comment #682: FILE: drivers/net/wimax/gdm72xx/gdm_qos.h:67: + spinlock_t qos_lock; WARNING: networking block comments don't use an empty /* line, use /* Comment... #1140: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.c:443: +/* + * Handle the HCI, WIMAX_SDU_TX_FLOW. WARNING: networking block comments don't use an empty /* line, use /* Comment... #1163: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.c:466: + /* +* If free buffer for sdu tx doesn't exist, then tx queue WARNING: Missing a blank line after declarations #1438: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.h:27: + int len; + void (*callback)(void *cb_data); CHECK: spinlock_t definition without comment #1448: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.h:37: + spinlock_t lock; WARNING: Missing a blank line after declarations #1456: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.h:45: + struct rx_cxt *rx_cxt; + void (*callback)(void *cb_data, void *data, int len); CHECK: spinlock_t definition without comment #1464: FILE: drivers/net/wimax/gdm72xx/gdm_sdio.h:53: + spinlock_t lock; WARNING: networking block comments don't use an empty /* line, use /* Comment... #1822: FILE: drivers/net/wimax/gdm72xx/gdm_usb.c:342: + /* +* In some cases, USB Module of WiMax is blocked when data size is WARNING: networking block comments don't use an empty /* line, use /* Comment... #1923: FILE: drivers/net/wimax/gdm72xx/gdm_usb.c:443: + /* +* If free buffer for sdu tx doesn't CHECK: Blank lines aren't necessary after an open brace '{' #2115: FILE: drivers/net/wimax/gdm72xx/gdm_usb.c:635: + (idProduct & B_DOWNLOAD) == 0) { + CHECK: Blank lines aren't necessary after an open brace '{' #2193: FILE: drivers/net/wimax/gdm72xx/gdm_usb.c:713: + while (!k_mode_stop) { + CHECK: Blank lines aren't necessary after an open brace '{' #2196: FILE: drivers/net/wimax/gdm72xx/gdm_usb.c:716: + while (!list_empty(&k_list)) { + WARNING: Missing a blank line after declarations #2317: FILE: drivers/net/wimax/gdm72xx/gdm_usb.h:33: + u8 *buf; + void (*callback)(void *cb_data); CHECK: spinlock_t definition without comment #2328: FILE: drivers/net/wimax/gdm72xx/gdm_usb.h:44: + spinlock_t lock; WARNING: Missing a blank line after declarations #2336: FILE: drivers/net/wimax/gdm72xx/gdm_usb.h:52: + u8 *buf; + void (*callback)(void *cb_data, void *data, int len); CHECK: spinlock_t definition without comment #2343: FILE: drivers/net/wimax/gdm72xx/gdm_usb.h:59: + spinlock_t lock; CHECK: spinlock_t definition without comment #2422: FILE: drivers/net/wimax/gdm72xx/gdm_wimax.c:54: + spinlock_t evt_lock; WARNING: unchecked sscanf return value #2662: FILE: drivers/net/wimax/gdm72xx/gdm_wimax.c:294: + sscanf(e->dev->name, "wm%d", &idx); WARNING: networking block comments start with * on subsequent lines #2952: FILE: drivers/net/wimax/gdm72xx/gdm_wimax.c:584: + /*NOTE: gdm_update_fsm should be called + before gdm_wimax_ioctl_set_data is called*/ WARNING: networking block comments put the trailing */ on a separate line #2952: FILE: drivers/net/wimax/gdm72xx/gdm_wimax.c:584: + before gdm_wimax_ioctl_set_data is called*/ WARNING: Missing a blank line after declarations #3375: FILE: drivers/net/wimax/gdm72xx/gdm_wimax.h:39: + struct net_device *netdev; + int (*send_func)(void *priv_dev, void *data, int len, WARNING:
[PATCH staging-next] staging: gdm72xx: remove blank lines after an open brace
This patch fixes the following checkpatch warning: CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Ben Chan --- drivers/staging/gdm72xx/gdm_usb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c index 78d6667..256059c 100644 --- a/drivers/staging/gdm72xx/gdm_usb.c +++ b/drivers/staging/gdm72xx/gdm_usb.c @@ -632,7 +632,6 @@ static void gdm_usb_disconnect(struct usb_interface *intf) if (idProduct != EMERGENCY_PID && bConfigurationValue != DOWNLOAD_CONF_VALUE && (idProduct & B_DOWNLOAD) == 0) { - udev = phy_dev->priv_dev; udev->usbdev = NULL; @@ -710,10 +709,8 @@ static int k_mode_thread(void *arg) int ret; while (!k_mode_stop) { - spin_lock_irqsave(&k_lock, flags2); while (!list_empty(&k_list)) { - udev = list_entry(k_list.next, struct usbwm_dev, list); tx = &udev->tx; rx = &udev->rx; -- 2.0.0.526.g5318336 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH staging-next] staging: gdm72xx: fix block comment style
This patch fixes the following checkpatch warnings, which are issued when the gdm72xx driver is moved out of staging into drivers/net/wimax: WARNING: networking block comments don't use an empty /* line, use /* Comment... WARNING: networking block comments start with * on subsequent lines WARNING: networking block comments put the trailing */ on a separate line Signed-off-by: Ben Chan --- drivers/staging/gdm72xx/gdm_sdio.c | 7 ++- drivers/staging/gdm72xx/gdm_usb.c | 6 ++ drivers/staging/gdm72xx/gdm_wimax.c | 5 +++-- drivers/staging/gdm72xx/hci.h | 4 +--- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c index 7398d45..0c6a3eb 100644 --- a/drivers/staging/gdm72xx/gdm_sdio.c +++ b/drivers/staging/gdm72xx/gdm_sdio.c @@ -439,9 +439,7 @@ static int gdm_sdio_send(void *priv_dev, void *data, int len, return 0; } -/* - * Handle the HCI, WIMAX_SDU_TX_FLOW. - */ +/* Handle the HCI, WIMAX_SDU_TX_FLOW. */ static int control_sdu_tx_flow(struct sdiowm_dev *sdev, u8 *hci_data, int len) { struct tx_cxt *tx = &sdev->tx; @@ -462,8 +460,7 @@ static int control_sdu_tx_flow(struct sdiowm_dev *sdev, u8 *hci_data, int len) tx->stop_sdu_tx = 0; if (tx->can_send) schedule_work(&sdev->ws); - /* -* If free buffer for sdu tx doesn't exist, then tx queue + /* If free buffer for sdu tx doesn't exist, then tx queue * should not be woken. For this reason, don't pass the command, * START_SDU_TX. */ diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c index 78d6667..2325d41 100644 --- a/drivers/staging/gdm72xx/gdm_usb.c +++ b/drivers/staging/gdm72xx/gdm_usb.c @@ -338,8 +338,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len, t->callback = cb; t->cb_data = cb_data; - /* -* In some cases, USB Module of WiMax is blocked when data size is + /* In some cases, USB Module of WiMax is blocked when data size is * the multiple of 512. So, increment length by one in that case. */ if ((len % 512) == 0) @@ -439,8 +438,7 @@ static void gdm_usb_rcv_complete(struct urb *urb) list_for_each_entry(t, &tx->sdu_list, list) { usb_submit_urb(t->urb, GFP_ATOMIC); } - /* -* If free buffer for sdu tx doesn't + /* If free buffer for sdu tx doesn't * exist, then tx queue should not be * woken. For this reason, don't pass * the command, START_SDU_TX. diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index e5e5115..833d0d4 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -580,8 +580,9 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return ret; } else if (req->cmd == SIOCS_DATA) { if (req->data_id == SIOC_DATA_FSM) { - /*NOTE: gdm_update_fsm should be called - before gdm_wimax_ioctl_set_data is called*/ + /* NOTE: gdm_update_fsm should be called +* before gdm_wimax_ioctl_set_data is called. +*/ gdm_update_fsm(dev, (struct fsm_s *)req->data.buf); } diff --git a/drivers/staging/gdm72xx/hci.h b/drivers/staging/gdm72xx/hci.h index 2485a37..059ba00 100644 --- a/drivers/staging/gdm72xx/hci.h +++ b/drivers/staging/gdm72xx/hci.h @@ -112,13 +112,11 @@ #define W_SCAN_ALL_SUBSCRIPTION1 #define W_SCAN_SPECIFIED_SUBSCRIPTION 2 -/* - * TLV +/* TLV * * [31:31] indicates the type is composite. * [30:16] is the length of the type. 0 length means length is variable. * [15:0] is the actual type. - * */ #define TLV_L(x) (((x) >> 16) & 0xff) #define TLV_T(x) ((x) & 0xff) -- 2.0.0.526.g5318336 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on ced1401?
On 23/06/2014 22:19, Kristina Martšenko wrote:> Hi Angelo, > > I'm helping Greg do a bit of cleanup in the staging tree. I noticed that > nobody seems to have worked towards moving quickstart out of staging in > over a year. Are there any plans to clean it up and move it out soon? > Because otherwise we're going to have to delete the driver, as we don't > want staging to become a permanent place for unfinished code. Hi Kristina, I was planning to send some patches for cleaning up this driver. In particular what I would like to: - fix camel case naming of variables and functions - fix checkpatch warnings - fix build warnings Anyway I don't have the hardware so I can't test them. Please let me know if these patches are welcome, so I'll send them in the next weeks. Thanks Regards Luca Ellero ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue
On 23/06/14 16:05, Maurice Moss wrote: Hi All, Thanks for your reply. I have been away the last few weeks. Dan, I am using 64 bit Debian 3.2.57. So I am not using the latest kernel. Would this be a problem? That's probably quite old now. Depending on your hardware there may be important fixes. There was certainly one to get the driver working on SBCs with IOMMUs, though I'm afraid I don't know exactly which version that landed in off the top of my head. Martyn, I don't have a bus analyzer. I believe I have understood a few more things about my setup, but I still manage to hang the bus. I have the following questions for now: 1. Is there a way to find out if the tsi148 driver is working correctly? Do you have a second SBC? It would probably be easier to prove out basic accesses between 2 SBCs. 2. Addressing?! I am still not clear on the addressing scheme. From the documentation of the slave (ZMI 4104 card) given it's set in slot 2 with Geographical Addressing enabled, the 24 bits of it's VME bus address are: A(23:20) -> 'b [Board jumpers set to zero] A(19:15) -> 'b00010 [Geographical address set to 2, as the slave is in slot 2] A(14) -> 'b0 [0 if Geo Addressing enabled] AFAIK, this sets the base of the window to, 0x1. Am I correct to assume this? Might be worth checking that the backplane supports geographical addressing. Can you put the SBC in the slot that the slave is usually in? Assuming that the SBC is wired to support geographical addressing (and they aren't always), the driver will print out the slot it detects it's in when the driver is loaded. Make sure your not forcing the geographical address via the kernel param! That'll hopefully confirm that the slots getting the expected address. Does the board expect user/data cycles? The slave board responds to address modifier codes 0x39 (A24 non-privileged data access), and 0x3D (A24 supervisory data access), hence I set: master.cycle = 0x2000 | 0x8000; // user/data access That sounds right. Martyn Cheers! On Wed, Jun 11, 2014 at 10:36 AM, Martyn Welch wrote: Hi Maurice, On 04/06/14 22:43, Maurice Moss wrote: Dear All, I came across the link here and decided to write to you, as I am facing a very similar problem: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-May/037941.html With the above linux, I have recompiled the kernel and booting the image with a vme_user.bus=0 vme_tsi148.geoid=1 vme_tsi148.err_chk=1 flags. I am just starting to get familiar with VME. Using XVME 6300 (sitting in Slot 1), I am trying to access a ZMI 4100 board (in slot 2, only 2 slots on the chassis whose back plane supports GA) via geographical addressing. If the backplane supports geographical addressing, you don't need to set geoid (unless your SBC doesn't support geoid that is). The ZMI board (supports only A24, D16/32, GA, NO CS/CSR). I pretty much have the same code as mentioned in the thread, however all I read are 0xff's and my system hangs every once in a while (needs hard reset). This makes debugging very hard. I am trying to read valid registers at a given offset (in this case 0x003C). My master struct is setup as below and I hope you can help me with the following questions: master.enable = 1; master.vme_addr = 0x1; master.size = 0x1; master.aspace = 2; // VME_A24 master.cycle = 0x2000 | 0x8000;// user/data access master.dwidth = 2; // 16 bit word access Is this offset 0x003C in the VME address space or 0x1003C? You have the base of the window set to 0x1. Does the board expect user/data cycles? 0. I suspect my master struct is packed wrong. struct vme_master { int enable; /* State of Window */ unsigned long long vme_addr;/* Starting Address on the VMEbus */ unsigned long long size;/* Window Size */ vme_address_t aspace; /* Address Space */ vme_cycle_t cycle; /* Cycle properties */ vme_width_t dwidth; /* Maximum Data Width */ }; I'm not sure I follow. 1. I don't believe accessing 64k of the ZMI's VME address space is a valid operation, could this be causing the bus to hang? Actually, I have this doubt because I am unsure how exactly the master window is setup. Are you reading the whole of the 64k? From memory, the tsi148 has a minimum window size of 64k, this should be fine as long as you don't read outside the devices registers. 2. From the documentation of ZMI 4100, it is claimed that the board supports VME64 and VME64X. However, I am not sure if master.cycle bits for 2eVME need to be set or not?! If you want to use the high speed block transfer modes, set them as required in the cycle properties. 3. Is there away to prevent the bus from hanging by modifying tsi148 device code? I'm not sure why it's hanging, I'm not familiar wi
Re: [PATCH 00/22] Add and use pci_zalloc_consistent
On Tue, 2014-06-24 at 09:27 +1000, Julian Calaby wrote: > > - x = (T)pci_alloc_consistent(E1,E2,E3); > > + x = pci_zalloc_consistent(E1,E2,E3); > > if ((x==NULL) || ...) S > > - memset((T2)x,0,E2); > > I don't know much about SmPL, but wouldn't having that if statement > there reduce your matches? Code that matched without the if statement would be buggy, since it wouldn't be checking the pci_zalloc_consistent return value properly.l johannes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 29/29] staging: comedi: dt282x: automatically handle D/A data format
On 2014-06-23 18:45, Hartley Sweeten wrote: On Monday, June 23, 2014 8:10 AM, Ian Abbott wrote: On 2014-06-20 21:13, H Hartley Sweeten wrote: The DT2821 series board have jumpers that set the output range for the two Analog Output channels. The range_table for the Analog Output subdevice provides all possible ranges to the user. When a unipolar range is selected the board expects the data to be in a straight binary format. When a bipolar range is select the data should be in two's complement format. Currently, the user passes some configuration options when attaching to the driver to select the data format for each channel. If the user does not pass the config options, the data format is assumed to be straight binary. The Analog Output subdevice now has a range_table that provides the user will all possible ranges. Use the range information to determine if the data values need to be munged into two's complememnt values and deprecate the config options. I don't think there's any physical requirement for the 2's complement/straight binary jumpers to match the range jumpers. The 2's complement/straight binary jumper will just invert or pass through the top bit of the data value. A downside of this patch is that users may have to open up their computer to set the jumper how comedi expects it to be, rather than just telling comedi how the jumper is set on the board via the attach option (although the options were handled incorrectly anyway and fixed by your patch 06). Particularly in this case, the default option values for options 6, 7, 9 and 10 would have been to assume the +/-10V range with straight binary coding, but this patch changes it to assume 2's complement encoding for the +/-10V range. In general, I feel it's best not to mess with the attach option values unless they're obviously buggy. These legacy boards can be a pain with all the jumper options... For manual for the DT2821 series states this for the D/A subsystem: "Tables 3-10 and 3-11 indicate jumper selections for the output range for each DAC and the factory configuration. When jumpered for unipolar operation, the DT2821 series board expects digital data in straight binary coding. When set for bipolar mode, the DT2821 series board expects digital data in offset binary coding only." Based on that it appears there is a physical requirement. In that case I agree there's no point having options to configure the encoding of the AO channels' data. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/29] staging: comedi: dt282x: cleanup driver
On 2014-06-20 21:12, H Hartley Sweeten wrote: This series cleans up the comedi dt282x driver. H Hartley Sweeten (29): staging: comedi: dt282x: remove forward declarations staging: comedi: dt282x: move boardinfo declaration staging: comedi: dt282x: remove '= 0' boardinfo staging: comedi: dt282x: convert 'adbits' boardinfo to 'ai_maxdata' staging: comedi: dt282x: convert 'dabits' boardinfo to 'ao_maxdata' staging: comedi: dt282x: fix dt282x_ao_insn_write() staging: comedi: dt282x: remove 'volatile' on private data variables staging: comedi: dt282x: IRQ and DMA are needed for async command support staging: comedi: dt282x: remove DT2821_SIZE define staging: comedi: dt282x: convert private data flags to bit-fields staging: comedi: dt282x: remove unused chan_to_DAC() macro staging: comedi: dt282x: rename the prep_{ai,ao}_dma() functions staging: comedi: dt282x: tidy up Digital I/O subdevice init staging: comedi: dt282x: remove sanity checks of 's->async->prealloc_buf' staging: comedi: dt282x: tidy up dt282x_ao_dma_interrupt() staging: comedi: dt282x: tidy up dt282x_ai_dma_interrupt() staging: comedi: dt282x: fix dt282x_ao_insn_read() staging: comedi: dt282x: factor board initialization out of (*attach) staging: comedi: dt282x: remove the 'opt_*' enum staging: comedi: dt282x: tidy up Analog Output subdevice init staging: comedi: dt282x: tidy up Analog Input subdevice init staging: comedi: dt282x: fix Analog Input se/diff channel configuration staging: comedi: dt282x: cleanup analog output range table staging: comedi: dt282x: tidy up multi-line comments staging: comedi: dt282x: update the MODULE_DESCRIPTION staging: comedi: dt282x: avoid calculating the timer divisor multiple times staging: comedi: dt282x: tidy up the register map and bit defines staging: comedi: dt282x: fix bug where DIO direction is reset to inputs staging: comedi: dt282x: automatically handle D/A data format drivers/staging/comedi/drivers/dt282x.c | 1340 +++ 1 file changed, 630 insertions(+), 710 deletions(-) Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/43] staging: rtl8723au: issue_beacon23a(): Fix another case issuing a corrupted beacon
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 6791ad7..cb882fb 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -2420,6 +2420,7 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms) if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) { u8 *iebuf; int buflen; + pframe -= _BEACON_IE_OFFSET_; /* DBG_8723A("ie len =%d\n", cur_network->IELength); */ memcpy(pframe, cur_network->IEs, cur_network->IELength); len_diff = update_hidden_ssid(pframe + _BEACON_IE_OFFSET_, -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/43] staging: rtl8723au: rtw_generate_ie23a(): update network info as well as IE
From: Jes Sorensen We need to make sure to update the network info as well as the IE array. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ieee80211.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index efad6f8..f235ae0 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -351,8 +351,9 @@ int rtw_generate_ie23a(struct registry_priv *pregistrypriv) int sz = 0, rateLen; struct wlan_bssid_ex* pdev_network = &pregistrypriv->dev_network; u8* ie = pdev_network->IEs; + u16 cap; - + pdev_network->tsf = 0; /* timestamp will be inserted by hardware */ sz += 8; @@ -368,13 +369,20 @@ int rtw_generate_ie23a(struct registry_priv *pregistrypriv) *(u16*)ie = 0; *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_IBSS); + cap = WLAN_CAPABILITY_IBSS; - if (pregistrypriv->preamble == PREAMBLE_SHORT) + if (pregistrypriv->preamble == PREAMBLE_SHORT) { *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); + cap |= WLAN_CAPABILITY_SHORT_PREAMBLE; + } - if (pdev_network->Privacy) + if (pdev_network->Privacy) { *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); + cap |= WLAN_CAPABILITY_PRIVACY; + + } + pdev_network->capability = cap; sz += 2; ie += 2; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/43] staging: rtl8723au: rtw_get_cur_max_rate(): Use _FIXED_IE_LENGTH_ instead of hardcoded value
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index ebb98a0..9584688 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -1190,8 +1190,9 @@ static u16 rtw_get_cur_max_rate(struct rtw_adapter *adapter) u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0; u16 mcs_rate = 0; - p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, &pcur_bss->IEs[12], -pcur_bss->IELength - 12); + p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, +&pcur_bss->IEs[_FIXED_IE_LENGTH_], +pcur_bss->IELength - _FIXED_IE_LENGTH_); if (p && p[1] > 0) { pht_capie = (struct ieee80211_ht_cap *)(p + 2); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/43] staging: rtl8723au: Remove usage of _{RE, }ASOCREQ_IE_OFFSET_
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 6c06d57..ebb98a0 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -2535,16 +2535,18 @@ void rtw_cfg80211_indicate_sta_assoc(struct rtw_adapter *padapter, { struct station_info sinfo; u8 ie_offset; + if (ieee80211_is_assoc_req(hdr->frame_control)) - ie_offset = _ASOCREQ_IE_OFFSET_; + ie_offset = offsetof(struct ieee80211_mgmt, +u.assoc_req.variable); else/* WIFI_REASSOCREQ */ - ie_offset = _REASOCREQ_IE_OFFSET_; + ie_offset = offsetof(struct ieee80211_mgmt, +u.reassoc_req.variable); sinfo.filled = 0; sinfo.filled = STATION_INFO_ASSOC_REQ_IES; - sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset; - sinfo.assoc_req_ies_len = - frame_len - WLAN_HDR_A3_LEN - ie_offset; + sinfo.assoc_req_ies = pmgmt_frame + ie_offset; + sinfo.assoc_req_ies_len = frame_len - ie_offset; cfg80211_new_sta(ndev, hdr->addr2, &sinfo, GFP_ATOMIC); } #else /* defined(RTW_USE_CFG80211_STA_EVENT) */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/43] staging: rtl8723au: Remove unused size defines for mgmt frame elements
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/include/wifi.h | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index 3f64546..bd581ec 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -38,19 +38,6 @@ #defineEID_BSSIntolerantChlReport 73 -/* --- - Below is the fixed elements... --*/ -#define _AUTH_ALGM_NUM_2 -#define _AUTH_SEQ_NUM_ 2 -#define _BEACON_ITERVAL_ 2 -#define _CAPABILITY_ 2 -#define _CURRENT_APADDR_ 6 -#define _LISTEN_INTERVAL_ 2 -#define _ASOC_ID_ 2 -#define _STATUS_CODE_ 2 -#define _TIMESTAMP_8 - /*- Below is the definition for 802.11n --*/ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/43] staging: rtl8723au: Remove unused IE offset #defines
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/include/wifi.h | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index bd581ec..d07fd12 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -23,14 +23,6 @@ */ #defineWiFiNavUpperUs 3 /* 30 ms */ -#define _ASOCREQ_IE_OFFSET_4 /* excluding wlan_hdr */ -#define_ASOCRSP_IE_OFFSET_ 6 -#define _REASOCREQ_IE_OFFSET_ 10 -#define _REASOCRSP_IE_OFFSET_ 6 -#define _PROBEREQ_IE_OFFSET_ 0 -#define_PROBERSP_IE_OFFSET_12 -#define _AUTH_IE_OFFSET_ 6 -#define _DEAUTH_IE_OFFSET_ 0 #define _BEACON_IE_OFFSET_ 12 #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/43] staging: rtl8723au: Remove unused dump_txrpt_ccx_8723a()
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723a_xmit.c | 21 - drivers/staging/rtl8723au/include/rtl8723a_xmit.h | 1 - 2 files changed, 22 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c b/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c index d7612cc..6ea2f9e 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c @@ -18,27 +18,6 @@ #include #include -void dump_txrpt_ccx_8723a(void *buf) -{ - struct txrpt_ccx_8723a *txrpt_ccx = buf; - - DBG_8723A("%s:\n" - "tag1:%u, rsvd:%u, int_bt:%u, int_tri:%u, int_ccx:%u\n" - "mac_id:%u, pkt_drop:%u, pkt_ok:%u, bmc:%u\n" - "retry_cnt:%u, lifetime_over:%u, retry_over:%u\n" - "ccx_qtime:%u\n" - "final_data_rate:0x%02x\n" - "qsel:%u, sw:0x%03x\n" - , __func__ - , txrpt_ccx->tag1, txrpt_ccx->rsvd, txrpt_ccx->int_bt, txrpt_ccx->int_tri, txrpt_ccx->int_ccx - , txrpt_ccx->mac_id, txrpt_ccx->pkt_drop, txrpt_ccx->pkt_ok, txrpt_ccx->bmc - , txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over, txrpt_ccx->retry_over - , txrpt_ccx_qtime_8723a(txrpt_ccx) - , txrpt_ccx->final_data_rate - , txrpt_ccx->qsel, txrpt_ccx_sw_8723a(txrpt_ccx) - ); -} - void handle_txrpt_ccx_8723a(struct rtw_adapter *adapter, void *buf) { struct txrpt_ccx_8723a *txrpt_ccx = buf; diff --git a/drivers/staging/rtl8723au/include/rtl8723a_xmit.h b/drivers/staging/rtl8723au/include/rtl8723a_xmit.h index 79883d7..815560c 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_xmit.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_xmit.h @@ -211,7 +211,6 @@ struct txrpt_ccx_8723a { #define txrpt_ccx_sw_8723a(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) #define txrpt_ccx_qtime_8723a(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) -void dump_txrpt_ccx_8723a(void *buf); void handle_txrpt_ccx_8723a(struct rtw_adapter *adapter, void *buf); void rtl8723a_update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem); void rtl8723a_fill_fake_txdesc(struct rtw_adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/43] staging: rtl8723au: rtw_add_beacon(): Construct a full beacon frame for validation
From: Jes Sorensen Clean up and correct the beacon frame validation using a full beacon frame, and pass that to rtw_check_beacon_data23a(). Previous we went through hoops to construct the frame, minus the ieee80211_3addr header which just made it more complicated, and resulted in inconsistencies and bugs. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ap.c | 8 +--- drivers/staging/rtl8723au/include/rtw_ap.h| 3 ++- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 24 +++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 18c9b30..08e933a 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -789,8 +789,8 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_bmc_sta(padapter); } -int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, -unsigned int len) +int rtw_check_beacon_data23a(struct rtw_adapter *padapter, +struct ieee80211_mgmt *mgmt, unsigned int len) { int ret = _SUCCESS; u8 *p; @@ -808,7 +808,9 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_bssid_ex *pbss_network = &pmlmepriv->cur_network.network; u8 *ie = pbss_network->IEs; - + u8 *pbuf = mgmt->u.beacon.variable - _FIXED_IE_LENGTH_; + len -= (offsetof(struct ieee80211_mgmt, u.beacon.variable) - + _FIXED_IE_LENGTH_); /* SSID */ /* Supported rates */ /* DS Params */ diff --git a/drivers/staging/rtl8723au/include/rtw_ap.h b/drivers/staging/rtl8723au/include/rtw_ap.h index 8d9be5a..9f8d235 100644 --- a/drivers/staging/rtl8723au/include/rtw_ap.h +++ b/drivers/staging/rtl8723au/include/rtw_ap.h @@ -32,7 +32,8 @@ void update_beacon23a(struct rtw_adapter *padapter, u8 ie_id, u8 *oui, u8 tx); void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_level); void expire_timeout_chk23a(struct rtw_adapter *padapter); void update_sta_info23a_apmode23a(struct rtw_adapter *padapter, struct sta_info *psta); -int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, unsigned int len); +int rtw_check_beacon_data23a(struct rtw_adapter *padapter, +struct ieee80211_mgmt *mgmt, unsigned int len); void rtw_ap_restore_network(struct rtw_adapter *padapter); void rtw_set_macaddr_acl23a(struct rtw_adapter *padapter, int mode); int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr); diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 9584688..2a4a696 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -2916,10 +2916,11 @@ static int rtw_add_beacon(struct rtw_adapter *adapter, const u8 *head, { int ret = 0; u8 *pbuf; - uint len, wps_ielen = 0; + uint len, ielen, wps_ielen = 0; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct wlan_bssid_ex *bss = &pmlmepriv->cur_network.network; const struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)head; + struct ieee80211_mgmt *tmpmgmt; /* struct sta_priv *pstapriv = &padapter->stapriv; */ DBG_8723A("%s beacon_head_len =%zu, beacon_tail_len =%zu\n", @@ -2934,33 +2935,32 @@ static int rtw_add_beacon(struct rtw_adapter *adapter, const u8 *head, pbuf = kzalloc(head_len + tail_len, GFP_KERNEL); if (!pbuf) return -ENOMEM; + tmpmgmt = (struct ieee80211_mgmt *)pbuf; bss->beacon_interval = get_unaligned_le16(&mgmt->u.beacon.beacon_int); bss->capability = get_unaligned_le16(&mgmt->u.beacon.capab_info); bss->tsf = get_unaligned_le64(&mgmt->u.beacon.timestamp); /* 24 = beacon header len. */ - memcpy(pbuf, (void *)head + sizeof(struct ieee80211_hdr_3addr), - head_len - sizeof(struct ieee80211_hdr_3addr)); - memcpy(pbuf + head_len - sizeof(struct ieee80211_hdr_3addr), - (void *)tail, tail_len); - - len = head_len + tail_len - sizeof(struct ieee80211_hdr_3addr); + memcpy(pbuf, (void *)head, head_len); + memcpy(pbuf + head_len, (void *)tail, tail_len); + len = head_len + tail_len; + ielen = len - offsetof(struct ieee80211_mgmt, u.beacon.variable); /* check wps ie if inclued */ if (cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSOFT_WPS, - pbuf + _FIXED_IE_LENGTH_, - len - _FIXED_IE_LENGTH_)) + tmpmgmt->u.beacon.variable, ielen))
[PATCH 09/43] staging: rtl8723au: Remove no-op CheckFwRsvdPageContent23a()
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 5 - drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 -- drivers/staging/rtl8723au/include/rtl8723a_cmd.h | 2 -- 3 files changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index ca1bea8..2d67762 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -441,11 +441,6 @@ static void ConstructProbeRsp(struct rtw_adapter *padapter, u8 *pframe, *pLength = pktlen; } -/* To check if reserved page content is destroyed by beacon beacuse beacon is too large. */ -void CheckFwRsvdPageContent23a(struct rtw_adapter *Adapter) -{ -} - /* */ /* Description: Fill the reserved packets that FW will use to RSVD page. */ /* Now we just send 4 types packet to rsvd page. */ diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 46f5abc..8b3473f 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -1034,8 +1034,6 @@ static void StopTxBeacon(struct rtw_adapter *padapter) rtl8723au_write8(padapter, REG_TBTT_PROHIBIT + 1, 0x64); pHalData->RegReg542 &= ~BIT(0); rtl8723au_write8(padapter, REG_TBTT_PROHIBIT + 2, pHalData->RegReg542); - - CheckFwRsvdPageContent23a(padapter); /* 2010.06.23. Added by tynli. */ } static void _BeaconFunctionEnable(struct rtw_adapter *padapter, u8 Enable, diff --git a/drivers/staging/rtl8723au/include/rtl8723a_cmd.h b/drivers/staging/rtl8723au/include/rtl8723a_cmd.h index e1ecbd0..014c02e 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_cmd.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_cmd.h @@ -153,8 +153,6 @@ int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param); int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg); void rtl8723a_add_rateatid(struct rtw_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level); -void CheckFwRsvdPageContent23a(struct rtw_adapter *padapter); - int FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); #endif -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/43] staging: rtl8723au: Clean up becaon frame handling
From: Jes Sorensen Greg, Please find attach my latest changeset for the rtl8723au. The primary change is how we handle the beacon frame information within the driver. Previously the driver would keep half of the ieee80211 management frame plus the IE (information elements), which was a mess since it relied on custom hardcoded offsets into this array. Now we only store the IE elements and keep the beacon information in the data structure describing the network. This is something I have wanted to clean up for a long time - I think I caught all the cases of hard coded offsets into the array, and at least I haven't experienced any crashes after having run with this for a few days. The second part of the patch attempts to clean up the key handling a bit. It's not perfect, but a good chunk better than what it was before. This should apply cleanly to the staging-next tree as of today. Cheers, Jes Jes Sorensen (43): staging: rtl8723au: Remove unused size defines for mgmt frame elements staging: rtl8723au: Remove usage of _{RE,}ASOCREQ_IE_OFFSET_ staging: rtl8723au: Remove unused IE offset #defines staging: rtl8723au: rtw_get_cur_max_rate(): Use _FIXED_IE_LENGTH_ instead of hardcoded value staging: rtl8723au: rtw_add_beacon(): Construct a full beacon frame for validation staging: rtl8723au: rtw_check_beacon_data23a(): Capability is already uptodate in cur_network staging: rtl8723au: Use _FIXED_IE_LEN_ instead of hard coded value staging: rtl8723au: ConstructProbeRsp(): Use struct ieee80211_mgmt staging: rtl8723au: Remove no-op CheckFwRsvdPageContent23a() staging: rtl8723au: Remove unused dump_txrpt_ccx_8723a() staging: rtl8723au: issue_beacon23a(): Fix another case issuing a corrupted beacon staging: rtl8723au: issue_beacon23a(): Determine ie buffer location using 80211_mgmt staging: rtl8723au: rtw_generate_ie23a(): update network info as well as IE staging: rtl8723au: Stop carrying half the beacon frame header in the stored IE array staging: rtl8723au: Get rid of obsolete _FIXED_IE_LENGTH_ + _BEACON_IE_OFFSET staging: rtl8723au: Remove unused #define EID_BSSIntolerantChlReport staging: rtl8723au: Remove unused #define P80211CAPTURE_VERSION staging: rtl8723au: rtw_get_wps_attr_content23a(): Remove unused argument staging: rtl8723au: Remove unused RSN_VERSION_BSD23A staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use key_params->cipher to determine encryption staging: rtl8723au: rtw_cfg80211_ap_set_encryption() is only called for WIFI_AP_STATE staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use key len from struct key_params staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Stop using param->u.crypt.alg staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use keyparms->cipher to set WEP size staging: rtl8723au: rtw_cfg80211_set_encryption(): Pass additional struct key_params staging: rtl8723au: rtw_cfg80211_set_encryption(): Obtain key_len from struct key_params staging: rtl8723au: rtw_cfg80211_set_encryption(): Use key_params->cipher staging: rtl8723au: rtw_cfg80211_set_encryption(): Obtain key from key_params->key staging: rtl8723au: rtw_cfg80211_set_encryption(): Pass key_index as argument staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Pass key_index argument staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): obtain key from key_params staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Add set_tx argument staging: rtl8723au: Stop setting ieee_parm arguments that aren't used staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): No more string parsing to determine cipher staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Add sta_addr argument staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Stop passing ieee_parms argument staging: rtl8723au: Remove obsolete struct ieee_parm staging: rtl8723au: Validate keys in cfg80211_rtw_add_key() staging: rtl8723au: Eliminate set_wep_key() and call set_group_key() directly staging: rtl8723au: rtw_restruct_wmm_ie23a(): Use cfg80211_find_vendor_ie() staging: rtl8723au: rtw_append_pmkid(): Adjust for IEs array not arrying fixed elements staging: rtl8723au: Only validate vendor specific ies, when they it is vendor specific staging: rtl8723au: OnAssocReq23a(): Use cfg80211_find_vendor_ie() to locate VMM drivers/staging/rtl8723au/core/rtw_ap.c | 85 ++- drivers/staging/rtl8723au/core/rtw_ieee80211.c| 51 +- drivers/staging/rtl8723au/core/rtw_mlme.c | 80 +-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 202 --- drivers/staging/rtl8723au/core/rtw_wlan_util.c| 29 +- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 44 +- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 - drivers/staging/rtl8723au/hal/rtl8723a_xmit.c | 21 - drivers/staging/rtl8723au/include/ieee80211.h
[PATCH 29/43] staging: rtl8723au: rtw_cfg80211_set_encryption(): Pass key_index as argument
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 35 +-- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index e521c77..c5ac645 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -801,12 +801,11 @@ exit: } #endif -static int rtw_cfg80211_set_encryption(struct net_device *dev, +static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, struct ieee_param *param, u32 param_len, struct key_params *keyparms) { int ret = 0; - u32 wep_key_idx; int key_len; struct rtw_adapter *padapter = netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -826,7 +825,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, } if (is_broadcast_ether_addr(param->sta_addr)) { - if (param->u.crypt.idx >= WEP_KEYS) { + if (key_index >= WEP_KEYS) { ret = -EINVAL; goto exit; } @@ -841,9 +840,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, ("wpa_set_encryption, crypt.alg = WEP\n")); DBG_8723A("wpa_set_encryption, crypt.alg = WEP\n"); - wep_key_idx = param->u.crypt.idx; - - if (wep_key_idx > WEP_KEYS || key_len <= 0) { + if (key_index > WEP_KEYS || key_len <= 0) { ret = -EINVAL; goto exit; } @@ -864,15 +861,15 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; } - psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; + psecuritypriv->dot11PrivacyKeyIndex = key_index; } - memcpy(&psecuritypriv->wep_key[wep_key_idx].key, + memcpy(&psecuritypriv->wep_key[key_index].key, keyparms->key, key_len); - psecuritypriv->wep_key[wep_key_idx].keylen = key_len; + psecuritypriv->wep_key[key_index].keylen = key_len; - rtw_set_key23a(padapter, psecuritypriv, wep_key_idx, 0); + rtw_set_key23a(padapter, psecuritypriv, key_index, 0); goto exit; } @@ -932,17 +929,14 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, true); } else {/* group key */ memcpy(padapter->securitypriv. - dot118021XGrpKey[param->u.crypt. - idx].skey, + dot118021XGrpKey[key_index].skey, keyparms->key, (key_len > 16 ? 16 : key_len)); memcpy(padapter->securitypriv. - dot118021XGrptxmickey[param->u. -crypt.idx]. + dot118021XGrptxmickey[key_index]. skey, &keyparms->key[16], 8); memcpy(padapter->securitypriv. - dot118021XGrprxmickey[param->u. -crypt.idx]. + dot118021XGrprxmickey[key_index]. skey, &keyparms->key[24], 8); padapter->securitypriv.binstallGrpkey = 1; @@ -950,12 +944,11 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, (" set sta key:groupkey\n"); padapter->securitypriv. - dot118021XGrpKeyid = - param->u.crypt.idx; + dot118021XGrpKeyid = key_index; rtw_set_key23a(padapter, &padapter->securitypriv, - param->u.crypt.idx, 1); + key_index, 1);
[PATCH 18/43] staging: rtl8723au: rtw_get_wps_attr_content23a(): Remove unused argument
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ieee80211.c | 9 + drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723au/include/ieee80211.h | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index 2cb8eed..1f28cca 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -667,15 +667,11 @@ const u8 *rtw_get_wps_attr23a(const u8 *wps_ie, uint wps_ielen, * Returns: the address of the specific WPS attribute content found, or NULL */ const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen, - u16 target_attr_id, u8 *buf_content, - uint *len_content) + u16 target_attr_id, u8 *buf_content) { const u8 *attr_ptr; u32 attr_len; - if (len_content) - *len_content = 0; - attr_ptr = rtw_get_wps_attr23a(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len); @@ -683,9 +679,6 @@ const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen, if (buf_content) memcpy(buf_content, attr_ptr + 4, attr_len - 4); - if (len_content) - *len_content = attr_len - 4; - return attr_ptr + 4; } diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 3a86b75..4b769d5 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -2437,7 +2437,7 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms) if (wps_ie && wps_ie[1] > 0) { rtw_get_wps_attr_content23a(wps_ie, wps_ie[1], WPS_ATTR_SELECTED_REGISTRAR, - (u8*)&sr, NULL); + (u8*)&sr); } if (sr != 0) set_fwstate(pmlmepriv, WIFI_UNDER_WPS); diff --git a/drivers/staging/rtl8723au/include/ieee80211.h b/drivers/staging/rtl8723au/include/ieee80211.h index 43f002d..89c23ae 100644 --- a/drivers/staging/rtl8723au/include/ieee80211.h +++ b/drivers/staging/rtl8723au/include/ieee80211.h @@ -389,7 +389,7 @@ int rtw_parse_wpa_ie23a(const u8* wpa_ie, int wpa_ie_len, int *group_cipher, int int rtw_parse_wpa2_ie23a(const u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x); const u8 *rtw_get_wps_attr23a(const u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_attr, u32 *len_attr); -const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content, uint *len_content); +const u8 *rtw_get_wps_attr_content23a(const u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content); uint rtw_get_rateset_len23a(u8 *rateset); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/43] staging: rtl8723au: ConstructProbeRsp(): Use struct ieee80211_mgmt
From: Jes Sorensen Use ieee80211_mgmt to construct the frame instead of relying on hard coded offsets. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 31 +--- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index ae15624..ca1bea8 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -398,7 +398,7 @@ ConstructNullFunctionData(struct rtw_adapter *padapter, u8 *pframe, static void ConstructProbeRsp(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr, bool bHideSSID) { - struct ieee80211_hdr *pwlanhdr; + struct ieee80211_mgmt *mgmt; u8 *mac, *bssid; u32 pktlen; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -407,29 +407,36 @@ static void ConstructProbeRsp(struct rtw_adapter *padapter, u8 *pframe, /* DBG_8723A("%s\n", __func__); */ - pwlanhdr = (struct ieee80211_hdr *)pframe; + mgmt = (struct ieee80211_mgmt *)pframe; mac = myid(&padapter->eeprompriv); bssid = cur_network->MacAddress; - pwlanhdr->frame_control = + mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); - pwlanhdr->seq_ctrl = 0; + mgmt->seq_ctrl = 0; + + memcpy(mgmt->da, StaAddr, ETH_ALEN); + memcpy(mgmt->sa, mac, ETH_ALEN); + memcpy(mgmt->bssid, bssid, ETH_ALEN); - memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN); - memcpy(pwlanhdr->addr2, mac, ETH_ALEN); - memcpy(pwlanhdr->addr3, bssid, ETH_ALEN); + put_unaligned_le64(cur_network->tsf, + &mgmt->u.probe_resp.timestamp); + put_unaligned_le16(cur_network->beacon_interval, + &mgmt->u.probe_resp.beacon_int); + put_unaligned_le16(cur_network->capability, + &mgmt->u.probe_resp.capab_info); - pktlen = sizeof(struct ieee80211_hdr_3addr); - pframe += pktlen; + pktlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); if (cur_network->IELength > MAX_IE_SZ) return; - memcpy(pframe, cur_network->IEs, cur_network->IELength); - pframe += cur_network->IELength; - pktlen += cur_network->IELength; + memcpy(mgmt->u.probe_resp.variable, + cur_network->IEs + _FIXED_IE_LENGTH_, + cur_network->IELength - _FIXED_IE_LENGTH_); + pktlen += (cur_network->IELength - _FIXED_IE_LENGTH_); *pLength = pktlen; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/43] staging: rtl8723au: rtw_cfg80211_set_encryption(): Obtain key from key_params->key
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 2e21223..e521c77 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -868,7 +868,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, } memcpy(&psecuritypriv->wep_key[wep_key_idx].key, - param->u.crypt.key, key_len); + keyparms->key, key_len); psecuritypriv->wep_key[wep_key_idx].keylen = key_len; @@ -910,19 +910,17 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, " == 1\n", __func__); memcpy(psta->dot118021x_UncstKey.skey, - param->u.crypt.key, + keyparms->key, (key_len > 16 ? 16 : key_len)); if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { memcpy(psta->dot11tkiptxmickey. skey, - ¶m->u.crypt.key[16], - 8); + &keyparms->key[16], 8); memcpy(psta->dot11tkiprxmickey. skey, - ¶m->u.crypt.key[24], - 8); + &keyparms->key[24], 8); padapter->securitypriv. busetkipkey = 0; @@ -936,18 +934,16 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, memcpy(padapter->securitypriv. dot118021XGrpKey[param->u.crypt. idx].skey, - param->u.crypt.key, + keyparms->key, (key_len > 16 ? 16 : key_len)); memcpy(padapter->securitypriv. dot118021XGrptxmickey[param->u. crypt.idx]. - skey, ¶m->u.crypt.key[16], - 8); + skey, &keyparms->key[16], 8); memcpy(padapter->securitypriv. dot118021XGrprxmickey[param->u. crypt.idx]. - skey, ¶m->u.crypt.key[24], - 8); + skey, &keyparms->key[24], 8); padapter->securitypriv.binstallGrpkey = 1; DBG_8723A -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/43] staging: rtl8723au: Remove unused RSN_VERSION_BSD23A
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ieee80211.c | 1 - drivers/staging/rtl8723au/include/ieee80211.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index 1f28cca..78a7b27 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -33,7 +33,6 @@ u8 WPA_CIPHER_SUITE_WRAP23A[] = { 0x00, 0x50, 0xf2, 3 }; u8 WPA_CIPHER_SUITE_CCMP23A[] = { 0x00, 0x50, 0xf2, 4 }; u8 WPA_CIPHER_SUITE_WEP10423A[] = { 0x00, 0x50, 0xf2, 5 }; -u16 RSN_VERSION_BSD23A = 1; u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X23A[] = { 0x00, 0x0f, 0xac, 1 }; u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X23A[] = { 0x00, 0x0f, 0xac, 2 }; u8 RSN_CIPHER_SUITE_NONE23A[] = { 0x00, 0x0f, 0xac, 0 }; diff --git a/drivers/staging/rtl8723au/include/ieee80211.h b/drivers/staging/rtl8723au/include/ieee80211.h index 89c23ae..0b17a7f 100644 --- a/drivers/staging/rtl8723au/include/ieee80211.h +++ b/drivers/staging/rtl8723au/include/ieee80211.h @@ -79,7 +79,6 @@ extern u8 WPA_CIPHER_SUITE_WEP10423A[]; #define RSN_HEADER_LEN 4 #define RSN_SELECTOR_LEN 4 -extern u16 RSN_VERSION_BSD23A; extern u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X23A[]; extern u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X23A[]; extern u8 RSN_CIPHER_SUITE_NONE23A[]; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/43] staging: rtl8723au: rtw_cfg80211_set_encryption(): Pass additional struct key_params
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index c0b0cb1..7c3a58f 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -802,7 +802,8 @@ exit: #endif static int rtw_cfg80211_set_encryption(struct net_device *dev, - struct ieee_param *param, u32 param_len) + struct ieee_param *param, u32 param_len, + struct key_params *keyparms) { int ret = 0; u32 wep_key_idx; @@ -1067,7 +1068,8 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { - ret = rtw_cfg80211_set_encryption(ndev, param, param_len); + ret = rtw_cfg80211_set_encryption(ndev, param, param_len, + params); } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { #ifdef CONFIG_8723AU_AP_MODE if (mac_addr) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 38/43] staging: rtl8723au: Validate keys in cfg80211_rtw_add_key()
From: Jes Sorensen We validate the parameters in cfg80211_rtw_add_key() so no need to do it all again in rtw_cfg80211_{ap_}set_encryption() Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 76 ++- 1 file changed, 19 insertions(+), 57 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index f53189a..87f953c 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -512,23 +512,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("%s\n", __func__); - if (is_broadcast_ether_addr(sta_addr)) { - if (key_index >= WEP_KEYS) { - ret = -EINVAL; - goto exit; - } - switch (keyparms->cipher) { - case WLAN_CIPHER_SUITE_WEP40: - case WLAN_CIPHER_SUITE_WEP104: - case WLAN_CIPHER_SUITE_TKIP: - case WLAN_CIPHER_SUITE_CCMP: - break; - default: - ret = -EINVAL; - goto exit; - } - - } else { + if (!is_broadcast_ether_addr(sta_addr)) { psta = rtw_get_stainfo23a(pstapriv, sta_addr); if (!psta) { /* ret = -EINVAL; */ @@ -547,15 +531,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("r871x_set_encryption, wep_key_idx =%d, len =%d\n", key_index, key_len); - if (key_index >= WEP_KEYS || key_len <= 0) { - ret = -EINVAL; - goto exit; - } - - if (key_len > 0) { - key_len = key_len <= 5 ? 5 : 13; - } - if (psecuritypriv->bWepDefaultKeyIdxSet == 0) { /* wep default key has not been set, so use this key index as default key. */ @@ -586,8 +561,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, - keyparms->key, - (key_len > 16 ? 16 : key_len)); + keyparms->key, key_len); psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher; @@ -628,8 +602,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("%s, set group_key, none\n", __func__); - psecuritypriv->dot118021XGrpPrivacy = - 0; + psecuritypriv->dot118021XGrpPrivacy = 0; } psecuritypriv->dot118021XGrpKeyid = key_index; @@ -709,8 +682,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, - keyparms->key, - (key_len > 16 ? 16 : key_len)); + keyparms->key, key_len); psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher; @@ -732,7 +704,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, &keyparms->key[24], 8); psecuritypriv->busetkipkey = 1; - } else if (keyparms->cipher == WLAN_CIPHER_SUITE_CCMP) { psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_CCMP; @@ -787,42 +758,20 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, key_len = keyparms->key_len; - if (is_broadcast_ether_addr(sta_addr)) { - if (key_index >= WEP_KEYS) { - ret = -EINVAL; - goto exit; - } - } else { - ret = -EINVAL; - goto exit; - } - if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("wpa_set_encryption, crypt.alg = WEP\n")); DBG_8723A("wpa_set_encr
[PATCH 36/43] staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Stop passing ieee_parms argument
From: Jes Sorensen struct ieee_parms is obsolete, so stop passing it on. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 0cbf255..f53189a 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -501,8 +501,6 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, int set_tx, const u8 *sta_addr, - struct ieee_param *param, - u32 param_len, struct key_params *keyparms) { int ret = 0; @@ -777,7 +775,6 @@ exit: static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, int set_tx, const u8 *sta_addr, - struct ieee_param *param, u32 param_len, struct key_params *keyparms) { int ret = 0; @@ -953,8 +950,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool pairwise, const u8 *mac_addr, struct key_params *params) { - u32 param_len; - struct ieee_param *param; int set_tx, ret = 0; struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); @@ -981,12 +976,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, goto exit; } - param_len = sizeof(struct ieee_param) + params->key_len; - param = kzalloc(param_len, GFP_KERNEL); - if (!param) - return -ENOMEM; - - param->cmd = IEEE_CMD_SET_ENCRYPTION; eth_broadcast_addr(sta_addr); if (!mac_addr || is_broadcast_ether_addr(mac_addr)) @@ -996,16 +985,14 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { ret = rtw_cfg80211_set_encryption(ndev, key_index, set_tx, - sta_addr, - param, param_len, params); + sta_addr, params); } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { #ifdef CONFIG_8723AU_AP_MODE if (mac_addr) ether_addr_copy(sta_addr, mac_addr); ret = rtw_cfg80211_ap_set_encryption(ndev, key_index, set_tx, -sta_addr, -param, param_len, params); +sta_addr, params); #endif } else { DBG_8723A("error! fw_state = 0x%x, iftype =%d\n", @@ -1013,8 +1000,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } - kfree(param); - exit: return ret; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/43] staging: rtl8723au: Remove unused #define EID_BSSIntolerantChlReport
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/include/wifi.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index 23026e9..b82b0d0 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -23,8 +23,6 @@ */ #defineWiFiNavUpperUs 3 /* 30 ms */ -#defineEID_BSSIntolerantChlReport 73 - /*- Below is the definition for 802.11n --*/ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/43] staging: rtl8723au: issue_beacon23a(): Determine ie buffer location using 80211_mgmt
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index cb882fb..ebd3743 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -2430,11 +2430,9 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms) pframe += (cur_network->IELength+len_diff); pattrib->pktlen += (cur_network->IELength+len_diff); - iebuf = pmgntframe->buf_addr + TXDESC_OFFSET + - sizeof (struct ieee80211_hdr_3addr) + - _BEACON_IE_OFFSET_; - buflen = pattrib->pktlen - sizeof (struct ieee80211_hdr_3addr) - - _BEACON_IE_OFFSET_; + iebuf = mgmt->u.beacon.variable; + buflen = pattrib->pktlen - + offsetof(struct ieee80211_mgmt, u.beacon.variable); wps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSOFT_WPS, iebuf, buflen); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/43] staging: rtl8723au: Get rid of obsolete _FIXED_IE_LENGTH_ + _BEACON_IE_OFFSET
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ap.c | 68 +++ drivers/staging/rtl8723au/core/rtw_mlme.c | 19 ++- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 41 +- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 7 +-- drivers/staging/rtl8723au/include/wifi.h | 5 -- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 +-- 6 files changed, 58 insertions(+), 89 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 5c30f7b..ab9a66e 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -77,8 +77,8 @@ static void update_BCNTIM(struct rtw_adapter *padapter) tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap); - p = rtw_get_ie23a(pie + _FIXED_IE_LENGTH_, WLAN_EID_TIM, &tim_ielen, - pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); + p = rtw_get_ie23a(pie, WLAN_EID_TIM, &tim_ielen, + pnetwork_mlmeext->IELength); if (p != NULL && tim_ielen>0) { tim_ielen += 2; @@ -94,19 +94,17 @@ static void update_BCNTIM(struct rtw_adapter *padapter) tim_ielen = 0; /* calulate head_len */ - offset = _FIXED_IE_LENGTH_; + offset = 0; /* get ssid_ie len */ - p = rtw_get_ie23a(pie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, - &tmp_len, (pnetwork_mlmeext->IELength - -_BEACON_IE_OFFSET_)); + p = rtw_get_ie23a(pie, WLAN_EID_SSID, + &tmp_len, pnetwork_mlmeext->IELength); if (p != NULL) offset += tmp_len+2; /* get supported rates len */ - p = rtw_get_ie23a(pie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, - &tmp_len, (pnetwork_mlmeext->IELength - -_BEACON_IE_OFFSET_)); + p = rtw_get_ie23a(pie, WLAN_EID_SUPP_RATES, + &tmp_len, pnetwork_mlmeext->IELength); if (p != NULL) offset += tmp_len+2; @@ -663,9 +661,8 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) /* and at first time the security ie (RSN/WPA IE) will not include in beacon. */ if (NULL == cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSOFT_WPS, - pnetwork->IEs + _FIXED_IE_LENGTH_, - pnetwork->IELength - - _FIXED_IE_LENGTH_)) + pnetwork->IEs, + pnetwork->IELength)) pmlmeext->bstart_bss = true; /* todo: update wmm, ht cap */ @@ -804,9 +801,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_bssid_ex *pbss_network = &pmlmepriv->cur_network.network; u8 *ie = pbss_network->IEs; - u8 *pbuf = mgmt->u.beacon.variable - _FIXED_IE_LENGTH_; - len -= (offsetof(struct ieee80211_mgmt, u.beacon.variable) - - _FIXED_IE_LENGTH_); + u8 *pbuf = mgmt->u.beacon.variable; + len -= offsetof(struct ieee80211_mgmt, u.beacon.variable); /* SSID */ /* Supported rates */ /* DS Params */ @@ -841,8 +837,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN); /* SSID */ - p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &ie_len, - (pbss_network->IELength -_BEACON_IE_OFFSET_)); + p = rtw_get_ie23a(ie, WLAN_EID_SSID, &ie_len, pbss_network->IELength); if (p && ie_len > 0) { memset(&pbss_network->Ssid, 0, sizeof(struct cfg80211_ssid)); memcpy(pbss_network->Ssid.ssid, (p + 2), ie_len); @@ -851,8 +846,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, /* chnnel */ channel = 0; - p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &ie_len, - (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie23a(ie, WLAN_EID_DS_PARAMS, &ie_len, + pbss_network->IELength); if (p && ie_len > 0) channel = *(p + 2); @@ -860,16 +855,16 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); /* get supported rates */ - p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &ie_len, -
[PATCH 24/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use keyparms->cipher to set WEP size
From: Jes Sorensen We already know which type of WEP we are using when we get here, no point trying to determine it from key_len. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 32 +-- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index ac13df1..c0b0cb1 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -577,13 +577,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40; - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - - if (key_len == 13) { - psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104; - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; - } + psecuritypriv->dot11PrivacyAlgrthm = keyparms->cipher; + psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher; psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; } @@ -596,7 +591,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, set_wep_key(padapter, keyparms->key, key_len, wep_key_idx); goto exit; - } if (!psta) {/* group key */ @@ -610,12 +604,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, skey, keyparms->key, (key_len > 16 ? 16 : key_len)); - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } - + psecuritypriv->dot118021XGrpPrivacy = + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set group_key, TKIP\n", __func__); @@ -698,12 +688,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, DBG_8723A("%s, set pairwise key, WEP\n", __func__); - psta->dot118021XPrivacy = - WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psta->dot118021XPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } + psecuritypriv->dot118021XGrpPrivacy = + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set pairwise key, TKIP\n", __func__); @@ -748,11 +734,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, (key_len > 16 ? 16 : key_len)); psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP40; - if (key_len == 13) { - psecuritypriv->dot118021XGrpPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } + keyparms->cipher; } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_TKIP; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use key len from struct key_params
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 55 ++- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index bbc4ac5..0925d56 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -417,7 +417,7 @@ exit: return res; } -static int set_group_key(struct rtw_adapter *padapter, u8 *key, u32 alg, +static int set_group_key(struct rtw_adapter *padapter, const u8 *key, u32 alg, u8 keyid) { u8 keylen; @@ -480,7 +480,7 @@ exit: return res; } -static int set_wep_key(struct rtw_adapter *padapter, u8 *key, u16 keylen, +static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, u8 keyid) { u32 alg; @@ -505,7 +505,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct key_params *keyparms) { int ret = 0; - u16 wep_key_len; + int key_len; u8 wep_key_idx; struct sta_info *psta = NULL, *pbcmc_sta = NULL; struct rtw_adapter *padapter = netdev_priv(dev); @@ -549,23 +549,24 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, goto exit; } + key_len = keyparms->key_len; + if (!psta && (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104)) { DBG_8723A("r871x_set_encryption, crypt.alg = WEP\n"); wep_key_idx = param->u.crypt.idx; - wep_key_len = param->u.crypt.key_len; DBG_8723A("r871x_set_encryption, wep_key_idx =%d, len =%d\n", - wep_key_idx, wep_key_len); + wep_key_idx, key_len); - if ((wep_key_idx >= WEP_KEYS) || (wep_key_len <= 0)) { + if (wep_key_idx >= WEP_KEYS || key_len <= 0) { ret = -EINVAL; goto exit; } - if (wep_key_len > 0) { - wep_key_len = wep_key_len <= 5 ? 5 : 13; + if (key_len > 0) { + key_len = key_len <= 5 ? 5 : 13; } if (psecuritypriv->bWepDefaultKeyIdxSet == 0) { @@ -577,7 +578,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (wep_key_len == 13) { + if (key_len == 13) { psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; } @@ -586,12 +587,11 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, } memcpy(&psecuritypriv->wep_key[wep_key_idx].key, - param->u.crypt.key, wep_key_len); + keyparms->key, key_len); - psecuritypriv->wep_key[wep_key_idx].keylen = wep_key_len; + psecuritypriv->wep_key[wep_key_idx].keylen = key_len; - set_wep_key(padapter, param->u.crypt.key, wep_key_len, - wep_key_idx); + set_wep_key(padapter, keyparms->key, key_len, wep_key_idx); goto exit; @@ -605,12 +605,11 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, memcpy(psecuritypriv-> dot118021XGrpKey[param->u.crypt.idx]. - skey, param->u.crypt.key, - (param->u.crypt.key_len > - 16 ? 16 : param->u.crypt.key_len)); + skey, keyparms->key, + (key_len > 16 ? 16 : key_len)); psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (param->u.crypt.key_len == 13) { + if (key_len == 13) { psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; } @@ -625,8 +624,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, memcpy(psecuritypriv-> dot118021XGrpKey[param->u.crypt.idx]. skey, param->u.crypt.key, -
[PATCH 21/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption() is only called for WIFI_AP_STATE
From: Jes Sorensen No point checking it again in here, twice! Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 237 ++ 1 file changed, 110 insertions(+), 127 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index f44d0f4..bbc4ac5 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -509,7 +509,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 wep_key_idx; struct sta_info *psta = NULL, *pbcmc_sta = NULL; struct rtw_adapter *padapter = netdev_priv(dev); - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct sta_priv *pstapriv = &padapter->stapriv; @@ -598,7 +597,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, } - if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ + if (!psta) {/* group key */ if (param->u.crypt.set_tx == 0) { /* group key */ if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { @@ -620,7 +619,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, DBG_8723A("%s, set group_key, TKIP\n", __func__); - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_TKIP; + psecuritypriv->dot118021XGrpPrivacy = + WLAN_CIPHER_SUITE_TKIP; memcpy(psecuritypriv-> dot118021XGrpKey[param->u.crypt.idx]. @@ -645,7 +645,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, DBG_8723A("%s, set group_key, CCMP\n", __func__); - psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_CCMP; + psecuritypriv->dot118021XGrpPrivacy = + WLAN_CIPHER_SUITE_CCMP; memcpy(psecuritypriv-> dot118021XGrpKey[param->u.crypt.idx]. @@ -685,151 +686,134 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, goto exit; } - if (psecuritypriv->dot11AuthAlgrthm == - dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { - if (param->u.crypt.set_tx == 1) { - /* pairwise key */ - memcpy(psta->dot118021x_UncstKey.skey, - param->u.crypt.key, - (param->u.crypt.key_len > - 16 ? 16 : param->u.crypt.key_len)); + if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { + /* psk/802_1x */ + if (param->u.crypt.set_tx == 1) { + /* pairwise key */ + memcpy(psta->dot118021x_UncstKey.skey, + param->u.crypt.key, + (param->u.crypt.key_len > + 16 ? 16 : param->u.crypt.key_len)); - if (keyparms->cipher == - WLAN_CIPHER_SUITE_WEP40 || - keyparms->cipher == - WLAN_CIPHER_SUITE_WEP104) { - DBG_8723A("%s, set pairwise key, WEP\n", - __func__); - - psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (param->u.crypt.key_len == 13) { - psta->dot118021XPrivacy = - WLAN_CIPHER_SUITE_WEP104; - } - } else if (keyparms->cipher == - WLAN_CIPHER_SUITE_TKIP) { - DBG_8723A("%s, set pairwise key, " - "TKIP\n", __func__); + if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || + keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { + DBG_8723A("%s, set pairwise key, WEP\n", + __func__); + psta->dot118021X
[PATCH 23/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Stop using param->u.crypt.alg
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 0925d56..ac13df1 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -530,6 +530,17 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ret = -EINVAL; goto exit; } + switch (keyparms->cipher) { + case WLAN_CIPHER_SUITE_WEP40: + case WLAN_CIPHER_SUITE_WEP104: + case WLAN_CIPHER_SUITE_TKIP: + case WLAN_CIPHER_SUITE_CCMP: + break; + default: + ret = -EINVAL; + goto exit; + } + } else { psta = rtw_get_stainfo23a(pstapriv, param->sta_addr); if (!psta) { @@ -540,15 +551,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, } } - if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL)) { - /* todo:clear default encryption keys */ - - DBG_8723A("clear default encryption keys, keyid =%d\n", - param->u.crypt.idx); - - goto exit; - } - key_len = keyparms->key_len; if (!psta && (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use key_params->cipher to determine encryption
From: Jes Sorensen Passing strings around for something we have defines for is just silly. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 47 +++ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 5e8f7b3..f44d0f4 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -501,7 +501,8 @@ static int set_wep_key(struct rtw_adapter *padapter, u8 *key, u16 keylen, static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_param *param, - u32 param_len) + u32 param_len, + struct key_params *keyparms) { int ret = 0; u16 wep_key_len; @@ -549,7 +550,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, goto exit; } - if (strcmp(param->u.crypt.alg, "WEP") == 0 && (psta == NULL)) { + if (!psta && (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || + keyparms->cipher == WLAN_CIPHER_SUITE_WEP104)) { DBG_8723A("r871x_set_encryption, crypt.alg = WEP\n"); wep_key_idx = param->u.crypt.idx; @@ -598,7 +600,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ if (param->u.crypt.set_tx == 0) { /* group key */ - if (strcmp(param->u.crypt.alg, "WEP") == 0) { + if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || + keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { DBG_8723A("%s, set group_key, WEP\n", __func__); memcpy(psecuritypriv-> @@ -613,7 +616,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, WLAN_CIPHER_SUITE_WEP104; } - } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { + } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set group_key, TKIP\n", __func__); @@ -638,8 +641,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psecuritypriv->busetkipkey = 1; - } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { - DBG_8723A("%s, set group_key, CCMP\n", + } else if (keyparms->cipher == WLAN_CIPHER_SUITE_CCMP) { + DBG_8723A("%s, set group_key, CCMP\n", __func__); psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_CCMP; @@ -692,7 +695,10 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); - if (!strcmp(param->u.crypt.alg, "WEP")) { + if (keyparms->cipher == + WLAN_CIPHER_SUITE_WEP40 || + keyparms->cipher == + WLAN_CIPHER_SUITE_WEP104) { DBG_8723A("%s, set pairwise key, WEP\n", __func__); @@ -701,11 +707,13 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_WEP104; } - } else if (!strcmp(param->u.crypt.alg, "TKIP")) { + } else if (keyparms->cipher == + WLAN_CIPHER_SUITE_TKIP) { DBG_8723A("%s, set pairwise key, " "TKIP\n", __func__); - psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_TKIP; + psta->dot118021XPrivacy = + WLAN_CIPHER_SUITE_TKIP; /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ @@ -716,12 +724,13 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
[PATCH 07/43] staging: rtl8723au: Use _FIXED_IE_LEN_ instead of hard coded value
From: Jes Sorensen This should help catching all the users once we stop carrying the fixed beacon elements in the IE array. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme.c | 14 -- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b7a3528..66f24dc 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1929,7 +1929,7 @@ int rtw_restruct_wmm_ie23a(struct rtw_adapter *adapter, u8 *in_ie, unsigned int ielength = 0; unsigned int i, j; - i = 12; /* after the fixed IE */ + i = _FIXED_IE_LENGTH_; /* after the fixed IE */ while (i < in_len) { ielength = initial_out_len; @@ -2039,8 +2039,8 @@ int rtw_restruct_sec_ie23a(struct rtw_adapter *adapter, u8 *in_ie, u8 *out_ie, "ndissecuritytype=%d\n", ndisauthmode, ndissecuritytype)); /* copy fixed ie only */ - memcpy(out_ie, in_ie, 12); - ielength = 12; + memcpy(out_ie, in_ie, _FIXED_IE_LENGTH_); + ielength = _FIXED_IE_LENGTH_; if (ndisauthmode == Ndis802_11AuthModeWPA || ndisauthmode == Ndis802_11AuthModeWPAPSK) authmode = WLAN_EID_VENDOR_SPECIFIC; @@ -2171,7 +2171,8 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie, phtpriv->ht_option = false; - p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie + 12, in_len -12); + p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie + _FIXED_IE_LENGTH_, +in_len - _FIXED_IE_LENGTH_); if (p && p[1] > 0) { u32 rx_packet_offset, max_recvbuf_sz; @@ -2216,8 +2217,9 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie, phtpriv->ht_option = true; - p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, in_ie + 12, -in_len -12); + p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, +in_ie + _FIXED_IE_LENGTH_, +in_len - _FIXED_IE_LENGTH_); if (p && (p[1] == sizeof(struct ieee80211_ht_operation))) { out_len = *pout_len; pframe = rtw_set_ie23a(out_ie + out_len, diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 03ced01..6791ad7 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4254,7 +4254,7 @@ static struct wlan_bssid_ex *collect_bss_info(struct rtw_adapter *padapter, memcpy(bssid->SupportedRates + i, p + 2, p[1]); } - if (bssid->IELength < 12) + if (bssid->IELength < _FIXED_IE_LENGTH_) goto fail; /* Checking for DSConfig */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/43] staging: rtl8723au: rtw_cfg80211_set_encryption(): Obtain key_len from struct key_params
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 28 +-- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 7c3a58f..5ea0fa1 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -807,7 +807,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, { int ret = 0; u32 wep_key_idx; - u16 wep_key_len; + int key_len; struct rtw_adapter *padapter = netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; @@ -817,9 +817,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, param->u.crypt.err = 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; + key_len = keyparms->key_len; + if (param_len < - (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + - param->u.crypt.key_len) { + (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + key_len) { ret = -EINVAL; goto exit; } @@ -840,9 +841,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, DBG_8723A("wpa_set_encryption, crypt.alg = WEP\n"); wep_key_idx = param->u.crypt.idx; - wep_key_len = param->u.crypt.key_len; - if ((wep_key_idx > WEP_KEYS) || (wep_key_len <= 0)) { + if (wep_key_idx > WEP_KEYS || key_len <= 0) { ret = -EINVAL; goto exit; } @@ -851,14 +851,14 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, /* wep default key has not been set, so use this key index as default key. */ - wep_key_len = wep_key_len <= 5 ? 5 : 13; + key_len = key_len <= 5 ? 5 : 13; psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; - if (wep_key_len == 13) { + if (key_len == 13) { psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104; } @@ -867,9 +867,9 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, } memcpy(&psecuritypriv->wep_key[wep_key_idx].key, - param->u.crypt.key, wep_key_len); + param->u.crypt.key, key_len); - psecuritypriv->wep_key[wep_key_idx].keylen = wep_key_len; + psecuritypriv->wep_key[wep_key_idx].keylen = key_len; rtw_set_key23a(padapter, psecuritypriv, wep_key_idx, 0); @@ -910,9 +910,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, - (param->u.crypt.key_len > - 16 ? 16 : param->u.crypt. - key_len)); + (key_len > 16 ? 16 : key_len)); if (strcmp(param->u.crypt.alg, "TKIP") == 0) { @@ -938,9 +936,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, dot118021XGrpKey[param->u.crypt. idx].skey, param->u.crypt.key, - (param->u.crypt.key_len > - 16 ? 16 : param->u.crypt. - key_len)); + (key_len > 16 ? 16 : key_len)); memcpy(padapter->securitypriv. dot118021XGrptxmickey[param->u. crypt.idx]. @@ -953,8 +949,6 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, 8); padapter->securitypriv.binstallGrpkey = 1; -
[PATCH 17/43] staging: rtl8723au: Remove unused #define P80211CAPTURE_VERSION
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/include/wifi.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index b82b0d0..fd3da3b 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -15,8 +15,6 @@ #ifndef _WIFI_H_ #define _WIFI_H_ -#define P80211CAPTURE_VERSION 0x80211001 - /* This value is tested by WiFi 11n Test Plan 5.2.3. * This test verifies the WLAN NIC can update the NAV through sending * the CTS with large duration. -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 37/43] staging: rtl8723au: Remove obsolete struct ieee_parm
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/include/ieee80211.h | 50 --- 1 file changed, 50 deletions(-) diff --git a/drivers/staging/rtl8723au/include/ieee80211.h b/drivers/staging/rtl8723au/include/ieee80211.h index 0b17a7f..e9f465f 100644 --- a/drivers/staging/rtl8723au/include/ieee80211.h +++ b/drivers/staging/rtl8723au/include/ieee80211.h @@ -48,12 +48,6 @@ #endif -#define IEEE_CMD_SET_WPA_PARAM 1 -#define IEEE_CMD_SET_WPA_IE2 -#define IEEE_CMD_SET_ENCRYPTION3 - -#defineIEEE_CRYPT_ALG_NAME_LEN 16 - #define WPA_CIPHER_NONEBIT(0) #define WPA_CIPHER_WEP40 BIT(1) #define WPA_CIPHER_WEP104 BIT(2) @@ -151,50 +145,6 @@ enum NETWORK_TYPE #define IsSupportedTxMCS(NetType) (NetType & (WIRELESS_11_24N|WIRELESS_11_5N) ? true : false) -struct ieee_param { - u32 cmd; - u8 sta_addr[ETH_ALEN]; - union { - struct { - u8 name; - u32 value; - } wpa_param; - struct { - u32 len; - u8 reserved[32]; - u8 data[0]; - } wpa_ie; - struct{ - int command; - int reason_code; - } mlme; - struct { - u8 alg[IEEE_CRYPT_ALG_NAME_LEN]; - u8 set_tx; - u32 err; - u8 idx; - u8 seq[8]; /* sequence counter (set: RX, get: TX) */ - u16 key_len; - u8 key[0]; - } crypt; -#ifdef CONFIG_8723AU_AP_MODE - struct { - u16 aid; - u16 capability; - int flags; - u8 tx_supp_rates[16]; - struct ieee80211_ht_cap ht_cap; - } add_sta; - struct { - u8 reserved[2];/* for set max_num_sta */ - u8 buf[0]; - } bcn_ie; -#endif - - } u; -}; - - #define MIN_FRAG_THRESHOLD 256U #defineMAX_FRAG_THRESHOLD 2346U -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 43/43] staging: rtl8723au: OnAssocReq23a(): Use cfg80211_find_vendor_ie() to locate VMM
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 62 +-- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 88cf1fd..09e5a59 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -1327,7 +1327,6 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) u16 capab_info, listen_interval; struct sta_info *pstat; unsigned char reassoc; - unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01}; int i, wpa_ie_len, left; unsigned char supportRate[16]; int supportRateNum; @@ -1577,47 +1576,46 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) for (;;) { left = end - p; - p = cfg80211_find_ie(WLAN_EID_VENDOR_SPECIFIC, p, left); + p = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, + WLAN_OUI_TYPE_MICROSOFT_WMM, + p, left); if (p) { - if (!memcmp(p + 2, WMM_IE, 6)) { - pstat->flags |= WLAN_STA_WME; + pstat->flags |= WLAN_STA_WME; - pstat->qos_option = 1; - pstat->qos_info = *(p + 8); + pstat->qos_option = 1; + pstat->qos_info = *(p + 8); - pstat->max_sp_len = - (pstat->qos_info >> 5) & 0x3; + pstat->max_sp_len = + (pstat->qos_info >> 5) & 0x3; - if ((pstat->qos_info & 0xf) != 0xf) - pstat->has_legacy_ac = true; - else - pstat->has_legacy_ac = false; - - if (pstat->qos_info & 0xf) { - if (pstat->qos_info & BIT(0)) - pstat->uapsd_vo = BIT(0)|BIT(1); - else - pstat->uapsd_vo = 0; + if ((pstat->qos_info & 0xf) != 0xf) + pstat->has_legacy_ac = true; + else + pstat->has_legacy_ac = false; - if (pstat->qos_info & BIT(1)) - pstat->uapsd_vi = BIT(0)|BIT(1); - else - pstat->uapsd_vi = 0; + if (pstat->qos_info & 0xf) { + if (pstat->qos_info & BIT(0)) + pstat->uapsd_vo = BIT(0)|BIT(1); + else + pstat->uapsd_vo = 0; - if (pstat->qos_info & BIT(2)) - pstat->uapsd_bk = BIT(0)|BIT(1); - else - pstat->uapsd_bk = 0; + if (pstat->qos_info & BIT(1)) + pstat->uapsd_vi = BIT(0)|BIT(1); + else + pstat->uapsd_vi = 0; - if (pstat->qos_info & BIT(3)) - pstat->uapsd_be = BIT(0)|BIT(1); - else - pstat->uapsd_be = 0; + if (pstat->qos_info & BIT(2)) + pstat->uapsd_bk = BIT(0)|BIT(1); + else + pstat->uapsd_bk = 0; - } + if (pstat->qos_info & BIT(3)) + pstat->uapsd_be = BIT(0)|BIT(1); + else + pstat->uapsd_be = 0; -
[PATCH 32/43] staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Add set_tx argument
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index f676ec6..624966e 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -500,6 +500,7 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, } static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, + int set_tx, struct ieee_param *param, u32 param_len, struct key_params *keyparms) @@ -591,7 +592,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, } if (!psta) {/* group key */ - if (param->u.crypt.set_tx == 0) { /* group key */ + if (set_tx == 0) { /* group key */ if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { DBG_8723A("%s, set group_key, WEP\n", __func__); @@ -672,7 +673,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ - if (param->u.crypt.set_tx == 1) { + if (set_tx == 1) { /* pairwise key */ memcpy(psta->dot118021x_UncstKey.skey, keyparms->key, (key_len > 16 ? 16 : key_len)); @@ -791,6 +792,7 @@ exit: #endif static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, + int set_tx, struct ieee_param *param, u32 param_len, struct key_params *keyparms) { @@ -890,10 +892,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, dot11PrivacyAlgrthm; } - if (param->u.crypt.set_tx == 1) { + if (set_tx == 1) { /* pairwise key */ - DBG_8723A("%s, : param->u.crypt.set_tx" - " == 1\n", __func__); + DBG_8723A("%s, : set_tx == 1\n", + __func__); memcpy(psta->dot118021x_UncstKey.skey, keyparms->key, @@ -977,7 +979,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, char *alg_name; u32 param_len; struct ieee_param *param; - int ret = 0; + int set_tx, ret = 0; struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1022,11 +1024,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); - if (!mac_addr || is_broadcast_ether_addr(mac_addr)) { - param->u.crypt.set_tx = 0; /* for wpa/wpa2 group key */ - } else { - param->u.crypt.set_tx = 1; /* for wpa/wpa2 pairwise key */ - } + if (!mac_addr || is_broadcast_ether_addr(mac_addr)) + set_tx = 0; /* for wpa/wpa2 group key */ + else + set_tx = 1; /* for wpa/wpa2 pairwise key */ /* param->u.crypt.idx = key_index - 1; */ param->u.crypt.idx = key_index; @@ -1041,15 +1042,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { - ret = rtw_cfg80211_set_encryption(ndev, key_index, param, - param_len, params); + ret = rtw_cfg80211_set_encryption(ndev, key_index, set_tx, + param, param_len, params); } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { #ifdef CONFIG_8723AU_AP_MODE if (mac_addr) ether_addr_copy(param->sta_addr, mac_addr); - ret = rtw_cfg80211_ap_set_encryption(ndev, key_index, param, -param_len, params); + ret = rtw_cfg80211_ap_se
[PATCH 35/43] staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Add sta_addr argument
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 7e34f89..0cbf255 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -500,7 +500,7 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, } static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, - int set_tx, + int set_tx, const u8 *sta_addr, struct ieee_param *param, u32 param_len, struct key_params *keyparms) @@ -514,7 +514,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("%s\n", __func__); - if (is_broadcast_ether_addr(param->sta_addr)) { + if (is_broadcast_ether_addr(sta_addr)) { if (key_index >= WEP_KEYS) { ret = -EINVAL; goto exit; @@ -531,7 +531,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, } } else { - psta = rtw_get_stainfo23a(pstapriv, param->sta_addr); + psta = rtw_get_stainfo23a(pstapriv, sta_addr); if (!psta) { /* ret = -EINVAL; */ DBG_8723A("rtw_set_encryption(), sta has already " @@ -776,7 +776,7 @@ exit: #endif static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, - int set_tx, + int set_tx, const u8 *sta_addr, struct ieee_param *param, u32 param_len, struct key_params *keyparms) { @@ -790,7 +790,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, key_len = keyparms->key_len; - if (is_broadcast_ether_addr(param->sta_addr)) { + if (is_broadcast_ether_addr(sta_addr)) { if (key_index >= WEP_KEYS) { ret = -EINVAL; goto exit; @@ -959,6 +959,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u8 sta_addr[ETH_ALEN]; DBG_8723A("%s(%s): adding key for %pM\n", __func__, ndev->name, mac_addr); @@ -986,7 +987,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, return -ENOMEM; param->cmd = IEEE_CMD_SET_ENCRYPTION; - eth_broadcast_addr(param->sta_addr); + eth_broadcast_addr(sta_addr); if (!mac_addr || is_broadcast_ether_addr(mac_addr)) set_tx = 0; /* for wpa/wpa2 group key */ @@ -995,13 +996,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { ret = rtw_cfg80211_set_encryption(ndev, key_index, set_tx, + sta_addr, param, param_len, params); } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { #ifdef CONFIG_8723AU_AP_MODE if (mac_addr) - ether_addr_copy(param->sta_addr, mac_addr); + ether_addr_copy(sta_addr, mac_addr); ret = rtw_cfg80211_ap_set_encryption(ndev, key_index, set_tx, +sta_addr, param, param_len, params); #endif } else { -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/43] staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): No more string parsing to determine cipher
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 37 --- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 7aaa3f8..7e34f89 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -855,7 +855,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, } else { /* Jeff: don't disable ieee8021x_blocked while clearing key */ - if (strcmp(param->u.crypt.alg, "none") != 0) + if (keyparms->cipher != IW_AUTH_CIPHER_NONE && + keyparms->cipher != 0) psta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == @@ -922,7 +923,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, if (pbcmc_sta) { /* Jeff: don't disable ieee8021x_blocked while clearing key */ - if (strcmp(param->u.crypt.alg, "none") != 0) + if (keyparms->cipher != IW_AUTH_CIPHER_NONE && + keyparms->cipher != 0) pbcmc_sta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == @@ -951,7 +953,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool pairwise, const u8 *mac_addr, struct key_params *params) { - char *alg_name; u32 param_len; struct ieee_param *param; int set_tx, ret = 0; @@ -967,37 +968,25 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, DBG_8723A("key_index =%d\n", key_index); DBG_8723A("pairwise =%d\n", pairwise); - param_len = sizeof(struct ieee_param) + params->key_len; - param = kzalloc(param_len, GFP_KERNEL); - if (!param) - return -ENOMEM; - - param->cmd = IEEE_CMD_SET_ENCRYPTION; - eth_broadcast_addr(param->sta_addr); - switch (params->cipher) { case IW_AUTH_CIPHER_NONE: - /* todo: remove key */ - /* remove = 1; */ - alg_name = "none"; - break; case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: - alg_name = "WEP"; - break; case WLAN_CIPHER_SUITE_TKIP: - alg_name = "TKIP"; - break; case WLAN_CIPHER_SUITE_CCMP: - alg_name = "CCMP"; break; - default: ret = -ENOTSUPP; - goto addkey_end; + goto exit; } - strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); + param_len = sizeof(struct ieee_param) + params->key_len; + param = kzalloc(param_len, GFP_KERNEL); + if (!param) + return -ENOMEM; + + param->cmd = IEEE_CMD_SET_ENCRYPTION; + eth_broadcast_addr(param->sta_addr); if (!mac_addr || is_broadcast_ether_addr(mac_addr)) set_tx = 0; /* for wpa/wpa2 group key */ @@ -1021,9 +1010,9 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } -addkey_end: kfree(param); +exit: return ret; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/43] staging: rtl8723au: Eliminate set_wep_key() and call set_group_key() directly
From: Jes Sorensen This also eliminates another round of determine algorithm based on key length, followed by determine key length based on algorithm. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 45 +++ 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 87f953c..93dc844 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -417,10 +417,9 @@ exit: return res; } -static int set_group_key(struct rtw_adapter *padapter, const u8 *key, u32 alg, -u8 keyid) +static int set_group_key(struct rtw_adapter *padapter, struct key_params *parms, +u32 alg, u8 keyid) { - u8 keylen; struct cmd_obj *pcmd; struct setkey_parm *psetkeyparm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; @@ -453,20 +452,7 @@ static int set_group_key(struct rtw_adapter *padapter, const u8 *key, u32 alg, psetkeyparm->set_tx = 1; - switch (alg) { - case WLAN_CIPHER_SUITE_WEP40: - keylen = 5; - break; - case WLAN_CIPHER_SUITE_WEP104: - keylen = 13; - break; - case WLAN_CIPHER_SUITE_TKIP: - case WLAN_CIPHER_SUITE_CCMP: - default: - keylen = 16; - } - - memcpy(&psetkeyparm->key[0], key, keylen); + memcpy(&psetkeyparm->key, parms->key, parms->key_len); pcmd->cmdcode = _SetKey_CMD_; pcmd->parmbuf = (u8 *) psetkeyparm; @@ -480,25 +466,6 @@ exit: return res; } -static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, - u8 keyid) -{ - u32 alg; - - switch (keylen) { - case 5: - alg = WLAN_CIPHER_SUITE_WEP40; - break; - case 13: - alg = WLAN_CIPHER_SUITE_WEP104; - break; - default: - alg = 0; - } - - return set_group_key(padapter, key, alg, keyid); -} - static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, int set_tx, const u8 *sta_addr, struct key_params *keyparms) @@ -548,7 +515,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, psecuritypriv->wep_key[key_index].keylen = key_len; - set_wep_key(padapter, keyparms->key, key_len, key_index); + set_group_key(padapter, keyparms, keyparms->cipher, key_index); goto exit; } @@ -612,7 +579,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, psecuritypriv->dot11PrivacyAlgrthm = psecuritypriv->dot118021XGrpPrivacy; - set_group_key(padapter, keyparms->key, + set_group_key(padapter, keyparms, psecuritypriv->dot118021XGrpPrivacy, key_index); @@ -723,7 +690,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, psecuritypriv->dot11PrivacyAlgrthm = psecuritypriv->dot118021XGrpPrivacy; - set_group_key(padapter, keyparms->key, + set_group_key(padapter, keyparms, psecuritypriv->dot118021XGrpPrivacy, key_index); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/43] staging: rtl8723au: rtw_cfg80211_set_encryption(): Use key_params->cipher
From: Jes Sorensen Use key_params->cipher to determine WEP/TKIP Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 5ea0fa1..2e21223 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -835,7 +835,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, goto exit; } - if (strcmp(param->u.crypt.alg, "WEP") == 0) { + if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || + keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("wpa_set_encryption, crypt.alg = WEP\n")); DBG_8723A("wpa_set_encryption, crypt.alg = WEP\n"); @@ -912,8 +913,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, param->u.crypt.key, (key_len > 16 ? 16 : key_len)); - if (strcmp(param->u.crypt.alg, - "TKIP") == 0) { + if (keyparms->cipher == + WLAN_CIPHER_SUITE_TKIP) { memcpy(psta->dot11tkiptxmickey. skey, ¶m->u.crypt.key[16], -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 40/43] staging: rtl8723au: rtw_restruct_wmm_ie23a(): Use cfg80211_find_vendor_ie()
From: Jes Sorensen Rewrite rtw_restruct_wmm_ie23a() using cfg80211_find_vendor_ie() Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme.c | 34 --- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b3db56a..d0e9b66 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1909,33 +1909,25 @@ exit: /* adjust IEs for rtw_joinbss_cmd23a in WMM */ int rtw_restruct_wmm_ie23a(struct rtw_adapter *adapter, u8 *in_ie, - u8 *out_ie, uint in_len, uint initial_out_len) + u8 *out_ie, uint in_len, uint initial_out_len) { - unsigned int ielength = 0; - unsigned int i, j; + int ielength; + const u8 *p; - i = 0; /* after the fixed IE */ - while (i < in_len) { - ielength = initial_out_len; + ielength = initial_out_len; - /* WMM element ID and OUI */ - if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && - in_ie[i + 3] == 0x50 && in_ie[i + 4] == 0xF2 && - in_ie[i + 5] == 0x02 && i+5 < in_len) { + p = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, + WLAN_OUI_TYPE_MICROSOFT_WMM, + in_ie, in_len); - /* Append WMM IE to the last index of out_ie */ -for (j = i; j < i + 9; j++) { - out_ie[ielength] = in_ie[j]; - ielength++; -} -out_ie[initial_out_len + 1] = 0x07; -out_ie[initial_out_len + 6] = 0x00; -out_ie[initial_out_len + 8] = 0x00; + if (p && p[1]) { + memcpy(out_ie + initial_out_len, p, 9); - break; - } + out_ie[initial_out_len + 1] = 7; + out_ie[initial_out_len + 6] = 0; + out_ie[initial_out_len + 8] = 0; - i += (in_ie[i + 1] + 2); /* to the next IE element */ + ielength += 9; } return ielength; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/43] staging: rtl8723au: rtw_check_beacon_data23a(): Capability is already uptodate in cur_network
From: Jes Sorensen Beacon capability was already added to mlme_priv->cur_network before calling this function, so no need to retrieve it from the IE array again. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ap.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 08e933a..c19ed95 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -797,7 +797,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pHT_caps_ie = NULL; u8 *pHT_info_ie = NULL; struct sta_info *psta = NULL; - u16 cap, ht_cap = false; + u16 ht_cap = false; uint ie_len = 0; int group_cipher, pairwise_cipher; u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX]; @@ -844,9 +844,6 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN); - /* capability */ - cap = get_unaligned_le16(ie); - /* SSID */ p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &ie_len, (pbss_network->IELength -_BEACON_IE_OFFSET_)); @@ -894,7 +891,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, ERP_IE_handler23a(padapter, p); /* update privacy/security */ - if (cap & BIT(4)) + if (pbss_network->capability & BIT(4)) pbss_network->Privacy = 1; else pbss_network->Privacy = 0; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/43] staging: rtl8723au: Stop carrying half the beacon frame header in the stored IE array
From: Jes Sorensen This gets rid of the odd carrying of half the beacon frame in the IE array stored for the network. Instead we rely on the relevant fields (timestamp, beacon_interval, and capability) stored in struct wlan_bssid_ex. Carrying only half the ieee80211_mgmt header led to a number of bugs and simply obfuscated the code. I have tried catching all instances relying on these three elements in the IEs array, but missed cases may still need to be tracked down. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_ap.c| 8 +-- drivers/staging/rtl8723au/core/rtw_ieee80211.c | 41 +++-- drivers/staging/rtl8723au/core/rtw_mlme.c | 27 + drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 83 +++--- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 29 ++--- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 9 +-- drivers/staging/rtl8723au/include/wifi.h | 2 +- 7 files changed, 58 insertions(+), 141 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index c19ed95..5c30f7b 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -652,7 +652,6 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network; struct ieee80211_ht_operation *pht_info = NULL; - int bcn_fixed_size; bcn_interval = (u16)pnetwork->beacon_interval; cur_channel = pnetwork->DSConfig; @@ -728,12 +727,9 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) DYNAMIC_ALL_FUNC_ENABLE); } /* set channel, bwmode */ - bcn_fixed_size = offsetof(struct ieee80211_mgmt, u.beacon.variable) - - offsetof(struct ieee80211_mgmt, u.beacon); - p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, -pnetwork->IEs + bcn_fixed_size, -pnetwork->IELength - bcn_fixed_size); + p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pnetwork->IEs, +pnetwork->IELength); if (p && p[1]) { pht_info = (struct ieee80211_ht_operation *)(p + 2); diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index f235ae0..2cb8eed 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -355,36 +355,15 @@ int rtw_generate_ie23a(struct registry_priv *pregistrypriv) pdev_network->tsf = 0; - /* timestamp will be inserted by hardware */ - sz += 8; - ie += sz; - - /* beacon interval : 2bytes */ - /* BCN_INTERVAL; */ - *(u16*)ie = cpu_to_le16(pdev_network->beacon_interval); - sz += 2; - ie += 2; - - /* capability info */ - *(u16*)ie = 0; - - *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_IBSS); cap = WLAN_CAPABILITY_IBSS; - if (pregistrypriv->preamble == PREAMBLE_SHORT) { - *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); + if (pregistrypriv->preamble == PREAMBLE_SHORT) cap |= WLAN_CAPABILITY_SHORT_PREAMBLE; - } - if (pdev_network->Privacy) { - *(u16*)ie |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); + if (pdev_network->Privacy) cap |= WLAN_CAPABILITY_PRIVACY; - } - pdev_network->capability = cap; - sz += 2; - ie += 2; /* SSID */ ie = rtw_set_ie23a(ie, WLAN_EID_SSID, pdev_network->Ssid.ssid_len, @@ -718,13 +697,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) const u8 *pbuf; int group_cipher = 0, pairwise_cipher = 0, is8021x = 0; int ret = _FAIL; - int r, offset, plen; + int r, plen; char *pie; - offset = offsetof(struct ieee80211_mgmt, u.beacon.variable) - - offsetof(struct ieee80211_mgmt, u); - pie = &pnetwork->network.IEs[offset]; - plen = pnetwork->network.IELength - offset; + pie = pnetwork->network.IEs; + plen = pnetwork->network.IELength; pbuf = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSOFT_WPA, pie, plen); @@ -779,7 +756,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) void rtw_get_bcn_info23a(struct wlan_network *pnetwork) { u8 bencrypt = 0; - int pie_len, ie_offset; + int pie_len; u8 *pie; const u8 *p; @@ -792,10 +769,8 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork) RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: ssid =%s\n", __func__, pnetwork->network.Ssid.ssid)); - ie_offset = offsetof(struct ieee80211
[PATCH 30/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Pass key_index argument
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 62 ++- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index c5ac645..819573f 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -499,14 +499,13 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, return set_group_key(padapter, key, alg, keyid); } -static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, +static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, struct ieee_param *param, u32 param_len, struct key_params *keyparms) { int ret = 0; int key_len; - u8 wep_key_idx; struct sta_info *psta = NULL, *pbcmc_sta = NULL; struct rtw_adapter *padapter = netdev_priv(dev); struct security_priv *psecuritypriv = &padapter->securitypriv; @@ -526,7 +525,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, } if (is_broadcast_ether_addr(param->sta_addr)) { - if (param->u.crypt.idx >= WEP_KEYS) { + if (key_index >= WEP_KEYS) { ret = -EINVAL; goto exit; } @@ -557,12 +556,10 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, keyparms->cipher == WLAN_CIPHER_SUITE_WEP104)) { DBG_8723A("r871x_set_encryption, crypt.alg = WEP\n"); - wep_key_idx = param->u.crypt.idx; - DBG_8723A("r871x_set_encryption, wep_key_idx =%d, len =%d\n", - wep_key_idx, key_len); + key_index, key_len); - if (wep_key_idx >= WEP_KEYS || key_len <= 0) { + if (key_index >= WEP_KEYS || key_len <= 0) { ret = -EINVAL; goto exit; } @@ -580,15 +577,15 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, psecuritypriv->dot11PrivacyAlgrthm = keyparms->cipher; psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher; - psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; + psecuritypriv->dot11PrivacyKeyIndex = key_index; } - memcpy(&psecuritypriv->wep_key[wep_key_idx].key, + memcpy(&psecuritypriv->wep_key[key_index].key, keyparms->key, key_len); - psecuritypriv->wep_key[wep_key_idx].keylen = key_len; + psecuritypriv->wep_key[key_index].keylen = key_len; - set_wep_key(padapter, keyparms->key, key_len, wep_key_idx); + set_wep_key(padapter, keyparms->key, key_len, key_index); goto exit; } @@ -600,8 +597,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, DBG_8723A("%s, set group_key, WEP\n", __func__); memcpy(psecuritypriv-> - dot118021XGrpKey[param->u.crypt.idx]. - skey, keyparms->key, + dot118021XGrpKey[key_index].skey, + keyparms->key, (key_len > 16 ? 16 : key_len)); psecuritypriv->dot118021XGrpPrivacy = @@ -614,19 +611,17 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, WLAN_CIPHER_SUITE_TKIP; memcpy(psecuritypriv-> - dot118021XGrpKey[param->u.crypt.idx]. - skey, param->u.crypt.key, + dot118021XGrpKey[key_index].skey, + param->u.crypt.key, (key_len > 16 ? 16 : key_len)); /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ memcpy(psecuritypriv-> - dot118021XGrptxmickey[param->u.crypt. -idx].skey, + dot118021XGrptxmickey[key_index].skey, ¶m->u.crypt.key[16], 8); memcpy(psecuritypriv-> - dot118021XGrprxmickey[param->u.crypt. -
[PATCH 41/43] staging: rtl8723au: rtw_append_pmkid(): Adjust for IEs array not arrying fixed elements
From: Jes Sorensen Another case using hard coded offsets counting on the presence of fixed beacon elements in the IEs array. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index d0e9b66..c2e3777 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1984,7 +1984,7 @@ static int rtw_append_pmkid(struct rtw_adapter *Adapter, int iEntry, { struct security_priv *psecuritypriv = &Adapter->securitypriv; - if (ie[13] <= 20) { + if (ie[1] <= 20) { /* The RSN IE didn't include the PMK ID, append the PMK information */ ie[ie_len] = 1; @@ -1995,7 +1995,7 @@ static int rtw_append_pmkid(struct rtw_adapter *Adapter, int iEntry, &psecuritypriv->PMKIDList[iEntry].PMKID, 16); ie_len += 16; - ie[13] += 18;/* PMKID length = 2+16 */ + ie[1] += 18;/* PMKID length = 2+16 */ } return ie_len; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 42/43] staging: rtl8723au: Only validate vendor specific ies, when they it is vendor specific
From: Jes Sorensen Don't run rtw_validate_vendor_specific_ies() on anything but WLAN_EID_VENDOR_SPECIFIC. In addition use the proper WLAN_OUI_TYPE_MICROSOFT_* definitions. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 4b769d5..88cf1fd 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -1204,11 +1204,11 @@ static int rtw_validate_vendor_specific_ies(const u8 *pos, int elen) /* Microsoft/Wi-Fi information elements are further typed and * subtyped */ switch (pos[3]) { - case 1: + case WLAN_OUI_TYPE_MICROSOFT_WPA: /* Microsoft OUI (00:50:F2) with OUI Type 1: * real WPA information element */ break; - case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */ + case WLAN_OUI_TYPE_MICROSOFT_WMM: if (elen < 5) { DBG_8723A("short WME information element " "ignored (len =%i)\n", elen); @@ -1227,7 +1227,7 @@ static int rtw_validate_vendor_specific_ies(const u8 *pos, int elen) return -EINVAL; } break; - case 4: + case WLAN_OUI_TYPE_MICROSOFT_WPS: /* Wi-Fi Protected Setup (WPS) IE */ break; default: @@ -1289,6 +1289,7 @@ static int rtw_validate_frame_ies(const u8 *start, uint len) case WLAN_EID_CHALLENGE: case WLAN_EID_ERP_INFO: case WLAN_EID_EXT_SUPP_RATES: + break; case WLAN_EID_VENDOR_SPECIFIC: if (rtw_validate_vendor_specific_ies(pos, elen)) unknown++; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/43] staging: rtl8723au: Stop setting ieee_parm arguments that aren't used
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 37 --- 1 file changed, 37 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 624966e..7aaa3f8 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -514,17 +514,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("%s\n", __func__); - param->u.crypt.err = 0; - param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; - - /* sizeof(struct ieee_param) = 64 bytes; */ - /* if (param_len != (u32) ((u8 *) param->u.crypt.key - - (u8 *) param) + param->u.crypt.key_len) */ - if (param_len != sizeof(struct ieee_param) + param->u.crypt.key_len) { - ret = -EINVAL; - goto exit; - } - if (is_broadcast_ether_addr(param->sta_addr)) { if (key_index >= WEP_KEYS) { ret = -EINVAL; @@ -616,7 +605,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, keyparms->key, (key_len > 16 ? 16 : key_len)); - /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ memcpy(psecuritypriv-> dot118021XGrptxmickey[key_index].skey, @@ -692,7 +680,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_TKIP; - /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ memcpy(psta->dot11tkiptxmickey.skey, &keyparms->key[16], 8); @@ -738,9 +725,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, keyparms->key, (key_len > 16 ? 16 : key_len)); - /* DEBUG_ERR("set key length :param->u" - ".crypt.key_len =%d\n", - param->u.crypt.key_len); */ /* set mic key */ memcpy(psecuritypriv-> dot118021XGrptxmickey[key_index].skey, @@ -804,17 +788,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, DBG_8723A("%s\n", __func__); - param->u.crypt.err = 0; - param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; - key_len = keyparms->key_len; - if (param_len < - (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + key_len) { - ret = -EINVAL; - goto exit; - } - if (is_broadcast_ether_addr(param->sta_addr)) { if (key_index >= WEP_KEYS) { ret = -EINVAL; @@ -1029,18 +1004,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, else set_tx = 1; /* for wpa/wpa2 pairwise key */ - /* param->u.crypt.idx = key_index - 1; */ - param->u.crypt.idx = key_index; - - if (params->seq_len && params->seq) { - memcpy(param->u.crypt.seq, params->seq, params->seq_len); - } - - if (params->key_len && params->key) { - param->u.crypt.key_len = params->key_len; - memcpy(param->u.crypt.key, params->key, params->key_len); - } - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { ret = rtw_cfg80211_set_encryption(ndev, key_index, set_tx, param, param_len, params); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/43] staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): obtain key from key_params
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 819573f..f676ec6 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -612,17 +612,17 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, - param->u.crypt.key, + keyparms->key, (key_len > 16 ? 16 : key_len)); /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ memcpy(psecuritypriv-> dot118021XGrptxmickey[key_index].skey, - ¶m->u.crypt.key[16], 8); + &keyparms->key[16], 8); memcpy(psecuritypriv-> dot118021XGrprxmickey[key_index].skey, - ¶m->u.crypt.key[24], 8); + &keyparms->key[24], 8); psecuritypriv->busetkipkey = 1; @@ -634,8 +634,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, WLAN_CIPHER_SUITE_CCMP; memcpy(psecuritypriv-> - dot118021XGrpKey[key_index]. - skey, param->u.crypt.key, + dot118021XGrpKey[key_index].skey, + keyparms->key, (key_len > 16 ? 16 : key_len)); } else { DBG_8723A("%s, set group_key, none\n", @@ -652,7 +652,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, psecuritypriv->dot11PrivacyAlgrthm = psecuritypriv->dot118021XGrpPrivacy; - set_group_key(padapter, param->u.crypt.key, + set_group_key(padapter, keyparms->key, psecuritypriv->dot118021XGrpPrivacy, key_index); @@ -675,8 +675,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, if (param->u.crypt.set_tx == 1) { /* pairwise key */ memcpy(psta->dot118021x_UncstKey.skey, - param->u.crypt.key, - (key_len > 16 ? 16 : key_len)); + keyparms->key, (key_len > 16 ? 16 : key_len)); if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { @@ -695,9 +694,9 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ memcpy(psta->dot11tkiptxmickey.skey, - ¶m->u.crypt.key[16], 8); + &keyparms->key[16], 8); memcpy(psta->dot11tkiprxmickey.skey, - ¶m->u.crypt.key[24], 8); + &keyparms->key[24], 8); psecuritypriv->busetkipkey = 1; @@ -724,7 +723,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, - param->u.crypt.key, + keyparms->key, (key_len > 16 ? 16 : key_len)); psecuritypriv->dot118021XGrpPrivacy = @@ -735,7 +734,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, - param->u.crypt.key, + key
Re: Anybody working on gdm72xx?
On Tue, Jun 24, 2014 at 12:12:55AM -0700, Ben Chan wrote: > On Mon, Jun 23, 2014 at 2:33 PM, Kristina Martšenko > wrote: > > > > Here is an example of another driver being moved out: > > http://www.spinics.net/lists/linux-usb/msg100924.html > > > > Thanks Kristina. checkpatch reports 1 errors and 17 warnings on the > current driver. > > I guess I need to first submit patches to staging-next to address > these issues, and then submit another patch to move it out of staging, > right? Yes, that would be good. But when you submit it for inclusion to the drivers/net/ location, just make a "new" patch that adds the driver, not one that moves the code, which will make it easier to review by the network developers. After it gets accepted into the network location, then we can just delete the drivers/staging/ code. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on ced1401?
On Tue, Jun 24, 2014 at 11:14:40AM +0200, Luca Ellero wrote: > On 23/06/2014 22:19, Kristina Martšenko wrote:> Hi Angelo, > > > > I'm helping Greg do a bit of cleanup in the staging tree. I noticed that > > nobody seems to have worked towards moving quickstart out of staging in > > over a year. Are there any plans to clean it up and move it out soon? > > Because otherwise we're going to have to delete the driver, as we don't > > want staging to become a permanent place for unfinished code. > > > Hi Kristina, > I was planning to send some patches for cleaning up this driver. In > particular what I would like to: > > - fix camel case naming of variables and functions > - fix checkpatch warnings > - fix build warnings > > Anyway I don't have the hardware so I can't test them. Please let me know if > these patches are welcome, so I'll send them in the next weeks. They are welcome, but if we are going to delete the driver, there's not much need for them :) Until we figure that out, please feel free to send the patches. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
On Tue, Jun 24, 2014 at 08:29:17AM +0800, Dexuan Cui wrote: > Currently the VSC has no chance to notify the VSP of the dirty rectangle on VM > panic because the notification work is done in a workqueue, and in panic() the > kernel typically ends up in an infinite loop, and a typical kernel config has > CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch > can't happen in panic() and the workqueue won't have a chance to run. As a > result, the VM Connection window can't refresh until it's closed and we > re-connect to the VM. > > We can register a handler on panic_notifier_list: the handler can notify > the VSC and switch the framebuffer driver to a "synchronous mode", meaning > the VSC flushes any future framebuffer change to the VSP immediately. > > MS-TFS: 157532 What is this line for? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on line6?
On Tue, Jun 24, 2014 at 11:54:10AM +0800, Stefan Hajnoczi wrote: > On Tue, Jun 24, 2014 at 4:23 AM, Kristina Martšenko > wrote: > > I'm helping Greg do a bit of cleanup in the staging tree. I noticed that > > nobody seems to have worked towards moving line6 out of staging in over > > a year. Are there any plans to clean it up and move it out soon? Because > > otherwise we're going to have to delete the driver, as we don't want > > staging to become a permanent place for unfinished code. > > I do not have time to resume the work and am moving to new hardware in > a few weeks. Do you know of anyone else using this hardware on Linux? > It's a shame since the driver is in a pretty good position for further > cleanups and a move out of staging/. There's not that much left to do > but the rate of progress at the moment is zero. If the code is "almost" ready to move, what do you think is left to do? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on line6?
On Tue, Jun 24, 2014 at 9:52 PM, Greg KH wrote: > On Tue, Jun 24, 2014 at 11:54:10AM +0800, Stefan Hajnoczi wrote: >> On Tue, Jun 24, 2014 at 4:23 AM, Kristina Martšenko >> wrote: >> > I'm helping Greg do a bit of cleanup in the staging tree. I noticed that >> > nobody seems to have worked towards moving line6 out of staging in over >> > a year. Are there any plans to clean it up and move it out soon? Because >> > otherwise we're going to have to delete the driver, as we don't want >> > staging to become a permanent place for unfinished code. >> >> I do not have time to resume the work and am moving to new hardware in >> a few weeks. > > Do you know of anyone else using this hardware on Linux? Markus Grabner is the maintainer and still the best person to involve. People have popped up from time to time on the line6linux-devel mailing list but no one has stuck around: http://sourceforge.net/p/line6linux/mailman/line6linux-devel/ >> It's a shame since the driver is in a pretty good position for further >> cleanups and a move out of staging/. There's not that much left to do >> but the rate of progress at the moment is zero. > > If the code is "almost" ready to move, what do you think is left to do? 1. Run checkpatch.pl again to make sure there are no coding style issues remaining. 2. Audit remaining sysfs attributes and drop them where possible. I killed off the easy ones which just sent MIDI messages that userspace can send just as easily. Now only the weird ones are left: drivers/staging/line6/pcm.c:static DEVICE_ATTR_RW(impulse_volume); drivers/staging/line6/pcm.c:static DEVICE_ATTR_RW(impulse_period); drivers/staging/line6/pod.c:static DEVICE_ATTR_RO(device_id); drivers/staging/line6/pod.c:static DEVICE_ATTR_RO(firmware_version); drivers/staging/line6/pod.c:static DEVICE_ATTR_RO(serial_number); drivers/staging/line6/toneport.c:static DEVICE_ATTR(led_red, S_IWUSR | S_IRUGO, line6_nop_read, drivers/staging/line6/toneport.c:static DEVICE_ATTR(led_green, S_IWUSR | S_IRUGO, line6_nop_read, Are sysfs attributes appropriate userspace ABIs for these parameters? Should ioctls be used instead? 3. Send patch to move driver to ALSA maintainers and address any review feedback. Stefan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 06/10] drm: drm_display_mode: add signal polarity flags
On Mon, Jun 16, 2014 at 12:11:20PM +0200, Denis Carikli wrote: > We need a way to pass signal polarity informations > between DRM panels, and the display drivers. > > To do that, a pol_flags field was added to drm_display_mode. > > Signed-off-by: Denis Carikli This patch needs an ack from the DRM people - can someone review it please? This series has now been round 14 revisions and it's about time it was properly reviewed - or a statement made if it's unacceptable. > --- > ChangeLog v13->v14: > - Fixed DRM_MODE_FLAG_POL_DE_HIGH's description. > ChangeLog v12->v13: > - Added Docbook documentation for pol_flags the struct field. > - Removed the _PRESERVE defines: it was used by patches > against the imx_drm driver. Now theses patches have been > adapted not to require that defines. > ChangeLog v11->v12: > - Rebased: This patch now applies against drm_modes.h > - Rebased: It now uses the new DRM_MODE_FLAG_POL_DE flags defines names > > ChangeLog v10->v11: > - Since the imx-drm won't be able to retrive its regulators > from the device tree when using display-timings nodes, > and that I was told that the drm simple-panel driver > already supported that, I then, instead, added what was > lacking to make the eukrea displays work with the > drm-simple-panel driver. > > That required a way to get back the display polarity > informations from the imx-drm driver without affecting > userspace. > --- > Documentation/DocBook/drm.tmpl | 30 ++ > include/drm/drm_modes.h|6 ++ > 2 files changed, 36 insertions(+) > > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl > index 7df3134..22d435f 100644 > --- a/Documentation/DocBook/drm.tmpl > +++ b/Documentation/DocBook/drm.tmpl > @@ -2292,6 +2292,36 @@ void intel_crt_init(struct drm_device *dev) > and height_mm fields are only used > internally > during EDID parsing and should not be set when creating modes > manually. > > + > +The pol_flags value represents the > display > +signal polarity flags, it can be a combination of > + > + > +DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE > + > + drive pixel data on falling edge, sample data on rising > edge. > + > + > + > +DRM_MODE_FLAG_POL_PIXDATA_POSEDGE > + > + Drive pixel data on rising edge, sample data on falling > edge. > + > + > + > +DRM_MODE_FLAG_POL_DE_LOW > + > + data-enable pulse is active low > + > + > + > +DRM_MODE_FLAG_POL_DE_HIGH > + > + data-enable pulse is active high > + > + > + > + > > >int (*mode_valid)(struct drm_connector *connector, > diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h > index 91d0582..c5cbe31 100644 > --- a/include/drm/drm_modes.h > +++ b/include/drm/drm_modes.h > @@ -93,6 +93,11 @@ enum drm_mode_status { > > #define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF > > +#define DRM_MODE_FLAG_POL_PIXDATA_NEGEDGEBIT(1) > +#define DRM_MODE_FLAG_POL_PIXDATA_POSEDGEBIT(2) > +#define DRM_MODE_FLAG_POL_DE_LOW BIT(3) > +#define DRM_MODE_FLAG_POL_DE_HIGHBIT(4) > + > struct drm_display_mode { > /* Header */ > struct list_head head; > @@ -144,6 +149,7 @@ struct drm_display_mode { > int vrefresh; /* in Hz */ > int hsync; /* in kHz */ > enum hdmi_picture_aspect picture_aspect_ratio; > + unsigned int pol_flags; > }; > > /* mode specified on the command line */ > -- > 1.7.9.5 > -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 05/10] ARM: dts: imx5*, imx6*: correct display-timings nodes.
On Mon, Jun 16, 2014 at 12:11:19PM +0200, Denis Carikli wrote: > The imx-drm driver can't use the de-active and > pixelclk-active display-timings properties yet. > > Instead the data-enable and the pixel data clock > polarity are hardcoded in the imx-drm driver. > > So theses properties are now set to keep > the same behaviour when imx-drm will start > using them. > > Signed-off-by: Denis Carikli This patch needs either an ack from the arm-soc/iMX maintainers, or they need to merge it. As there's little positive agreement on the series, I can understand why there's reluctance to merge it. So, can we start having some acks from people please, or at least commitments to merge this patch when the others are deemed to be acceptable. If not, can we have explanations why this should not be merged. Thanks. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
Denis, This patch creates binding documentation. Any patch which does so should be copied to the DT people so they can review the bindings and give appropriate acks. It would be better if you separate the binding documentation updates from the other functional changes too. I've added them on this reply to see whether they'll feel friendly enough to comment on the patch as it stands to avoid having to go through two more rounds on this already-fourteen revision patch set. On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: > Signed-off-by: Denis Carikli > --- > ChangeLog v13->v14: > - None > > ChangeLog v12->v13: > - Added a note explaining why the size is zero in > the eukrea_mbimxsd51_dvi(s)vga structs. > ChangeLog v11->v12: > - Rebased: It now uses the new DRM_MODE_FLAG_POL_DE flags defines names > > ChangeLog v10->v11: > - New patch. > --- > .../bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt |7 ++ > .../bindings/panel/eukrea,mbimxsd51-dvi-svga.txt |7 ++ > .../bindings/panel/eukrea,mbimxsd51-dvi-vga.txt|7 ++ > drivers/gpu/drm/panel/panel-simple.c | 83 > > 4 files changed, 104 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt > create mode 100644 > Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > create mode 100644 > Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > > diff --git > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt > new file mode 100644 > index 000..03679d0 > --- /dev/null > +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt > @@ -0,0 +1,7 @@ > +Eukrea CMO-QVGA (320x240 pixels) TFT LCD panel > + > +Required properties: > +- compatible: should be "eukrea,mbimxsd51-cmo-qvga" > + > +This binding is compatible with the simple-panel binding, which is specified > +in simple-panel.txt in this directory. > diff --git > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > new file mode 100644 > index 000..f408c9a > --- /dev/null > +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > @@ -0,0 +1,7 @@ > +Eukrea DVI-SVGA (800x600 pixels) DVI output. > + > +Required properties: > +- compatible: should be "eukrea,mbimxsd51-dvi-svga" > + > +This binding is compatible with the simple-panel binding, which is specified > +in simple-panel.txt in this directory. > diff --git > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > new file mode 100644 > index 000..8ea90da > --- /dev/null > +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > @@ -0,0 +1,7 @@ > +Eukrea DVI-VGA (640x480 pixels) DVI output. > + > +Required properties: > +- compatible: should be "eukrea,mbimxsd51-dvi-vga" > + > +This binding is compatible with the simple-panel binding, which is specified > +in simple-panel.txt in this directory. > diff --git a/drivers/gpu/drm/panel/panel-simple.c > b/drivers/gpu/drm/panel/panel-simple.c > index a251361..adc40a7 100644 > --- a/drivers/gpu/drm/panel/panel-simple.c > +++ b/drivers/gpu/drm/panel/panel-simple.c > @@ -403,6 +403,80 @@ static const struct panel_desc edt_etm0700g0dh6 = { > }, > }; > > +static const struct drm_display_mode eukrea_mbimxsd51_cmoqvga_mode = { > + .clock = 6500, > + .hdisplay = 320, > + .hsync_start = 320 + 38, > + .hsync_end = 320 + 38 + 20, > + .htotal = 320 + 38 + 20 + 30, > + .vdisplay = 240, > + .vsync_start = 240 + 15, > + .vsync_end = 240 + 15 + 4, > + .vtotal = 240 + 15 + 4 + 3, > + .vrefresh = 60, > + .pol_flags = DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE | > + DRM_MODE_FLAG_POL_DE_LOW, > +}; > + > +static const struct panel_desc eukrea_mbimxsd51_cmoqvga = { > + .modes = &eukrea_mbimxsd51_cmoqvga_mode, > + .num_modes = 1, > + .size = { > + .width = 73, > + .height = 56, > + }, > +}; > + > +static const struct drm_display_mode eukrea_mbimxsd51_dvisvga_mode = { > + .clock = 44333, > + .hdisplay = 800, > + .hsync_start = 800 + 112, > + .hsync_end = 800 + 112 + 32, > + .htotal = 800 + 112 + 32 + 80, > + .vdisplay = 600, > + .vsync_start = 600 + 3, > + .vsync_end = 600 + 3 + 17, > + .vtotal = 600 + 3 + 17 + 4, > + .vrefresh = 60, > + .pol_flags = DRM_MODE_FLAG_POL_PIXDATA_POSEDGE | > + DRM_MODE_FLAG_POL_DE_HIGH, > +}; > + > +static const struct panel_desc eukrea_mbimxsd51_dvisvga = { > + .modes = &eukrea_mbimxsd51_dvisvga_mode, > + .num_modes = 1, > + /* This is a DVI adapter for external displays */ > + .size = { > + .width = 0, >
Re: [PATCH v14 04/10] imx-drm: use defines for clock polarity settings
On Mon, Jun 16, 2014 at 12:11:18PM +0200, Denis Carikli wrote: > Signed-off-by: Denis Carikli It would be nice to have a little more explanation in the commit messages for these patches. If you'd like to send me better commit messages for these patches, I'll add them to what I already have: imx-drm: use defines for clock polarity settings imx-drm: add RGB666 support for parallel display. It may also be worth describing the RGB666 format in the commit message for: v4l2: add new V4L2_PIX_FMT_RGB666 pixel format. And... getting some more acks for these patches would be very useful, I think I'd like to see Sascha's ack for these... Sascha? -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 04/10] imx-drm: use defines for clock polarity settings
On 06/24/2014 05:13 PM, Russell King - ARM Linux wrote: [...] If you'd like to send me better commit messages for these patches, I'll add them to what I already have: imx-drm: use defines for clock polarity settings The comment of the clk_pol field of the ipu_di_signal_cfg struct was inverted. Instead of merely inverting the comment, the values of clk_pol were defined. imx-drm: add RGB666 support for parallel display. This permits to drive parallel displays that expect the RGB666 color format. It may also be worth describing the RGB666 format in the commit message for: v4l2: add new V4L2_PIX_FMT_RGB666 pixel format. The RGB666 color format encodes 6 bits for each color(red, green and blue), linearly. It looks like this in memory: 017 RRGGBB Denis. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 04/10] imx-drm: use defines for clock polarity settings
On Tue, Jun 24, 2014 at 06:25:19PM +0200, Denis Carikli wrote: > On 06/24/2014 05:13 PM, Russell King - ARM Linux wrote: > [...] >> If you'd like to send me better commit messages for >> these patches, I'll add them to what I already have: > >> imx-drm: use defines for clock polarity settings > The comment of the clk_pol field of the ipu_di_signal_cfg struct was > inverted. > Instead of merely inverting the comment, the values of clk_pol were defined. s/inverting/fixing/ > >> imx-drm: add RGB666 support for parallel display. > This permits to drive parallel displays that expect the RGB666 color format. This allows imx-drm to drive ... >> >> It may also be worth describing the RGB666 format in the commit message >> for: >> >> v4l2: add new V4L2_PIX_FMT_RGB666 pixel format. > The RGB666 color format encodes 6 bits for each color(red, green and > blue), linearly. > It looks like this in memory: > 017 > RRGGBB Thanks! I've tweaked them very slightly as detailed above so they read a bit better. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 0/8] component helper improvements
A while back, Laurent raised some comments about the component helper, which this patch set starts to address. The first point it addresses is the repeated parsing inefficiency when deferred probing occurs. When DT is used, the structure of the component helper today means that masters end up parsing the device tree for each attempt to re-bind the driver. We remove this inefficiency by creating an array of matching data and functions, which the component helper can use internally to match up components to their master. The second point was the inefficiency of destroying the list of components each time we saw a failure. We did this to ensure that we kept things correctly ordered: component bind order matters. As we have an array instead, the array is already ordered, so we use this array to store the component pointers instead of a list, and remember which are duplicates (and thus should be avoided.) Avoiding the right duplicates matters as we walk the array in the opposite direction at tear down. drivers/base/component.c | 249 ++--- drivers/gpu/drm/msm/msm_drv.c | 83 +-- drivers/staging/imx-drm/imx-drm-core.c | 57 +--- include/linux/component.h | 8 +- 4 files changed, 208 insertions(+), 189 deletions(-) -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 2/8] component: ignore multiple additions of the same component
Permit masters to call component_master_add_child() and match the same child multiple times. This may happen if there's multiple connections to a single component device from other devices. In such scenarios, we should not return a failure, but instead ignore the attempt. Signed-off-by: Russell King --- drivers/base/component.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index d0ebd4431736..55813e91bf0d 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -69,6 +69,11 @@ static void component_detach_master(struct master *master, struct component *c) c->master = NULL; } +/* + * Add a component to a master, finding the component via the compare + * function and compare data. This is safe to call for duplicate matches + * and will not result in the same component being added multiple times. + */ int component_master_add_child(struct master *master, int (*compare)(struct device *, void *), void *compare_data) { @@ -76,11 +81,12 @@ int component_master_add_child(struct master *master, int ret = -ENXIO; list_for_each_entry(c, &component_list, node) { - if (c->master) + if (c->master && c->master != master) continue; if (compare(c->dev, compare_data)) { - component_attach_master(master, c); + if (!c->master) + component_attach_master(master, c); ret = 0; break; } -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 1/8] component: fix missed cleanup in case of devres failure
In try_to_bring_up_master(), we tear down the master's component list for each error case, except for devres group failure. Fix this oversight by making the code less prone to such mistakes. Signed-off-by: Russell King --- drivers/base/component.c | 62 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index c4778995cd72..d0ebd4431736 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -113,44 +113,44 @@ static void master_remove_components(struct master *master) static int try_to_bring_up_master(struct master *master, struct component *component) { - int ret = 0; + int ret; - if (!master->bound) { - /* -* Search the list of components, looking for components that -* belong to this master, and attach them to the master. -*/ - if (master->ops->add_components(master->dev, master)) { - /* Failed to find all components */ - master_remove_components(master); - ret = 0; - goto out; - } + if (master->bound) + return 0; - if (component && component->master != master) { - master_remove_components(master); - ret = 0; - goto out; - } + /* +* Search the list of components, looking for components that +* belong to this master, and attach them to the master. +*/ + if (master->ops->add_components(master->dev, master)) { + /* Failed to find all components */ + ret = 0; + goto out; + } - if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) { - ret = -ENOMEM; - goto out; - } + if (component && component->master != master) { + ret = 0; + goto out; + } - /* Found all components */ - ret = master->ops->bind(master->dev); - if (ret < 0) { - devres_release_group(master->dev, NULL); - dev_info(master->dev, "master bind failed: %d\n", ret); - master_remove_components(master); - goto out; - } + if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) { + ret = -ENOMEM; + goto out; + } - master->bound = true; - ret = 1; + /* Found all components */ + ret = master->ops->bind(master->dev); + if (ret < 0) { + devres_release_group(master->dev, NULL); + dev_info(master->dev, "master bind failed: %d\n", ret); + goto out; } + + master->bound = true; + return 1; + out: + master_remove_components(master); return ret; } -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 4/8] drm: msm: update to use component match support
Update MSM's DRM driver to use the component match support rather than add_components. Signed-off-by: Russell King --- drivers/gpu/drm/msm/msm_drv.c | 83 ++- 1 file changed, 35 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 0d2562fb681e..b6dc5573e445 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -905,12 +905,41 @@ static int compare_of(struct device *dev, void *data) { return dev->of_node == data; } +#else +static int compare_dev(struct device *dev, void *data) +{ + return dev == data; +} +#endif + +static int msm_drm_bind(struct device *dev) +{ + return drm_platform_init(&msm_driver, to_platform_device(dev)); +} + +static void msm_drm_unbind(struct device *dev) +{ + drm_put_dev(platform_get_drvdata(to_platform_device(dev))); +} + +static const struct component_master_ops msm_drm_ops = { + .bind = msm_drm_bind, + .unbind = msm_drm_unbind, +}; + +/* + * Platform driver: + */ -static int msm_drm_add_components(struct device *master, struct master *m) +static int msm_pdev_probe(struct platform_device *pdev) { - struct device_node *np = master->of_node; + struct component_match *match = NULL; +#ifdef CONFIG_OF + /* NOTE: the CONFIG_OF case duplicates the same code as exynos or imx +* (or probably any other).. so probably some room for some helpers +*/ + struct device_node *np = pdev->dev.of_node; unsigned i; - int ret; for (i = 0; ; i++) { struct device_node *node; @@ -919,22 +948,9 @@ static int msm_drm_add_components(struct device *master, struct master *m) if (!node) break; - ret = component_master_add_child(m, compare_of, node); - of_node_put(node); - - if (ret) - return ret; + component_match_add(&pdev->dev, &match, compare_of, node); } - return 0; -} #else -static int compare_dev(struct device *dev, void *data) -{ - return dev == data; -} - -static int msm_drm_add_components(struct device *master, struct master *m) -{ /* For non-DT case, it kinda sucks. We don't actually have a way * to know whether or not we are waiting for certain devices (or if * they are simply not present). But for non-DT we only need to @@ -958,41 +974,12 @@ static int msm_drm_add_components(struct device *master, struct master *m) return -EPROBE_DEFER; } - ret = component_master_add_child(m, compare_dev, dev); - if (ret) { - DBG("could not add child: %d", ret); - return ret; - } + component_match_add(&pdev->dev, &match, compare_dev, dev); } - - return 0; -} #endif -static int msm_drm_bind(struct device *dev) -{ - return drm_platform_init(&msm_driver, to_platform_device(dev)); -} - -static void msm_drm_unbind(struct device *dev) -{ - drm_put_dev(platform_get_drvdata(to_platform_device(dev))); -} - -static const struct component_master_ops msm_drm_ops = { - .add_components = msm_drm_add_components, - .bind = msm_drm_bind, - .unbind = msm_drm_unbind, -}; - -/* - * Platform driver: - */ - -static int msm_pdev_probe(struct platform_device *pdev) -{ pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); - return component_master_add(&pdev->dev, &msm_drm_ops); + return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match); } static int msm_pdev_remove(struct platform_device *pdev) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 6/8] component: remove old add_components method
Now that drivers create an array of component matches at probe time, we can retire the old methods. This involves removing the add_components master method, and removing component_master_add_child() from public view. We also remove component_add_master() as that interface is no longer useful. Signed-off-by: Russell King --- drivers/base/component.c | 21 + include/linux/component.h | 5 - 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index bd8b4908593b..c0a5b1abc931 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -84,7 +84,7 @@ static void component_detach_master(struct master *master, struct component *c) * function and compare data. This is safe to call for duplicate matches * and will not result in the same component being added multiple times. */ -int component_master_add_child(struct master *master, +static int component_master_add_child(struct master *master, int (*compare)(struct device *, void *), void *compare_data) { struct component *c; @@ -104,7 +104,6 @@ int component_master_add_child(struct master *master, return ret; } -EXPORT_SYMBOL_GPL(component_master_add_child); static int find_components(struct master *master) { @@ -112,14 +111,6 @@ static int find_components(struct master *master) size_t i; int ret = 0; - if (!match) { - /* -* Search the list of components, looking for components that -* belong to this master, and attach them to the master. -*/ - return master->ops->add_components(master->dev, master); - } - /* * Scan the array of match functions and attach * any components which are found to this master. @@ -289,9 +280,6 @@ int component_master_add_with_match(struct device *dev, struct master *master; int ret; - if (ops->add_components && match) - return -EINVAL; - /* Reallocate the match array for its true size */ match = component_match_realloc(dev, match, match->num); if (IS_ERR(match)) @@ -323,13 +311,6 @@ int component_master_add_with_match(struct device *dev, } EXPORT_SYMBOL_GPL(component_master_add_with_match); -int component_master_add(struct device *dev, - const struct component_master_ops *ops) -{ - return component_master_add_with_match(dev, ops, NULL); -} -EXPORT_SYMBOL_GPL(component_master_add); - void component_master_del(struct device *dev, const struct component_master_ops *ops) { diff --git a/include/linux/component.h b/include/linux/component.h index c00dcc302611..71c434a6a5ee 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -17,18 +17,13 @@ void component_unbind_all(struct device *, void *); struct master; struct component_master_ops { - int (*add_components)(struct device *, struct master *); int (*bind)(struct device *); void (*unbind)(struct device *); }; -int component_master_add(struct device *, const struct component_master_ops *); void component_master_del(struct device *, const struct component_master_ops *); -int component_master_add_child(struct master *master, - int (*compare)(struct device *, void *), void *compare_data); - struct component_match; int component_master_add_with_match(struct device *, -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 7/8] component: move check for unbound master into try_to_bring_up_masters()
Clean up the code a little; we don't need to check that the master is unbound for every invocation of try_to_bring_up_master(), so let's move it to where it's really needed - try_to_bring_up_masters(), where we may encounter already bound masters. Signed-off-by: Russell King --- drivers/base/component.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index c0a5b1abc931..0863cfeea769 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -150,13 +150,6 @@ static int try_to_bring_up_master(struct master *master, { int ret; - if (master->bound) - return 0; - - /* -* Search the list of components, looking for components that -* belong to this master, and attach them to the master. -*/ if (find_components(master)) { /* Failed to find all components */ ret = 0; @@ -196,9 +189,11 @@ static int try_to_bring_up_masters(struct component *component) int ret = 0; list_for_each_entry(m, &masters, node) { - ret = try_to_bring_up_master(m, component); - if (ret != 0) - break; + if (!m->bound) { + ret = try_to_bring_up_master(m, component); + if (ret != 0) + break; + } } return ret; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 3/8] component: add support for component match array
Add support for generating a set of component matches at master probe time, and submitting them to the component layer. This allows the component layer to perform the matches internally without needing to call into the master driver, and allows for further restructuring of the component helper. Signed-off-by: Russell King --- drivers/base/component.c | 119 -- include/linux/component.h | 7 +++ 2 files changed, 123 insertions(+), 3 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 55813e91bf0d..bd8b4908593b 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -18,6 +18,15 @@ #include #include +struct component_match { + size_t alloc; + size_t num; + struct { + void *data; + int (*fn)(struct device *, void *); + } compare[0]; +}; + struct master { struct list_head node; struct list_head components; @@ -25,6 +34,7 @@ struct master { const struct component_master_ops *ops; struct device *dev; + struct component_match *match; }; struct component { @@ -96,6 +106,34 @@ int component_master_add_child(struct master *master, } EXPORT_SYMBOL_GPL(component_master_add_child); +static int find_components(struct master *master) +{ + struct component_match *match = master->match; + size_t i; + int ret = 0; + + if (!match) { + /* +* Search the list of components, looking for components that +* belong to this master, and attach them to the master. +*/ + return master->ops->add_components(master->dev, master); + } + + /* +* Scan the array of match functions and attach +* any components which are found to this master. +*/ + for (i = 0; i < match->num; i++) { + ret = component_master_add_child(master, +match->compare[i].fn, +match->compare[i].data); + if (ret) + break; + } + return ret; +} + /* Detach all attached components from this master */ static void master_remove_components(struct master *master) { @@ -128,7 +166,7 @@ static int try_to_bring_up_master(struct master *master, * Search the list of components, looking for components that * belong to this master, and attach them to the master. */ - if (master->ops->add_components(master->dev, master)) { + if (find_components(master)) { /* Failed to find all components */ ret = 0; goto out; @@ -186,18 +224,86 @@ static void take_down_master(struct master *master) master_remove_components(master); } -int component_master_add(struct device *dev, - const struct component_master_ops *ops) +static size_t component_match_size(size_t num) +{ + return offsetof(struct component_match, compare[num]); +} + +static struct component_match *component_match_realloc(struct device *dev, + struct component_match *match, size_t num) +{ + struct component_match *new; + + if (match && match->alloc == num) + return match; + + new = devm_kmalloc(dev, component_match_size(num), GFP_KERNEL); + if (!new) + return ERR_PTR(-ENOMEM); + + if (match) { + memcpy(new, match, component_match_size(min(match->num, num))); + devm_kfree(dev, match); + } else { + new->num = 0; + } + + new->alloc = num; + + return new; +} + +/* + * Add a component to be matched. + * + * The match array is first created or extended if necessary. + */ +void component_match_add(struct device *dev, struct component_match **matchptr, + int (*compare)(struct device *, void *), void *compare_data) +{ + struct component_match *match = *matchptr; + + if (IS_ERR(match)) + return; + + if (!match || match->num == match->alloc) { + size_t new_size = match ? match->alloc + 16 : 15; + + match = component_match_realloc(dev, match, new_size); + + *matchptr = match; + + if (IS_ERR(match)) + return; + } + + match->compare[match->num].fn = compare; + match->compare[match->num].data = compare_data; + match->num++; +} + +int component_master_add_with_match(struct device *dev, + const struct component_master_ops *ops, + struct component_match *match) { struct master *master; int ret; + if (ops->add_components && match) + return -EINVAL; + + /* Reallocate the match array for its true size */ + match = component_match_realloc(dev, match, match->num); + if (IS_ERR(match)) + return PTR_ERR(match);
[PATCH RFC v2 5/8] imx-drm: update to use component match support
Update the imx-drm driver to use the component match support rather than add_components. Signed-off-by: Russell King --- drivers/staging/imx-drm/imx-drm-core.c | 57 +++--- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index def8280d7ee6..47ee6c79857a 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c @@ -570,22 +570,6 @@ static int compare_of(struct device *dev, void *data) return dev->of_node == np; } -static LIST_HEAD(imx_drm_components); - -static int imx_drm_add_components(struct device *master, struct master *m) -{ - struct imx_drm_component *component; - int ret; - - list_for_each_entry(component, &imx_drm_components, list) { - ret = component_master_add_child(m, compare_of, -component->of_node); - if (ret) - return ret; - } - return 0; -} - static int imx_drm_bind(struct device *dev) { return drm_platform_init(&imx_drm_driver, to_platform_device(dev)); @@ -597,43 +581,14 @@ static void imx_drm_unbind(struct device *dev) } static const struct component_master_ops imx_drm_ops = { - .add_components = imx_drm_add_components, .bind = imx_drm_bind, .unbind = imx_drm_unbind, }; -static struct imx_drm_component *imx_drm_find_component(struct device *dev, - struct device_node *node) -{ - struct imx_drm_component *component; - - list_for_each_entry(component, &imx_drm_components, list) - if (component->of_node == node) - return component; - - return NULL; -} - -static int imx_drm_add_component(struct device *dev, struct device_node *node) -{ - struct imx_drm_component *component; - - if (imx_drm_find_component(dev, node)) - return 0; - - component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); - if (!component) - return -ENOMEM; - - component->of_node = node; - list_add_tail(&component->list, &imx_drm_components); - - return 0; -} - static int imx_drm_platform_probe(struct platform_device *pdev) { struct device_node *ep, *port, *remote; + struct component_match *match = NULL; int ret; int i; @@ -647,9 +602,7 @@ static int imx_drm_platform_probe(struct platform_device *pdev) if (!port) break; - ret = imx_drm_add_component(&pdev->dev, port); - if (ret < 0) - return ret; + component_match_add(&pdev->dev, &match, compare_of, port); } if (i == 0) { @@ -675,10 +628,8 @@ static int imx_drm_platform_probe(struct platform_device *pdev) continue; } - ret = imx_drm_add_component(&pdev->dev, remote); + component_match_add(&pdev->dev, &match, compare_of, remote); of_node_put(remote); - if (ret < 0) - return ret; } of_node_put(port); } @@ -687,7 +638,7 @@ static int imx_drm_platform_probe(struct platform_device *pdev) if (ret) return ret; - return component_master_add(&pdev->dev, &imx_drm_ops); + return component_master_add_with_match(&pdev->dev, &imx_drm_ops, match); } static int imx_drm_platform_remove(struct platform_device *pdev) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RFC v2 8/8] component: track components via array rather than list
Since we now have an array which defines each component, maintain the components to be bound in the array rather than a separate list. We also need duplicate tracking so we can eliminate multiple bind calls for the same component: we preserve the list-based component order in that the first match which adds the component determines its position. Signed-off-by: Russell King --- drivers/base/component.c | 140 +-- 1 file changed, 62 insertions(+), 78 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 0863cfeea769..8a1d784a9759 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -18,18 +18,21 @@ #include #include +struct component; + struct component_match { size_t alloc; size_t num; struct { void *data; int (*fn)(struct device *, void *); + struct component *component; + bool duplicate; } compare[0]; }; struct master { struct list_head node; - struct list_head components; bool bound; const struct component_master_ops *ops; @@ -39,7 +42,6 @@ struct master { struct component { struct list_head node; - struct list_head master_node; struct master *master; bool bound; @@ -63,46 +65,20 @@ static struct master *__master_find(struct device *dev, return NULL; } -/* Attach an unattached component to a master. */ -static void component_attach_master(struct master *master, struct component *c) -{ - c->master = master; - - list_add_tail(&c->master_node, &master->components); -} - -/* Detach a component from a master. */ -static void component_detach_master(struct master *master, struct component *c) -{ - list_del(&c->master_node); - - c->master = NULL; -} - -/* - * Add a component to a master, finding the component via the compare - * function and compare data. This is safe to call for duplicate matches - * and will not result in the same component being added multiple times. - */ -static int component_master_add_child(struct master *master, +static struct component *find_component(struct master *master, int (*compare)(struct device *, void *), void *compare_data) { struct component *c; - int ret = -ENXIO; list_for_each_entry(c, &component_list, node) { if (c->master && c->master != master) continue; - if (compare(c->dev, compare_data)) { - if (!c->master) - component_attach_master(master, c); - ret = 0; - break; - } + if (compare(c->dev, compare_data)) + return c; } - return ret; + return NULL; } static int find_components(struct master *master) @@ -116,26 +92,35 @@ static int find_components(struct master *master) * any components which are found to this master. */ for (i = 0; i < match->num; i++) { - ret = component_master_add_child(master, -match->compare[i].fn, -match->compare[i].data); - if (ret) + struct component *c; + + if (match->compare[i].component) + continue; + + c = find_component(master, match->compare[i].fn, + match->compare[i].data); + if (!c) { + ret = -ENXIO; break; + } + + /* Attach this component to the master */ + match->compare[i].duplicate = !!c->master; + match->compare[i].component = c; + c->master = master; } return ret; } -/* Detach all attached components from this master */ -static void master_remove_components(struct master *master) +/* Detach component from associated master */ +static void remove_component(struct master *master, struct component *c) { - while (!list_empty(&master->components)) { - struct component *c = list_first_entry(&master->components, - struct component, master_node); - - WARN_ON(c->master != master); + size_t i; - component_detach_master(master, c); - } + /* Detach the component from this master. */ + for (i = 0; i < master->match->num; i++) + if (master->match->compare[i].component == c) + master->match->compare[i].component = NULL; } /* @@ -150,37 +135,25 @@ static int try_to_bring_up_master(struct master *master, { int ret; - if (find_components(master)) { - /* Failed to find all components */ - ret = 0; - g
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
On Tue, Jun 24, 2014 at 10:06 AM, Russell King - ARM Linux wrote: > Denis, > > This patch creates binding documentation. Any patch which does so > should be copied to the DT people so they can review the bindings > and give appropriate acks. It would be better if you separate the > binding documentation updates from the other functional changes too. > > I've added them on this reply to see whether they'll feel friendly > enough to comment on the patch as it stands to avoid having to go > through two more rounds on this already-fourteen revision patch set. > > On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: >> Signed-off-by: Denis Carikli >> --- >> ChangeLog v13->v14: >> - None >> >> ChangeLog v12->v13: >> - Added a note explaining why the size is zero in >> the eukrea_mbimxsd51_dvi(s)vga structs. >> ChangeLog v11->v12: >> - Rebased: It now uses the new DRM_MODE_FLAG_POL_DE flags defines names >> >> ChangeLog v10->v11: >> - New patch. >> --- >> .../bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt |7 ++ >> .../bindings/panel/eukrea,mbimxsd51-dvi-svga.txt |7 ++ >> .../bindings/panel/eukrea,mbimxsd51-dvi-vga.txt|7 ++ >> drivers/gpu/drm/panel/panel-simple.c | 83 >> >> 4 files changed, 104 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt >> create mode 100644 >> Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt >> create mode 100644 >> Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt >> >> diff --git >> a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt >> b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt >> new file mode 100644 >> index 000..03679d0 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-cmo-qvga.txt >> @@ -0,0 +1,7 @@ >> +Eukrea CMO-QVGA (320x240 pixels) TFT LCD panel >> + >> +Required properties: >> +- compatible: should be "eukrea,mbimxsd51-cmo-qvga" >> + >> +This binding is compatible with the simple-panel binding, which is specified >> +in simple-panel.txt in this directory. >> diff --git >> a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt >> b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt >> new file mode 100644 >> index 000..f408c9a >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt >> @@ -0,0 +1,7 @@ >> +Eukrea DVI-SVGA (800x600 pixels) DVI output. >> + >> +Required properties: >> +- compatible: should be "eukrea,mbimxsd51-dvi-svga" >> + >> +This binding is compatible with the simple-panel binding, which is specified >> +in simple-panel.txt in this directory. >> diff --git >> a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt >> b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt >> new file mode 100644 >> index 000..8ea90da >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt >> @@ -0,0 +1,7 @@ >> +Eukrea DVI-VGA (640x480 pixels) DVI output. >> + >> +Required properties: >> +- compatible: should be "eukrea,mbimxsd51-dvi-vga" >> + >> +This binding is compatible with the simple-panel binding, which is specified >> +in simple-panel.txt in this directory. Seems like we could just have a list of compatible strings rather than a mostly duplicated file. >> diff --git a/drivers/gpu/drm/panel/panel-simple.c >> b/drivers/gpu/drm/panel/panel-simple.c >> index a251361..adc40a7 100644 >> --- a/drivers/gpu/drm/panel/panel-simple.c >> +++ b/drivers/gpu/drm/panel/panel-simple.c >> @@ -403,6 +403,80 @@ static const struct panel_desc edt_etm0700g0dh6 = { >> }, >> }; >> >> +static const struct drm_display_mode eukrea_mbimxsd51_cmoqvga_mode = { >> + .clock = 6500, >> + .hdisplay = 320, >> + .hsync_start = 320 + 38, >> + .hsync_end = 320 + 38 + 20, >> + .htotal = 320 + 38 + 20 + 30, >> + .vdisplay = 240, >> + .vsync_start = 240 + 15, >> + .vsync_end = 240 + 15 + 4, >> + .vtotal = 240 + 15 + 4 + 3, >> + .vrefresh = 60, >> + .pol_flags = DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE | >> + DRM_MODE_FLAG_POL_DE_LOW, Why aren't you using: Documentation/devicetree/bindings/video/display-timing.txt Rob ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: fix sparse warning
From: Clément Calmels Found running sparse on the rtl8723au driver. CHECK drivers/staging/rtl8723au/core/rtw_cmd.c drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54: warning: incorrect type in argument 2 (different base types) drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54:expected int [signed] gfp drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54:got restricted gfp_t Signed-off-by: Clement Calmels --- drivers/staging/rtl8723au/core/rtw_mlme.c| 2 +- drivers/staging/rtl8723au/include/rtw_mlme.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 7170258..c6f4e47 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -125,7 +125,7 @@ void rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv) rtw23a_free_mlme_priv_ie_data(pmlmepriv); } -struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, int gfp) +struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, gfp_t gfp) { struct wlan_network *pnetwork; diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 4d327ba..f798078 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -344,7 +344,7 @@ void rtw23a_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv); void _rtw_free_mlme_priv23a(struct mlme_priv *pmlmepriv); -struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, int gfp); +struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv, gfp_t gfp); int rtw_if_up23a(struct rtw_adapter *padapter); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
>On Tue, Jun 24, 2014 at 08:29:17AM +0800, Dexuan Cui wrote: >> Currently the VSC has no chance to notify the VSP of the dirty rectangle on >> VM >> panic because the notification work is done in a workqueue, and in panic() >> the >> kernel typically ends up in an infinite loop, and a typical kernel config has >> CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch >> can't happen in panic() and the workqueue won't have a chance to run. As a >> result, the VM Connection window can't refresh until it's closed and we >> re-connect to the VM. >> >> We can register a handler on panic_notifier_list: the handler can notify >> the VSC and switch the framebuffer driver to a "synchronous mode", meaning >> the VSC flushes any future framebuffer change to the VSP immediately. >> >> MS-TFS: 157532 > What is this line for? Hi Greg, This line is for our internal bug repository. We have an automated system to correlate bugs with fixes so that our test team knows when a bug fix has been accepted upstream and they need to write a new test case for it. The MS-TFS line has appeared in the commit description for a while if you search for it in 'git log' of linux-next. Please let us know if you have further comments. BTW, it looks the previous patch mail was not sent properly so only part of the people received it. I'll re-send it. Sorry for the possible confusion. Thanks, -- Dexuan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: [...] > diff --git > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt [...] > @@ -0,0 +1,7 @@ > +Eukrea DVI-SVGA (800x600 pixels) DVI output. [...] > diff --git > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt [...] > @@ -0,0 +1,7 @@ > +Eukrea DVI-VGA (640x480 pixels) DVI output. DVI outputs shouldn't be using the panel framework and this binding at all. DVI usually has the means to determine all of this by itself. Why do you need to represent this as a panel in device tree? Thierry pgpidfDq8T7xh.pgp Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
Hi Thierry, Le Tue, 24 Jun 2014 23:49:37 +0200, Thierry Reding a écrit : > On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: > [...] > > diff --git > > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > [...] > > @@ -0,0 +1,7 @@ > > +Eukrea DVI-SVGA (800x600 pixels) DVI output. > [...] > > diff --git > > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > [...] > > @@ -0,0 +1,7 @@ > > +Eukrea DVI-VGA (640x480 pixels) DVI output. > > DVI outputs shouldn't be using the panel framework and this binding at > all. DVI usually has the means to determine all of this by itself. Why > do you need to represent this as a panel in device tree? > because on this very simple display board, we only have DVI LVDS signals without the I2C to detect the display. Best regards Eric ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
On Tue, Jun 24, 2014 at 02:52:11PM -0500, Rob Herring wrote: > On Tue, Jun 24, 2014 at 10:06 AM, Russell King - ARM Linux > wrote: [...] > > On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: [...] > >> diff --git > >> a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > >> b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt [...] > >> @@ -0,0 +1,7 @@ > >> +Eukrea DVI-VGA (640x480 pixels) DVI output. > >> + > >> +Required properties: > >> +- compatible: should be "eukrea,mbimxsd51-dvi-vga" > >> + > >> +This binding is compatible with the simple-panel binding, which is > >> specified > >> +in simple-panel.txt in this directory. > > Seems like we could just have a list of compatible strings rather than > a mostly duplicated file. We've been doing it this way for all other panels. > >> diff --git a/drivers/gpu/drm/panel/panel-simple.c > >> b/drivers/gpu/drm/panel/panel-simple.c > >> index a251361..adc40a7 100644 > >> --- a/drivers/gpu/drm/panel/panel-simple.c > >> +++ b/drivers/gpu/drm/panel/panel-simple.c > >> @@ -403,6 +403,80 @@ static const struct panel_desc edt_etm0700g0dh6 = { > >> }, > >> }; > >> > >> +static const struct drm_display_mode eukrea_mbimxsd51_cmoqvga_mode = { > >> + .clock = 6500, > >> + .hdisplay = 320, > >> + .hsync_start = 320 + 38, > >> + .hsync_end = 320 + 38 + 20, > >> + .htotal = 320 + 38 + 20 + 30, > >> + .vdisplay = 240, > >> + .vsync_start = 240 + 15, > >> + .vsync_end = 240 + 15 + 4, > >> + .vtotal = 240 + 15 + 4 + 3, > >> + .vrefresh = 60, > >> + .pol_flags = DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE | > >> + DRM_MODE_FLAG_POL_DE_LOW, > > Why aren't you using: > > Documentation/devicetree/bindings/video/display-timing.txt Because it's redundant information. We need to have a compatible for the panel in the device tree anyway and that already implicitly defines the display mode. Thierry pgpAUDrLB6ar1.pgp Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
On Tue, Jun 24, 2014 at 11:56:39PM +0200, Eric Bénard wrote: > Hi Thierry, > > Le Tue, 24 Jun 2014 23:49:37 +0200, > Thierry Reding a écrit : > > > On Mon, Jun 16, 2014 at 12:11:22PM +0200, Denis Carikli wrote: > > [...] > > > diff --git > > > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > > > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-svga.txt > > [...] > > > @@ -0,0 +1,7 @@ > > > +Eukrea DVI-SVGA (800x600 pixels) DVI output. > > [...] > > > diff --git > > > a/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > > > b/Documentation/devicetree/bindings/panel/eukrea,mbimxsd51-dvi-vga.txt > > [...] > > > @@ -0,0 +1,7 @@ > > > +Eukrea DVI-VGA (640x480 pixels) DVI output. > > > > DVI outputs shouldn't be using the panel framework and this binding at > > all. DVI usually has the means to determine all of this by itself. Why > > do you need to represent this as a panel in device tree? > > > because on this very simple display board, we only have DVI LVDS signals > without the I2C to detect the display. That's unfortunate. In that case perhaps a better approach would be to add a video timings node to the device that provides the DVI output? The panel bindings are really for internal panels and should define all of their properties. That's also why they need a specific compatible string. What the above two bindings define are really "connectors" with a fixed resolution rather than panels. Thierry pgpMPKP72dOIG.pgp Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: fix sparse warning
Clement Calmels writes: > From: Clément Calmels > > Found running sparse on the rtl8723au driver. > > CHECK drivers/staging/rtl8723au/core/rtw_cmd.c > drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54: warning: incorrect type in > argument 2 (different base types) > drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54:expected int [signed] gfp > drivers/staging/rtl8723au/core/rtw_cmd.c:1479:54:got restricted gfp_t > > Signed-off-by: Clement Calmels > --- > drivers/staging/rtl8723au/core/rtw_mlme.c| 2 +- > drivers/staging/rtl8723au/include/rtw_mlme.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Thanks, I'll add it to my tree! Cheers, Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 06/10] drm: drm_display_mode: add signal polarity flags
On Tue, Jun 24, 2014 at 03:57:46PM +0100, Russell King - ARM Linux wrote: > On Mon, Jun 16, 2014 at 12:11:20PM +0200, Denis Carikli wrote: > > We need a way to pass signal polarity informations > > between DRM panels, and the display drivers. > > > > To do that, a pol_flags field was added to drm_display_mode. > > > > Signed-off-by: Denis Carikli > > This patch needs an ack from the DRM people - can someone review it > please? This series has now been round 14 revisions and it's about > time it was properly reviewed - or a statement made if it's > unacceptable. I didn't follow all of the earlier discussions around this, but it seems to me like data-enable polarity and the pixel data edge flags are properties of the interface rather than the video mode. struct drm_display_mode represents the video timings and I'm not sure if it's a good idea to extend it with this type of information. Maybe we need to add a separate type of device to store these parameters (much like we've done for MIPI DSI devices). Thierry pgpJLEApSbzpD.pgp Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: gdm72xx: check return value of sscanf
Signed-off-by: Ben Chan --- drivers/staging/gdm72xx/gdm_wimax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index e5e5115..3081fd4 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -291,8 +291,9 @@ static void __gdm_wimax_event_send(struct work_struct *work) e = list_entry(wm_event.evtq.next, struct evt_entry, list); spin_unlock_irqrestore(&wm_event.evt_lock, flags); - sscanf(e->dev->name, "wm%d", &idx); - netlink_send(wm_event.sock, idx, 0, e->evt_data, e->size); + if (sscanf(e->dev->name, "wm%d", &idx) == 1) + netlink_send(wm_event.sock, idx, 0, e->evt_data, +e->size); spin_lock_irqsave(&wm_event.evt_lock, flags); list_del(&e->list); -- 2.0.0.526.g5318336 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 05/10] ARM: dts: imx5*, imx6*: correct display-timings nodes.
On Tue, Jun 24, 2014 at 04:01:58PM +0100, Russell King - ARM Linux wrote: > On Mon, Jun 16, 2014 at 12:11:19PM +0200, Denis Carikli wrote: > > The imx-drm driver can't use the de-active and > > pixelclk-active display-timings properties yet. > > > > Instead the data-enable and the pixel data clock > > polarity are hardcoded in the imx-drm driver. > > > > So theses properties are now set to keep > > the same behaviour when imx-drm will start > > using them. > > > > Signed-off-by: Denis Carikli > > This patch needs either an ack from the arm-soc/iMX maintainers, or > they need to merge it. As there's little positive agreement on the > series, I can understand why there's reluctance to merge it. > > So, can we start having some acks from people please, or at least > commitments to merge this patch when the others are deemed to be > acceptable. If not, can we have explanations why this should not > be merged. I will be happy to merge dts change through IMX tree once the binding/diver part gets accepted/applied. Shawn ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
ACPI Support for HP Pavillion laptops
Hi, I recently joined the Linux Driver Development mailing list and would like to contribute to the Linux Driver Project. Specifically, I would like to contribute by working on ACPI Support for HP Pavillion laptops (Referred list at http://www.linuxdriverproject.org/mediawiki/index.php/Drivers_Needed). Regarding this, I humbly seek answer to the following questions. 1). Is anyone currently working on this project? 2). If any kind of contribution is still needed, can anyone please provide me details? If there is any specialized mailing list regarding this, please direct me to there. Thanks, Chetal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging: rtl8712: remove wrapper function _init_listhead
_init_listhead is just an inline wrapper around INIT_LIST_HEAD. This patch removes the wrapper and directly uses INIT_LIST_HEAD instead. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |7 +-- drivers/staging/rtl8712/rtl8712_recv.c|4 ++-- drivers/staging/rtl8712/rtl871x_cmd.c |8 drivers/staging/rtl8712/rtl871x_cmd.h |2 +- drivers/staging/rtl8712/rtl871x_io.c |8 drivers/staging/rtl8712/rtl871x_mlme.c|6 +++--- drivers/staging/rtl8712/rtl871x_mp.c |2 +- drivers/staging/rtl8712/rtl871x_recv.c|2 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 14 +++--- drivers/staging/rtl8712/rtl871x_xmit.c| 12 ++-- 10 files changed, 30 insertions(+), 35 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 09e1561..17c28c8 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -54,7 +54,7 @@ struct__queue { #define _init_queue(pqueue)\ do {\ - _init_listhead(&((pqueue)->queue)); \ + INIT_LIST_HEAD(&((pqueue)->queue)); \ spin_lock_init(&((pqueue)->lock)); \ } while (0) @@ -137,11 +137,6 @@ static inline u32 _down_sema(struct semaphore *sema) return _SUCCESS; } -static inline void _init_listhead(struct list_head *list) -{ - INIT_LIST_HEAD(list); -} - static inline u32 _queue_empty(struct __queue *pqueue) { return is_list_empty(&(pqueue->queue)); diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 1f70017..f87a8fd 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -66,7 +66,7 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) ((addr_t) (precvpriv->pallocated_recv_buf) & 3); precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { - _init_listhead(&precvbuf->list); + INIT_LIST_HEAD(&precvbuf->list); spin_lock_init(&precvbuf->recvbuf_lock); res = r8712_os_recvbuf_resource_alloc(padapter, precvbuf); if (res == _FAIL) @@ -1061,7 +1061,7 @@ static int recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb) precvframe = r8712_alloc_recvframe(pfree_recv_queue); if (precvframe == NULL) goto _exit_recvbuf2recvframe; - _init_listhead(&precvframe->u.hdr.list); + INIT_LIST_HEAD(&precvframe->u.hdr.list); precvframe->u.hdr.precvbuf = NULL; /*can't access the precvbuf*/ precvframe->u.hdr.len = 0; tmp_len = pkt_len + drvinfo_sz + RXDESC_SIZE; diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 1775462..646c5cd 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -413,7 +413,7 @@ u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval) kfree((u8 *) ph2c); return _FAIL; } - _init_listhead(&ph2c->list); + INIT_LIST_HEAD(&ph2c->list); ph2c->cmdcode = GEN_CMD_CODE(_GetRFReg); ph2c->parmbuf = (unsigned char *)prdrfparm; ph2c->cmdsz = sizeof(struct readRF_parm); @@ -452,7 +452,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter) pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC); if (pcmd == NULL) return _FAIL; - _init_listhead(&pcmd->list); + INIT_LIST_HEAD(&pcmd->list); pcmd->cmdcode = _CreateBss_CMD_; pcmd->parmbuf = (unsigned char *)pdev_network; pcmd->cmdsz = r8712_get_ndis_wlan_bssid_ex_sz(( @@ -606,7 +606,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) psecnetwork->InfrastructureMode); psecnetwork->IELength = cpu_to_le32(psecnetwork->IELength); #endif - _init_listhead(&pcmd->list); + INIT_LIST_HEAD(&pcmd->list); pcmd->cmdcode = _JoinBss_CMD_; pcmd->parmbuf = (unsigned char *)psecnetwork; pcmd->rsp = NULL; @@ -758,7 +758,7 @@ u8 r8712_gettssi_cmd(struct _adapter *padapter, u8 offset, u8 *pval) kfree((unsigned char *) ph2c); return _FAIL; } - _init_listhead(&ph2c->list); + INIT_LIST_HEAD(&ph2c->list); ph2c->cmdcode = GEN_CMD_CODE(_ReadTSSI); ph2c->parmbuf = (unsigned char *)prdtssiparm; ph2c->cmdsz = sizeof(struct readTSSI_parm); diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index 0ce79b1..cb8225b 100644 ---
[PATCH 2/8] staging: rtl8712: remove wrapper function is_list_empty
is_list_empty is just an inline wrapper around list_empty. This patch removes the wrapper and directly uses list_empty instead. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h | 10 +- drivers/staging/rtl8712/rtl8712_recv.c |4 ++-- drivers/staging/rtl8712/rtl871x_cmd.c |2 +- drivers/staging/rtl8712/rtl871x_xmit.c |2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 17c28c8..58f2090 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -115,14 +115,6 @@ For the following list_xxx operations, caller must guarantee the atomic context. Otherwise, there will be racing condition. */ -static inline u32 is_list_empty(struct list_head *phead) -{ - if (list_empty(phead)) - return true; - else - return false; -} - static inline void list_insert_tail(struct list_head *plist, struct list_head *phead) { @@ -139,7 +131,7 @@ static inline u32 _down_sema(struct semaphore *sema) static inline u32 _queue_empty(struct __queue *pqueue) { - return is_list_empty(&(pqueue->queue)); + return list_empty(&(pqueue->queue)); } static inline u32 end_of_queue_search(struct list_head *head, diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index f87a8fd..22840a1 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -532,7 +532,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, plist = get_next(phead); /* Handling some condition for forced indicate case.*/ if (bforced == true) { - if (is_list_empty(phead)) + if (list_empty(phead)) return true; else { prframe = LIST_CONTAINOR(plist, union recv_frame, u); @@ -542,7 +542,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, } /* Prepare indication list and indication. * Check if there is any packet need indicate. */ - while (!is_list_empty(phead)) { + while (!list_empty(phead)) { prframe = LIST_CONTAINOR(plist, union recv_frame, u); pattrib = &prframe->u.hdr.attrib; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 646c5cd..689364d 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -137,7 +137,7 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue) struct cmd_obj *obj; spin_lock_irqsave(&(queue->lock), irqL); - if (is_list_empty(&(queue->queue))) + if (list_empty(&(queue->queue))) obj = NULL; else { obj = LIST_CONTAINOR(get_next(&(queue->queue)), diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 68bfab0..989fb67 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -939,7 +939,7 @@ sint r8712_xmit_classifier(struct _adapter *padapter, ptxservq = get_sta_pending(padapter, &pstapending, psta, pattrib->priority); spin_lock_irqsave(&pstapending->lock, irqL0); - if (is_list_empty(&ptxservq->tx_pending)) + if (list_empty(&ptxservq->tx_pending)) list_insert_tail(&ptxservq->tx_pending, get_list_head(pstapending)); list_insert_tail(&pxmitframe->list, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/8] staging: rtl8712: remove wrapper function list_insert_tail
list_insert_tail is just an inline wrapper around list_add_tail. This patch removes the wrapper and directly uses list_add_tail. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |6 -- drivers/staging/rtl8712/rtl8712_recv.c| 10 +- drivers/staging/rtl8712/rtl871x_cmd.c |6 +++--- drivers/staging/rtl8712/rtl871x_io.c |2 +- drivers/staging/rtl8712/rtl871x_mlme.c|8 drivers/staging/rtl8712/rtl871x_mp.c |2 +- drivers/staging/rtl8712/rtl871x_recv.c|2 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c |6 +++--- drivers/staging/rtl8712/rtl871x_xmit.c| 12 ++-- 9 files changed, 24 insertions(+), 30 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 58f2090..bc5e922 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -115,12 +115,6 @@ For the following list_xxx operations, caller must guarantee the atomic context. Otherwise, there will be racing condition. */ -static inline void list_insert_tail(struct list_head *plist, - struct list_head *phead) -{ - list_add_tail(plist, phead); -} - static inline u32 _down_sema(struct semaphore *sema) { if (down_interruptible(sema)) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 22840a1..b510312 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -73,7 +73,7 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) break; precvbuf->ref_cnt = 0; precvbuf->adapter = padapter; - list_insert_tail(&precvbuf->list, + list_add_tail(&precvbuf->list, &(precvpriv->free_recv_buf_queue.queue)); precvbuf++; } @@ -146,7 +146,7 @@ int r8712_free_recvframe(union recv_frame *precvframe, } spin_lock_irqsave(&pfree_recv_queue->lock, irqL); list_delete(&(precvframe->u.hdr.list)); - list_insert_tail(&(precvframe->u.hdr.list), + list_add_tail(&(precvframe->u.hdr.list), get_list_head(pfree_recv_queue)); if (padapter != NULL) { if (pfree_recv_queue == &precvpriv->free_recv_queue) @@ -297,7 +297,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter, } /* Then enqueue the 0~(n-1) fragment to the defrag_q */ phead = get_list_head(pdefrag_q); - list_insert_tail(&pfhdr->list, phead); + list_add_tail(&pfhdr->list, phead); prtnframe = NULL; } else { /* can't find this ta's defrag_queue, so free this @@ -312,7 +312,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter, * enqueue the last fragment */ if (pdefrag_q != NULL) { phead = get_list_head(pdefrag_q); - list_insert_tail(&pfhdr->list, phead); + list_add_tail(&pfhdr->list, phead); /*call recvframe_defrag to defrag*/ precv_frame = recvframe_defrag(padapter, pdefrag_q); prtnframe = precv_frame; @@ -512,7 +512,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, break; } list_delete(&(prframe->u.hdr.list)); - list_insert_tail(&(prframe->u.hdr.list), plist); + list_add_tail(&(prframe->u.hdr.list), plist); return true; } diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 689364d..cae8ee6 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -126,7 +126,7 @@ static sint _enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) if (obj == NULL) return _SUCCESS; spin_lock_irqsave(&queue->lock, irqL); - list_insert_tail(&obj->list, &queue->queue); + list_add_tail(&obj->list, &queue->queue); spin_unlock_irqrestore(&queue->lock, irqL); return _SUCCESS; } @@ -190,7 +190,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj) return _FAIL; queue = &pcmdpriv->cmd_queue; spin_lock_irqsave(&queue->lock, irqL); - list_insert_tail(&obj->list, &queue->queue); + list_add_tail(&obj->list, &queue->queue); spin_unlock_irqrestore(&queue->lock, irqL); up(&pcmdpriv->cmd_queue_sema); return _SUCCESS; @@ -956,7 +956,7 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter, goto createbss_
[PATCH 8/8] staging: rtl8712: remove inapplicable comment
Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 77b1443..3dfc473 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -95,11 +95,6 @@ static inline void _set_workitem(_workitem *pwork) #define BIT(x) (1 << (x)) #endif -/* -For the following list_xxx operations, -caller must guarantee the atomic context. -Otherwise, there will be racing condition. -*/ static inline u32 _down_sema(struct semaphore *sema) { if (down_interruptible(sema)) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging: rtl8712: remove wrapper function get_next
get_next is just an inline wrapper around return list->next. This patch removes the wrapper and directly uses list->next where applicable. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |5 - drivers/staging/rtl8712/rtl8712_recv.c| 14 +++--- drivers/staging/rtl8712/rtl8712_xmit.c| 10 ++ drivers/staging/rtl8712/rtl871x_cmd.c |2 +- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 drivers/staging/rtl8712/rtl871x_ioctl_set.c |2 +- drivers/staging/rtl8712/rtl871x_mlme.c| 22 +++--- drivers/staging/rtl8712/rtl871x_recv.c|6 +++--- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 14 +++--- drivers/staging/rtl8712/rtl871x_xmit.c|8 10 files changed, 48 insertions(+), 51 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 1a137ce..4f30c4c 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -58,11 +58,6 @@ struct __queue { spin_lock_init(&((pqueue)->lock)); \ } while (0) -static inline struct list_head *get_next(struct list_head *list) -{ - return list->next; -} - static inline struct list_head *get_list_head(struct __queue *queue) { return &(queue->queue); diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 3c9d2e0..a5f41f4 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -209,7 +209,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, pfree_recv_queue = &adapter->recvpriv.free_recv_queue; phead = get_list_head(defrag_q); - plist = get_next(phead); + plist = phead->next; prframe = LIST_CONTAINOR(plist, union recv_frame, u); list_del_init(&prframe->u.list); pfhdr = &prframe->u.hdr; @@ -223,7 +223,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, } curfragnum++; plist = get_list_head(defrag_q); - plist = get_next(plist); + plist = plist->next; data = get_recvframe_data(prframe); while (end_of_queue_search(phead, plist) == false) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); @@ -247,7 +247,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len); recvframe_put(prframe, pnfhdr->len); pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len; - plist = get_next(plist); + plist = plist->next; } /* free the defrag_q queue and return the prframe */ r8712_free_recvframe_queue(defrag_q, pfree_recv_queue); @@ -500,12 +500,12 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; phead = get_list_head(ppending_recvframe_queue); - plist = get_next(phead); + plist = phead->next; while (end_of_queue_search(phead, plist) == false) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextattrib = &pnextrframe->u.hdr.attrib; if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) - plist = get_next(plist); + plist = plist->next; else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) return false; else @@ -529,7 +529,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, &preorder_ctrl->pending_recvframe_queue; phead = get_list_head(ppending_recvframe_queue); - plist = get_next(phead); + plist = phead->next; /* Handling some condition for forced indicate case.*/ if (bforced == true) { if (list_empty(phead)) @@ -546,7 +546,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, prframe = LIST_CONTAINOR(plist, union recv_frame, u); pattrib = &prframe->u.hdr.attrib; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { - plist = get_next(plist); + plist = plist->next; list_del_init(&(prframe->u.hdr.list)); if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index 56aa209..c4078fa 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_f
[PATCH 7/8] staging: rtl8712: remove wrapper function _queue_empty
_queue_empty is an inline wrapper around list_empty. This patch removes this wrapper function and instead calls list_empty directly. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |5 - drivers/staging/rtl8712/rtl8712_cmd.c |2 +- drivers/staging/rtl8712/rtl8712_recv.c |2 +- drivers/staging/rtl8712/rtl8712_xmit.c |2 +- drivers/staging/rtl8712/rtl871x_ioctl_set.c |2 +- drivers/staging/rtl8712/rtl871x_mlme.c |4 ++-- drivers/staging/rtl8712/rtl871x_recv.c |2 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c |2 +- drivers/staging/rtl8712/rtl871x_xmit.c |4 ++-- 9 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index cb279b9..77b1443 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -108,11 +108,6 @@ static inline u32 _down_sema(struct semaphore *sema) return _SUCCESS; } -static inline u32 _queue_empty(struct __queue *pqueue) -{ - return list_empty(&(pqueue->queue)); -} - static inline u32 end_of_queue_search(struct list_head *head, struct list_head *plist) { diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c index 8ca7d7e..1d81d2c 100644 --- a/drivers/staging/rtl8712/rtl8712_cmd.c +++ b/drivers/staging/rtl8712/rtl8712_cmd.c @@ -410,7 +410,7 @@ _next: } } r8712_free_cmd_obj(pcmd); - if (_queue_empty(&(pcmdpriv->cmd_queue))) { + if (list_empty(&pcmdpriv->cmd_queue.queue)) { r8712_unregister_cmd_alive(padapter); continue; } else diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index b759c9b..f0ec89c 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -288,7 +288,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter, if (pdefrag_q != NULL) { if (fragnum == 0) { /*the first fragment*/ - if (_queue_empty(pdefrag_q) == false) { + if (!list_empty(&pdefrag_q->queue)) { /*free current defrag_q */ r8712_free_recvframe_queue(pdefrag_q, pfree_recv_queue); diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index f3d2998..4ebedb4 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -224,7 +224,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, } sta_plist = sta_plist->next; /*Remove sta node when there are no pending packets.*/ - if (_queue_empty(pframe_queue)) { + if (list_empty(&pframe_queue->queue)) { /* must be done after sta_plist->next * and before break */ diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 226f247..9d47eb4 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -71,7 +71,7 @@ static u8 do_join(struct _adapter *padapter) /* adhoc mode will start with an empty queue, but skip checking */ if (!check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) && - _queue_empty(queue)) { + list_empty(&queue->queue)) { if (pmlmepriv->fw_state & _FW_UNDER_LINKING) pmlmepriv->fw_state ^= _FW_UNDER_LINKING; /* when set_ssid/set_bssid for do_join(), but scanning queue diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index d37ba7b..7b7fdec 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -89,7 +89,7 @@ struct wlan_network *_r8712_alloc_network(struct mlme_priv *pmlmepriv) struct __queue *free_queue = &pmlmepriv->free_bss_pool; struct list_head *plist = NULL; - if (_queue_empty(free_queue) == true) + if (list_empty(&free_queue->queue)) return NULL; spin_lock_irqsave(&free_queue->lock, irqL); plist = free_queue->queue.next; @@ -420,7 +420,7 @@ static void update_scanned_network(struct _adapter *adapter, /* If we didn't find a match, then get a new network slot to initialize * with this beacon's informat
[PATCH 6/8] staging: rtl8712: remove function get_list_head
get_list_head is an inline that returns &list->head. This patch removes this inline and directly applies &list->head where applicable. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |5 - drivers/staging/rtl8712/rtl8712_recv.c| 15 +++ drivers/staging/rtl8712/rtl8712_xmit.c|4 ++-- drivers/staging/rtl8712/rtl871x_ioctl_linux.c |8 drivers/staging/rtl8712/rtl871x_ioctl_set.c |2 +- drivers/staging/rtl8712/rtl871x_mlme.c| 12 ++-- drivers/staging/rtl8712/rtl871x_recv.c|4 ++-- drivers/staging/rtl8712/rtl871x_sta_mgt.c |7 +++ drivers/staging/rtl8712/rtl871x_xmit.c| 16 +++- 9 files changed, 32 insertions(+), 41 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 4f30c4c..cb279b9 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -58,11 +58,6 @@ struct __queue { spin_lock_init(&((pqueue)->lock)); \ } while (0) -static inline struct list_head *get_list_head(struct __queue *queue) -{ - return &(queue->queue); -} - #define LIST_CONTAINOR(ptr, type, member) \ ((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member))) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index a5f41f4..b759c9b 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -146,8 +146,7 @@ int r8712_free_recvframe(union recv_frame *precvframe, } spin_lock_irqsave(&pfree_recv_queue->lock, irqL); list_del_init(&(precvframe->u.hdr.list)); - list_add_tail(&(precvframe->u.hdr.list), -get_list_head(pfree_recv_queue)); + list_add_tail(&(precvframe->u.hdr.list), &pfree_recv_queue->queue); if (padapter != NULL) { if (pfree_recv_queue == &precvpriv->free_recv_queue) precvpriv->free_recvframe_cnt++; @@ -208,7 +207,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, struct __queue *pfree_recv_queue; pfree_recv_queue = &adapter->recvpriv.free_recv_queue; - phead = get_list_head(defrag_q); + phead = &defrag_q->queue; plist = phead->next; prframe = LIST_CONTAINOR(plist, union recv_frame, u); list_del_init(&prframe->u.list); @@ -222,7 +221,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, return NULL; } curfragnum++; - plist = get_list_head(defrag_q); + plist = &defrag_q->queue; plist = plist->next; data = get_recvframe_data(prframe); while (end_of_queue_search(phead, plist) == false) { @@ -296,7 +295,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter, } } /* Then enqueue the 0~(n-1) fragment to the defrag_q */ - phead = get_list_head(pdefrag_q); + phead = &pdefrag_q->queue; list_add_tail(&pfhdr->list, phead); prtnframe = NULL; } else { @@ -311,7 +310,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter, /* the last fragment frame * enqueue the last fragment */ if (pdefrag_q != NULL) { - phead = get_list_head(pdefrag_q); + phead = &pdefrag_q->queue; list_add_tail(&pfhdr->list, phead); /*call recvframe_defrag to defrag*/ precv_frame = recvframe_defrag(padapter, pdefrag_q); @@ -499,7 +498,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, &preorder_ctrl->pending_recvframe_queue; struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; - phead = get_list_head(ppending_recvframe_queue); + phead = &ppending_recvframe_queue->queue; plist = phead->next; while (end_of_queue_search(phead, plist) == false) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); @@ -528,7 +527,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; - phead = get_list_head(ppending_recvframe_queue); + phead = &ppending_recvframe_queue->queue; plist = phead->next; /* Handling some condition for forced indicate case.*/ if (bforced == true) { diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index c4078fa..f3d2998 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit
[PATCH 4/8] staging: rtl8712: remove wrapper function list_delete
list_delete is just an inline wrapper around list_del_init. This patch removes the wrapper and directly uses list_del_init. Signed-off-by: James A Shackleford --- drivers/staging/rtl8712/osdep_service.h |5 - drivers/staging/rtl8712/rtl8712_recv.c|8 drivers/staging/rtl8712/rtl8712_xmit.c|4 ++-- drivers/staging/rtl8712/rtl871x_cmd.c |2 +- drivers/staging/rtl8712/rtl871x_mlme.c|6 +++--- drivers/staging/rtl8712/rtl871x_recv.c|2 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 12 ++-- drivers/staging/rtl8712/rtl871x_xmit.c|8 8 files changed, 21 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index bc5e922..1a137ce 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -71,11 +71,6 @@ static inline struct list_head *get_list_head(struct __queue *queue) #define LIST_CONTAINOR(ptr, type, member) \ ((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member))) -static inline void list_delete(struct list_head *plist) -{ - list_del_init(plist); -} - static inline void _init_timer(struct timer_list *ptimer, struct net_device *padapter, void *pfunc, void *cntx) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index b510312..3c9d2e0 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -145,7 +145,7 @@ int r8712_free_recvframe(union recv_frame *precvframe, precvframe->u.hdr.pkt = NULL; } spin_lock_irqsave(&pfree_recv_queue->lock, irqL); - list_delete(&(precvframe->u.hdr.list)); + list_del_init(&(precvframe->u.hdr.list)); list_add_tail(&(precvframe->u.hdr.list), get_list_head(pfree_recv_queue)); if (padapter != NULL) { @@ -211,7 +211,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, phead = get_list_head(defrag_q); plist = get_next(phead); prframe = LIST_CONTAINOR(plist, union recv_frame, u); - list_delete(&prframe->u.list); + list_del_init(&prframe->u.list); pfhdr = &prframe->u.hdr; curfragnum = 0; if (curfragnum != pfhdr->attrib.frag_num) { @@ -511,7 +511,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, else break; } - list_delete(&(prframe->u.hdr.list)); + list_del_init(&(prframe->u.hdr.list)); list_add_tail(&(prframe->u.hdr.list), plist); return true; } @@ -547,7 +547,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, pattrib = &prframe->u.hdr.attrib; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { plist = get_next(plist); - list_delete(&(prframe->u.hdr.list)); + list_del_init(&(prframe->u.hdr.list)); if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) preorder_ctrl->indicate_seq = diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index 4e3f094..56aa209 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -171,7 +171,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); - list_delete(&pxmitframe->list); + list_del_init(&pxmitframe->list); ptxservq->qcnt--; phwxmit->txcmdcnt++; } @@ -226,7 +226,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, /*Remove sta node when there are no pending packets.*/ if (_queue_empty(pframe_queue)) { /*must be done after get_next and before break*/ - list_delete(&ptxservq->tx_pending); + list_del_init(&ptxservq->tx_pending); } } } diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index cae8ee6..338bb14 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -142,7 +142,7 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue) else { obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list); - list_delete(&obj->list); + list_del_
great proposition for us.
Good day, I have something of importance which you will be interested in, it will be my utmost appreciation if you contact me so I can furnish you with details. Roberts ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 04/10] imx-drm: use defines for clock polarity settings
On Mon, Jun 16, 2014 at 12:11:18PM +0200, Denis Carikli wrote: > Signed-off-by: Denis Carikli > --- > ChangeLog v13->v14: > - Rebased > ChangeLog 12->v13: > - No changes > ChangeLog 11->v12: > - Improved the define names to match the hardware: > ENABLE_POL is not a clock signal but instead an enable signal. > > ChangeLog v9->v10: > - New patch which was splitted out from: > "staging: imx-drm: Use de-active and pixelclk-active display-timings.". > - Fixes many issues in "staging: imx-drm: Use de-active and pixelclk-active > display-timings.": > - More clear meaning of the polarity settings. > - The SET_CLK_POL and SET_DE_POL masks are not > needed anymore. > --- > drivers/gpu/ipu-v3/ipu-di.c |4 ++-- > drivers/staging/imx-drm/ipuv3-crtc.c |4 ++-- > include/video/imx-ipu-v3.h |8 +++- > 3 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c > index c490ba4..d00f357 100644 > --- a/drivers/gpu/ipu-v3/ipu-di.c > +++ b/drivers/gpu/ipu-v3/ipu-di.c > @@ -595,7 +595,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct > ipu_di_signal_cfg *sig) > } > } > > - if (sig->clk_pol) > + if (sig->clk_pol == CLK_POL_POSEDGE) > di_gen |= DI_GEN_POLARITY_DISP_CLK; > > ipu_di_write(di, di_gen, DI_GENERAL); > @@ -606,7 +606,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct > ipu_di_signal_cfg *sig) > reg = ipu_di_read(di, DI_POL); > reg &= ~(DI_POL_DRDY_DATA_POLARITY | DI_POL_DRDY_POLARITY_15); > > - if (sig->enable_pol) > + if (sig->enable_pol == ENABLE_POL_HIGH) > reg |= DI_POL_DRDY_POLARITY_15; > if (sig->data_pol) > reg |= DI_POL_DRDY_DATA_POLARITY; > diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c > b/drivers/staging/imx-drm/ipuv3-crtc.c > index 720868b..7fec438 100644 > --- a/drivers/staging/imx-drm/ipuv3-crtc.c > +++ b/drivers/staging/imx-drm/ipuv3-crtc.c > @@ -165,8 +165,8 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc, > if (mode->flags & DRM_MODE_FLAG_PVSYNC) > sig_cfg.Vsync_pol = 1; > > - sig_cfg.enable_pol = 1; > - sig_cfg.clk_pol = 0; > + sig_cfg.enable_pol = ENABLE_POL_HIGH; > + sig_cfg.clk_pol = CLK_POL_NEGEDGE; > sig_cfg.width = mode->hdisplay; > sig_cfg.height = mode->vdisplay; > sig_cfg.pixel_fmt = out_pixel_fmt; > diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h > index 3e43e22..305 100644 > --- a/include/video/imx-ipu-v3.h > +++ b/include/video/imx-ipu-v3.h > @@ -27,6 +27,12 @@ enum ipuv3_type { > > #define IPU_PIX_FMT_GBR24v4l2_fourcc('G', 'B', 'R', '3') > > +#define CLK_POL_NEGEDGE 0 > +#define CLK_POL_POSEDGE 1 > + > +#define ENABLE_POL_LOW 0 > +#define ENABLE_POL_HIGH 1 Adding defines without a proper namespace (IPU_) outside a driver private header file is not nice. Anyway, instead of adding the defines ... > + > /* > * Bitfield of Display Interface signal polarities. > */ > @@ -37,7 +43,7 @@ struct ipu_di_signal_cfg { > unsigned clksel_en:1; > unsigned clkidle_en:1; > unsigned data_pol:1;/* true = inverted */ > - unsigned clk_pol:1; /* true = rising edge */ > + unsigned clk_pol:1; > unsigned enable_pol:1; > unsigned Hsync_pol:1; /* true = active high */ > unsigned Vsync_pol:1; ...can we rename the flags to more meaningful names instead? unsigned clk_pol_rising_edge:1; unsigned enable_pol_high:1; unsigned hsync_active_high:1; unsigned vsync_active_high:1; Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel