Re: [PATCH] Check if skb_alloc returns Null in function fw_download_code
On Mon, Jun 16, 2014 at 11:23:13PM -0400, Nicholas Krause wrote: > Signed-off-by: Nicholas Krause > --- > drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > index 1a95d1f..11e915e 100644 > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > @@ -61,11 +61,13 @@ static bool fw_download_code(struct net_device *dev, u8 > *code_virtual_address, > } > > skb = dev_alloc_skb(frag_length + 4); > + if (!skb) { This test is reversed and causes a NULL dereference on the next line. regards, dan carpenter > memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev)); > tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); > tcb_desc->queue_index = TXCMD_QUEUE; > tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT; > tcb_desc->bLastIniPkt = bLastIniPkt; > + } > > seg_ptr = skb->data; > for (i = 0; i < frag_length; i += 4) { > -- > 1.9.1 > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate
On Tue, Jun 17, 2014 at 12:14:18AM +0200, Rickard Strandqvist wrote: > 2014-06-16 21:09 GMT+02:00 Dan Carpenter : > > On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: > >> > >> No one calls U14DriverName() so just delete this function. > > > > Oh. This is a userspace library or something? I'm not sure what to do. > > > > How did you compile test this? Does your platform even provide > > strlcpy()? > > > > Anyway, don't delete it like I said, but I still don't think your patch > > helps here. > > > > regards, > > dan carpenter > > > > Hi > > I saw that these functions are not used, had planned type it in the > cover letter to :-( > > Thought of userspec, but then it should definitely ensure the NULL char? The strings are always 4 characters long. If the user start passing 3 character buffers then it will *never* work. That means the bug will be caught on the first run in testing. I don't worry about those kinds of bugs very much. It's only a concern if it works 99 times and fails 1 time. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Check if skb_alloc returns Null in function fw_download_code
On Mon, Jun 16, 2014 at 09:07:45PM -0700, Greg KH wrote: > On Mon, Jun 16, 2014 at 11:23:13PM -0400, Nicholas Krause wrote: > > Signed-off-by: Nicholas Krause > > --- > > drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > > b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > > index 1a95d1f..11e915e 100644 > > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > > @@ -61,11 +61,13 @@ static bool fw_download_code(struct net_device *dev, > > u8 *code_virtual_address, > >} > > > >skb = dev_alloc_skb(frag_length + 4); > > + if (!skb) { > >memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev)); > >tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); > >tcb_desc->queue_index = TXCMD_QUEUE; > >tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT; > >tcb_desc->bLastIniPkt = bLastIniPkt; > > + } > > > > Please run your patches through scripts/checkpatch.pl to find the errors > before sending them out and having someone else point them out to you... I suspect checkpatch would pick up the indentation mess, but indentation is the least of this patch's problems. if that alloc_skb fails, going around the loop again is pointless, and harmful. (we'll oops right below that added bracket). on failure, this should be returning 0 so that the caller handles the failure appropriately. Dave ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Check if skb_alloc returns Null in function fw_download_code
On Mon, Jun 16, 2014 at 11:23:13PM -0400, Nicholas Krause wrote: > Signed-off-by: Nicholas Krause > --- > drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > index 1a95d1f..11e915e 100644 > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c > @@ -61,11 +61,13 @@ static bool fw_download_code(struct net_device *dev, u8 > *code_virtual_address, > } > > skb = dev_alloc_skb(frag_length + 4); > + if (!skb) { > memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev)); > tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); > tcb_desc->queue_index = TXCMD_QUEUE; > tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT; > tcb_desc->bLastIniPkt = bLastIniPkt; > + } > Please run your patches through scripts/checkpatch.pl to find the errors before sending them out and having someone else point them out to you... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Check if skb_alloc returns Null in function fw_download_code
Signed-off-by: Nicholas Krause --- drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c index 1a95d1f..11e915e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c @@ -61,11 +61,13 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, } skb = dev_alloc_skb(frag_length + 4); + if (!skb) { memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev)); tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); tcb_desc->queue_index = TXCMD_QUEUE; tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT; tcb_desc->bLastIniPkt = bLastIniPkt; + } seg_ptr = skb->data; for (i = 0; i < frag_length; i += 4) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] mfd: rtsx: add dma transfer function
On 06/16/2014 08:20 PM, Lee Jones wrote: I don't see any glaring issues with this patch. Does it rely on the first patch, or vise versa, or can it just be applied? Hi Jones, [PATCH 2/2] need function defined in [PATCH 1/2], so we provide interface in [mfd] and called in [mmc]. Best Regards. micky. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] mmc: rtsx: add support for async request
On 06/16/2014 08:40 PM, Ulf Hansson wrote: On 16 June 2014 11:09, micky wrote: On 06/16/2014 04:42 PM, Ulf Hansson wrote: @@ -36,7 +37,10 @@ struct realtek_pci_sdmmc { struct rtsx_pcr *pcr; struct mmc_host *mmc; struct mmc_request *mrq; + struct workqueue_struct *workq; +#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" + struct work_struct work; I am trying to understand why you need a work/workqueue to implement this feature. Is that really the case? Could you elaborate on the reasons? Hi Uffe, we need return as fast as possible in mmc_host_ops request(ops->request) callback, so the mmc core can continue handle next request. when next request everything is ready, it will wait previous done(if not done), then call ops->request(). we can't use atomic context, because we use mutex_lock() to protect ops->request should never executed in atomic context. Is that your concern? Yes. resource, and we have to hold the lock during handle request. So I use workq, we just queue a work and return in ops->request(), The mmc core can continue without blocking at ops->request(). Best Regards. micky. Kind regards Uffe . ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate
2014-06-16 21:09 GMT+02:00 Dan Carpenter : > On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: >> >> No one calls U14DriverName() so just delete this function. > > Oh. This is a userspace library or something? I'm not sure what to do. > > How did you compile test this? Does your platform even provide > strlcpy()? > > Anyway, don't delete it like I said, but I still don't think your patch > helps here. > > regards, > dan carpenter > Hi I saw that these functions are not used, had planned type it in the cover letter to :-( Thought of userspec, but then it should definitely ensure the NULL char? Kind regards Rickard Strandqvist ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] imx-drm: imx-hdmi: fix hdmi hotplug detection initial state
On Mon, Jun 16, 2014 at 11:13:02AM -0300, Fabio Estevam wrote: > On Wed, Jun 11, 2014 at 5:17 AM, Russell King - ARM Linux > wrote: > > > The problem here is that we need more inteligence from CCF in order to > > do that - we need it to be able to reprogram the dividers so that the > > IPU DI0 clock remains at 148.5MHz while increasing the output of > > pll5_video_div three-fold. > > > > Another solution would be to source the LDB clock from PLL3 at 480MHz, > > this gives a pixel clock of 68.6MHz (3sf). The other options are > > Ok, I have tried this approach: > > --- a/arch/arm/mach-imx/clk-imx6q.c > +++ b/arch/arm/mach-imx/clk-imx6q.c > @@ -441,8 +441,8 @@ static void __init imx6q_clocks_init(struct device_node > *ccm > > if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || > cpu_is_imx6dl()) { > - clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); > - clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); > + clk_set_parent(clk[ldb_di0_sel], clk[pll3_usb_otg]); > + clk_set_parent(clk[ldb_di1_sel], clk[pll3_usb_otg]); > } > > and it allows HDMI and LVDS to be displayed if I boot with the HDMI > kernel connected. Would this be an acceptable solution in the > meantime? I have no objection to that as an interim solution, but it does leave me wondering whether this causes LDB to change the USB OTG clocks. Might it be worth printing something, just in case someone finds USB OTG breaks and wonders why? -- 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] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate
On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: > > No one calls U14DriverName() so just delete this function. Oh. This is a userspace library or something? I'm not sure what to do. How did you compile test this? Does your platform even provide strlcpy()? Anyway, don't delete it like I said, but I still don't think your patch helps here. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate
On Sun, Jun 15, 2014 at 12:41:47AM +0200, Rickard Strandqvist wrote: > Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Generally in the kernel we allow strncpy() if people want to use it. Let's not start doing sed replacements of these if it doesn't cause a problem. Also strncpy() always writes n number of bytes. If the source string is not long enough then NUL characters are written. This is sometimes important to prevent information leaks so switching to strcpy() can cause security bugs. > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/ced1401/userspace/use1401.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/ced1401/userspace/use1401.c > b/drivers/staging/ced1401/userspace/use1401.c > index 7b8a222..98d0301 100644 > --- a/drivers/staging/ced1401/userspace/use1401.c > +++ b/drivers/staging/ced1401/userspace/use1401.c > @@ -693,7 +693,7 @@ U14API(short) U14DriverName(short hand, char* pBuf, > unsigned short wMax) > case 3: pName = "HSS"; break; > default: pName = "???"; break; > } > -strncpy(pBuf, pName, wMax);// Copy the correct name to return > +strlcpy(pBuf, pName, wMax);/* Copy the correct name to > return */ > > return U14ERR_NOERROR; > } No one calls U14DriverName() so just delete this function. > @@ -1079,7 +1079,7 @@ U14API(short) U14NameOf1401(short hand, char* pBuf, > unsigned short wMax) > case U14TYPEPOWER3:pName = "Power1401-3"; break; > default: pName = "Unknown"; > } > -strncpy(pBuf, pName, wMax); > +strlcpy(pBuf, pName, wMax); > } > return sErr; > } Same thing. Just delete the whole function. > @@ -2891,10 +2891,8 @@ U14API(unsigned int) U14Ld(short hand, const char* vl, > const char* str) > ++dwIndex; // Keep count of command > number, first is 1 > szFName[iLoop2]=(char)0;// null terminate name of > command > > -strncpy(szLastName, szFName, sizeof(szLastName));// Save > for error info > -szLastName[sizeof(szLastName)-1] = 0; > -strncat(szLastName, szFExt, sizeof(szLastName)); // with > extension included > -szLastName[sizeof(szLastName)-1] = 0; > +strlcpy(szLastName, szFName, sizeof(szLastName)); /* Save > for error info */ > +strlcat(szLastName, szFExt, sizeof(szLastName)); /* with > extension included */ > > U14SendString(hand, szFName); // ask if loaded > U14SendString(hand, ";ERR;"); // add err return Delete again. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/5] staging/wlags49_h2: correct check of the return value of register_netdev()
On Mon, Jun 16, 2014 at 04:50:51PM +0200, Stephan Gabert wrote: > As mentioned in net/core/dev.c register_netdev() explicitly returns a > negative errno code on failure. > > So in case of failure, one should rather test whether ret is negative > than just unlike 0. No. In the kernel the normal way is to say: if (ret) return ret; Zero is succes and non-zero is error code. if (ret != 0) return ret; That's a double negative and pointlessly confusing. if (ret != 0 != 0 != 0) That's a hextuple negative and awesomely confusing. There are times where a double negative is ok. When you are talking about numbers specifically: if (ret != 0 && ret != 3) { That means ret is not zero or three, but zero doesn't mean success or failure, it's just a number. For strcmp() functions you should always compare against zero because that is the idiom. if (strcmp(foo, bar) < 0) if (strcmp(foo, bar) != 0) The first "<" means "foo" is before "bar" and "!=" means not equal. if (ret < 0) return ret; Probably means that now ret is either zero or a positive value??? It is ambiguous. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: remove non-ascii-characters from HalBtc8812a1Ant.c
On 06/16/2014 10:49 AM, Dan Carpenter wrote: > On Sat, Jun 14, 2014 at 08:56:34PM +0200, Toralf Förster wrote: >> those characters breaks the html-formatter tool of Cppcheck >> > > Cppcheck should be fixed. > >> Signed-off-by: Toralf Förster >> --- >> drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c | 16 >> 1 file changed, 8 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c >> b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c >> index 5a54bb1..e7fa7f4 100644 >> --- a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c >> +++ b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c >> @@ -1670,7 +1670,7 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( >> if (dn <= 0) >> dn = 0; >> >> -if(up >= n) // if ?s?? n ??2?? retry count??0, >> ?h?ռeWiFi duration >> +if(up >= n) // > > Leaving an empty comment just to annoy checkpatch.pl is a pointless > thing. > > These are Chinese comments. According to google translate it means: > "if consecutive n-2 seconds retry count is 0, width-modulated WiFi duration" > > Git hub has a better html generator than cppcheck so you can admire the > original Chinese characters and cut and paste. > https://github.com/Canonical-kernel/Ubuntu-kernel/blob/master/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c > > regarsd, > dan carpenter > > yep - 2nd version sent out -- Toralf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH]v2 staging: remove 1 CR and few more non-ascii characters from HalBtc8812a1Ant.c
comments were translated with https://translate.google.com/ this enables python to parse that file right Signed-off-by: Toralf Förster --- drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c index 5a54bb1..3060e4e 100644 --- a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c +++ b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c @@ -1670,7 +1670,7 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( if (dn <= 0) dn = 0; - if(up >= n) // if �s�� n ��2�� retry count��0, �h�ռeWiFi duration + if(up >= n) // Google translated: if consecutive n-2 seconds retry count is 0, width-modulated WiFi duration { wait_count = 0; n = 3; @@ -1688,14 +1688,14 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( if (up <= 0) up = 0; - if (dn == 2)// if �s�� 2 ��2�� retry count< 3, �h�կ�WiFi duration + if (dn == 2)// Google translated: if 2 consecutive two seconds retry count <3, then tune narrow WiFi duration { if (wait_count <= 2) - m++; // �קK�@���blevel���Ӧ^ + m++; // Google translated: Avoid been back and forth in the two level else m = 1; - if ( m >= 20) //m �̤j�� = 20 ' �̤j120�� recheck�O�_�վ� WiFi duration. + if ( m >= 20) // Google translated: m max = 20 'Max 120 seconds recheck whether to adjust WiFi duration. m = 20; n = 3*m; @@ -1706,14 +1706,14 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } - else //retry count > 3, �u�n1�� retry count > 3, �h�կ�WiFi duration + else // Google translated: retry count> 3, as long as a second retry count> 3, then tune narrow WiFi duration { if (wait_count == 1) - m++; // �קK�@���blevel���Ӧ^ + m++; // Google translated: Avoid been back and forth in the two level else m = 1; - if ( m >= 20) //m �̤j�� = 20 ' �̤j120�� recheck�O�_�վ� WiFi duration. + if ( m >= 20) // Google translated: m max = 20 'Max 120 seconds recheck whether to adjust WiFi duration. m = 20; n = 3*m; @@ -3741,7 +3741,7 @@ EXhalbtc8812a1ant_BtInfoNotify( // need to add back when mp-chip. 12/20/2012 #if 0 if(set_bt_psd_mode <= 3) - { + { halbtc8812a1ant_SetBtPsdMode(btcoexist, FORCE_EXEC, 0xd); set_bt_psd_mode++; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/9] staging: rtl8188eu: core: Remove file rtw_br_ext.c
functions defined in rtw_br_ext.c are not being used by driver anymore. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/Makefile |1 - drivers/staging/rtl8188eu/core/rtw_br_ext.c | 365 --- 2 files changed, 366 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/core/rtw_br_ext.c diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile index b203089..74a032c 100644 --- a/drivers/staging/rtl8188eu/Makefile +++ b/drivers/staging/rtl8188eu/Makefile @@ -1,6 +1,5 @@ r8188eu-y := \ core/rtw_ap.o \ - core/rtw_br_ext.o \ core/rtw_cmd.o \ core/rtw_debug.o\ core/rtw_efuse.o\ diff --git a/drivers/staging/rtl8188eu/core/rtw_br_ext.c b/drivers/staging/rtl8188eu/core/rtw_br_ext.c deleted file mode 100644 index b0b1af9..000 --- a/drivers/staging/rtl8188eu/core/rtw_br_ext.c +++ /dev/null @@ -1,365 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -#define _RTW_BR_EXT_C_ - -#include -#include -#include -#include -#include -#include - -#include -#include "rtw_br_ext.h" -#include -#include - -#ifndef csum_ipv6_magic -#include -#endif - -#include -#include -#include -#include - -#define NAT25_IPV4 01 -#define NAT25_IPV6 02 -#define NAT25_IPX 03 -#define NAT25_APPLE04 -#define NAT25_PPPOE05 - -#define RTL_RELAY_TAG_LEN (ETH_ALEN) -#define TAG_HDR_LEN4 - -#define MAGIC_CODE 0x8186 -#define MAGIC_CODE_LEN 2 -#define WAIT_TIME_PPPOE5 /* waiting time for pppoe server in sec */ - -/*- - How database records network address: - 0123456789 10 - |||||||||||| - IPv4 |type| | IP addr | - IPX |type| Net addr | Node addr | - IPX |type| Net addr |Sckt addr| - Apple |type| Network |node| - PPPoE |type| SID | AC MAC| --*/ - - -/* Find a tag in pppoe frame and return the pointer */ -static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) -{ - unsigned char *cur_ptr, *start_ptr; - unsigned short tagLen, tagType; - - start_ptr = cur_ptr = (unsigned char *)ph->tag; - while ((cur_ptr - start_ptr) < ntohs(ph->length)) { - /* prevent un-alignment access */ - tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); - tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); - if (tagType == type) - return cur_ptr; - cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen; - } - return NULL; -} - - -static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag) -{ - struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN); - int data_len; - - data_len = be16_to_cpu(tag->tag_len) + TAG_HDR_LEN; - if (skb_tailroom(skb) < data_len) { - _DEBUG_ERR("skb_tailroom() failed in add SID tag!\n"); - return -1; - } - - skb_put(skb, data_len); - /* have a room for new tag */ - memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length)); - ph->length = htons(ntohs(ph->length) + data_len); - memcpy((unsigned char *)ph->tag, tag, data_len); - return data_len; -} - -static inline unsigned long __nat25_timeout(struct adapter *priv) -{ - unsigned long timeout; - - timeout = jiffies - NAT25_AGEING_TIME*HZ; - - return timeout; -} - - -static inline int __nat25_has_expired(struct adapter *priv, - struct nat25_network_db_entry *fdb) -{ - if (time_before_eq(fdb->ageing_timer, __
[PATCH 8/9] staging: rtl8188eu: Remove unused members of struct adapter
Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/drv_types.h |8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 71b4af7..baafe33 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -255,14 +255,6 @@ struct adapter { struct mutex hw_init_mutex; spinlock_t br_ext_lock; - struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE]; - unsigned char pppoe_addr[MACADDRLEN]; - unsigned char scdb_mac[MACADDRLEN]; - unsigned char scdb_ip[4]; - struct nat25_network_db_entry *scdb_entry; - unsigned char br_mac[MACADDRLEN]; - unsigned char br_ip[4]; - struct br_ext_info ethBrExtInfo; u8 fix_rate; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 9/9] staging: rtl8188eu: Remove file rtw_br_ext.h
driver doesn't need rtw_br_ext.h any more. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_cmd.c |1 - drivers/staging/rtl8188eu/include/drv_types.h |1 - drivers/staging/rtl8188eu/include/rtw_br_ext.h | 64 drivers/staging/rtl8188eu/os_dep/os_intfs.c|1 - 4 files changed, 67 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/rtw_br_ext.h diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index bb4c703..2384695 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -24,7 +24,6 @@ #include #include #include -#include #include /* diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index baafe33..6750135 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -51,7 +51,6 @@ #include #include #include -#include #define SPEC_DEV_ID_NONE BIT(0) #define SPEC_DEV_ID_DISABLE_HT BIT(1) diff --git a/drivers/staging/rtl8188eu/include/rtw_br_ext.h b/drivers/staging/rtl8188eu/include/rtw_br_ext.h deleted file mode 100644 index f0b2a20..000 --- a/drivers/staging/rtl8188eu/include/rtw_br_ext.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -#ifndef _RTW_BR_EXT_H_ -#define _RTW_BR_EXT_H_ - -#define MACADDRLEN 6 -#define _DEBUG_ERR DBG_88E -#define _DEBUG_INFODBG_88E -#define DEBUG_WARN DBG_88E -#define DEBUG_INFO DBG_88E -#define DEBUG_ERR DBG_88E -#define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr) - -#define NAT25_HASH_BITS4 -#define NAT25_HASH_SIZE(1 << NAT25_HASH_BITS) -#define NAT25_AGEING_TIME 300 - -#define MAX_NETWORK_ADDR_LEN 17 - -struct nat25_network_db_entry { - struct nat25_network_db_entry *next_hash; - struct nat25_network_db_entry **pprev_hash; - atomic_tuse_count; - unsigned char macAddr[6]; - unsigned long ageing_timer; - unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; -}; - -enum NAT25_METHOD { - NAT25_MIN, - NAT25_CHECK, - NAT25_INSERT, - NAT25_LOOKUP, - NAT25_PARSE, - NAT25_MAX -}; - -struct br_ext_info { - unsigned intnat25_disable; - unsigned intmacclone_enable; - unsigned intdhcp_bcst_disable; - int addPPPoETag;/* 1: Add PPPoE relay-SID, 0: disable */ - unsigned char nat25_dmzMac[MACADDRLEN]; - unsigned intnat25sc_disable; -}; - -#endif /* _RTW_BR_EXT_H_ */ diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index 1c30f4c..e19ec25 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -29,7 +29,6 @@ #include #include -#include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/9] staging: rtl8188eu: Remove function nat25_db_expire()
We've removed the code which was responsible for building NAT table, so no use of keeping nat_db_expire(). Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 --- drivers/staging/rtl8188eu/include/usb_osintf.h |1 - 2 files changed, 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index e0e119c..e73a784 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1516,7 +1516,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter) void rtw_dynamic_check_timer_handlder(struct adapter *adapter) { - struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct registry_priv *pregistrypriv = &adapter->registrypriv; if (!adapter) @@ -1539,16 +1538,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) rtw_auto_scan_handler(adapter); } } - - rcu_read_lock(); - - if (rcu_dereference(adapter->pnetdev->rx_handler_data) && - (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) { - /* expire NAT2.5 entry */ - nat25_db_expire(adapter); - } - - rcu_read_unlock(); } #define RTW_SCAN_RESULT_EXPIRE 2000 diff --git a/drivers/staging/rtl8188eu/include/usb_osintf.h b/drivers/staging/rtl8188eu/include/usb_osintf.h index 8036c38..484411f 100644 --- a/drivers/staging/rtl8188eu/include/usb_osintf.h +++ b/drivers/staging/rtl8188eu/include/usb_osintf.h @@ -33,7 +33,6 @@ void netdev_br_init(struct net_device *netdev); void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb); void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr, unsigned char *ipAddr); -void nat25_db_expire(struct adapter *priv); int rtw_resume_process(struct adapter *padapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/9] staging: rtl8188eu: Remove function netdev_br_init()
netdev_br_init() tries to find MAC address of network interface named "br0", then that MAC address is assigned to adapter->br_netdev and used by driver's NAT implementation code. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/usb_osintf.h |1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c| 28 2 files changed, 29 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/usb_osintf.h b/drivers/staging/rtl8188eu/include/usb_osintf.h index 484411f..85805ca 100644 --- a/drivers/staging/rtl8188eu/include/usb_osintf.h +++ b/drivers/staging/rtl8188eu/include/usb_osintf.h @@ -29,7 +29,6 @@ extern int rtw_mc2u_disable; #define USBD_HALTED(Status) ((u32)(Status) >> 30 == 3) int pm_netdev_open(struct net_device *pnetdev, u8 bnormal); -void netdev_br_init(struct net_device *netdev); void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb); void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr, unsigned char *ipAddr); diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index 43eaba0..1c30f4c 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -36,7 +36,6 @@ MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); MODULE_AUTHOR("Realtek Semiconductor Corp."); MODULE_VERSION(DRIVERVERSION); -#define CONFIG_BR_EXT_BRNAME "br0" #define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */ /* module param defaults */ @@ -1001,31 +1000,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter) return _SUCCESS; } -void netdev_br_init(struct net_device *netdev) -{ - struct adapter *adapter = (struct adapter *)rtw_netdev_priv(netdev); - - rcu_read_lock(); - - if (rcu_dereference(adapter->pnetdev->rx_handler_data)) { - struct net_device *br_netdev; - struct net *devnet = NULL; - - devnet = dev_net(netdev); - br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME); - if (br_netdev) { - memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN); - dev_put(br_netdev); - } else { - pr_info("%s()-%d: dev_get_by_name(%s) failed!", - __func__, __LINE__, CONFIG_BR_EXT_BRNAME); - } - } - adapter->ethBrExtInfo.addPPPoETag = 1; - - rcu_read_unlock(); -} - int _netdev_open(struct net_device *pnetdev) { uint status; @@ -1082,8 +1056,6 @@ int _netdev_open(struct net_device *pnetdev) else netif_tx_wake_all_queues(pnetdev); - netdev_br_init(pnetdev); - netdev_open_normal_process: RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - dev_open\n")); DBG_88E("-88eu_drv - drv_open, bup =%d\n", padapter->bup); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/9] staging: rtl8188eu: Remove function rtw_br_client_tx()
rtw_br_client_tx() pass tx packet to functions responsible for building NAT table. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 135 - 1 file changed, 135 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index 1413ec8..a113f0f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -1676,127 +1676,6 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry) phwxmit->accnt = 0; } -static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) -{ - struct sk_buff *skb = *pskb; - int res, is_vlan_tag = 0, i, do_nat25 = 1; - unsigned short vlan_hdr = 0; - void *br_port = NULL; - - rcu_read_lock(); - br_port = rcu_dereference(padapter->pnetdev->rx_handler_data); - rcu_read_unlock(); - spin_lock_bh(&padapter->br_ext_lock); - if (!(skb->data[0] & 1) && br_port && - memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && - *((__be16 *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) && - *((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP) && - !memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) { - memcpy(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); - padapter->scdb_entry->ageing_timer = jiffies; - spin_unlock_bh(&padapter->br_ext_lock); - } else { - if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) { - is_vlan_tag = 1; - vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN*2+2)); - for (i = 0; i < 6; i++) - *((unsigned short *)(skb->data+MACADDRLEN*2+2-i*2)) = *((unsigned short *)(skb->data+MACADDRLEN*2-2-i*2)); - skb_pull(skb, 4); - } - if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && - (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP))) - memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4); - - if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)) { - if (memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN)) { - padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter, - skb->data+MACADDRLEN, skb->data+WLAN_ETHHDR_LEN+12); - if (padapter->scdb_entry) { - memcpy(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN); - memcpy(padapter->scdb_ip, skb->data+WLAN_ETHHDR_LEN+12, 4); - padapter->scdb_entry->ageing_timer = jiffies; - do_nat25 = 0; - } - } else { - if (padapter->scdb_entry) { - padapter->scdb_entry->ageing_timer = jiffies; - do_nat25 = 0; - } else { - memset(padapter->scdb_mac, 0, MACADDRLEN); - memset(padapter->scdb_ip, 0, 4); - } - } - } - spin_unlock_bh(&padapter->br_ext_lock); - if (do_nat25) { - if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) { - struct sk_buff *newskb; - - if (is_vlan_tag) { - skb_push(skb, 4); - for (i = 0; i < 6; i++) - *((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2)); - *((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q); - *((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr; - } - - newskb = skb_copy(skb, GFP_ATOMIC); - if (newskb == NULL) { - DEBUG_ERR("TX DROP: skb_copy fail!\n"); - return -1; - } - dev_kfree_skb_any(skb); - - *pskb = skb = newskb; - if (is_vlan_tag) { - vlan_hdr = *((unsigned short *)(skb->data
[PATCH 3/9] staging: rtl8188eu: Remove function nat25_db_cleanup()
We've removed the code which was responsible for building NAT table, so no use of keeping nat_db_cleanup(). Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_br_ext.c| 26 drivers/staging/rtl8188eu/core/rtw_cmd.c |3 +-- drivers/staging/rtl8188eu/include/rtw_br_ext.h |2 -- drivers/staging/rtl8188eu/os_dep/os_intfs.c|2 -- 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_br_ext.c b/drivers/staging/rtl8188eu/core/rtw_br_ext.c index 8689912..b0b1af9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_br_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_br_ext.c @@ -247,32 +247,6 @@ static inline void __network_hash_unlink(struct nat25_network_db_entry *ent) * NAT2.5 interface */ -void nat25_db_cleanup(struct adapter *priv) -{ - int i; - - spin_lock_bh(&priv->br_ext_lock); - - for (i = 0; i < NAT25_HASH_SIZE; i++) { - struct nat25_network_db_entry *f; - f = priv->nethash[i]; - while (f != NULL) { - struct nat25_network_db_entry *g; - - g = f->next_hash; - if (priv->scdb_entry == f) { - memset(priv->scdb_mac, 0, ETH_ALEN); - memset(priv->scdb_ip, 0, 4); - priv->scdb_entry = NULL; - } - __network_hash_unlink(f); - kfree(f); - f = g; - } - } - spin_unlock_bh(&priv->br_ext_lock); -} - void nat25_db_expire(struct adapter *priv) { int i; diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 25f1c36..bb4c703 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -2059,8 +2059,7 @@ void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n.")); return; - } else /* clear bridge database */ - nat25_db_cleanup(padapter); + } /* free cmd */ rtw_free_cmd_obj(pcmd); diff --git a/drivers/staging/rtl8188eu/include/rtw_br_ext.h b/drivers/staging/rtl8188eu/include/rtw_br_ext.h index f21e7a4..f0b2a20 100644 --- a/drivers/staging/rtl8188eu/include/rtw_br_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_br_ext.h @@ -61,6 +61,4 @@ struct br_ext_info { unsigned intnat25sc_disable; }; -void nat25_db_cleanup(struct adapter *priv); - #endif /* _RTW_BR_EXT_H_ */ diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index 34f7370..43eaba0 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -1228,8 +1228,6 @@ int netdev_close(struct net_device *pnetdev) rtw_led_control(padapter, LED_CTL_POWER_OFF); } - nat25_db_cleanup(padapter); - #ifdef CONFIG_88EU_P2P rtw_p2p_enable(padapter, P2P_ROLE_DISABLE); #endif /* CONFIG_88EU_P2P */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/9] staging: rtl8188eu: Remove unused functons defined in rtw_br_ext.c
This patch removes some functions defined in rtw_br_ext.c, which have become obsolete after removal of rtw_br_client_tx(). Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_br_ext.c| 727 drivers/staging/rtl8188eu/include/usb_osintf.h |1 - 2 files changed, 728 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_br_ext.c b/drivers/staging/rtl8188eu/core/rtw_br_ext.c index 70b8f07..8689912 100644 --- a/drivers/staging/rtl8188eu/core/rtw_br_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_br_ext.c @@ -103,27 +103,6 @@ static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *t return data_len; } -static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len) -{ - int tail_len; - unsigned long end, tail; - - if ((src+len) > skb_tail_pointer(skb) || skb->len < len) - return -1; - - tail = (unsigned long)skb_tail_pointer(skb); - end = (unsigned long)src+len; - if (tail < end) - return -1; - - tail_len = (int)(tail-end); - if (tail_len > 0) - memmove(src, src+len, tail_len); - - skb_trim(skb, skb->len-len); - return 0; -} - static inline unsigned long __nat25_timeout(struct adapter *priv) { unsigned long timeout; @@ -196,91 +175,6 @@ static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAdd memcpy(networkAddr+3, (unsigned char *)ac_mac, 6); } -static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr, - __be32 *ipAddr) -{ - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); - - networkAddr[0] = NAT25_IPV6; - memcpy(networkAddr+1, (unsigned char *)ipAddr, 16); -} - -static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b) -{ - while (len > 0) { - if (*data == tag && *(data+1) == len8b && len >= len8b*8) - return data+2; - - len -= (*(data+1))*8; - data += (*(data+1))*8; - } - return NULL; -} - -static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char *replace_mac) -{ - struct icmp6hdr *icmphdr = (struct icmp6hdr *)data; - unsigned char *mac; - - if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) { - if (len >= 8) { - mac = scan_tlv(&data[8], len-8, 1, 1); - if (mac) { - _DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], - replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); - memcpy(mac, replace_mac, 6); - return 1; - } - } - } else if (icmphdr->icmp6_type == NDISC_ROUTER_ADVERTISEMENT) { - if (len >= 16) { - mac = scan_tlv(&data[16], len-16, 1, 1); - if (mac) { - _DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], - replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); - memcpy(mac, replace_mac, 6); - return 1; - } - } - } else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) { - if (len >= 24) { - mac = scan_tlv(&data[24], len-24, 1, 1); - if (mac) { - _DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], - replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); - memcpy(mac, replace_mac, 6); - return 1; - } - } - } else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) { - if (len >= 24) { - mac = scan_tlv(&data[24], len-24, 2, 1); - if (mac) { - _DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
[PATCH 4/9] staging: rtl8188eu: Remove pppoe_connection_in_progress from struct adapter
Value stored in pppoe_connection_in_progress isn't being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_mlme.c |7 --- drivers/staging/rtl8188eu/include/drv_types.h |1 - 2 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 260243b..e0e119c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1546,13 +1546,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) { /* expire NAT2.5 entry */ nat25_db_expire(adapter); - - if (adapter->pppoe_connection_in_progress > 0) - adapter->pppoe_connection_in_progress--; - - /* due to rtw_dynamic_check_timer_handlder() is called every 2 seconds */ - if (adapter->pppoe_connection_in_progress > 0) - adapter->pppoe_connection_in_progress--; } rcu_read_unlock(); diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 9c3f905..71b4af7 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -256,7 +256,6 @@ struct adapter { spinlock_t br_ext_lock; struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE]; - int pppoe_connection_in_progress; unsigned char pppoe_addr[MACADDRLEN]; unsigned char scdb_mac[MACADDRLEN]; unsigned char scdb_ip[4]; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: vt6655: remove unnecessary typedef struct.
Remove a totally unnecessary typedef and rename it to lowercase. This is more readable now. Signed-off-by: Martin Kepplinger --- so in that way, one could change the more heavily used typedefs as well. thanks for your review. drivers/staging/vt6655/card.c |2 +- drivers/staging/vt6655/device.h |6 +++--- drivers/staging/vt6655/wmgr.c |2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 05bf48a..e21abd8 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -998,7 +998,7 @@ CARDbAdd_PMKID_Candidate( ) { PSDevicepDevice = (PSDevice) pDeviceHandler; - PPMKID_CANDIDATEpCandidateList; + struct pmkid_candidate *pCandidateList; unsigned int ii = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index 45fc8a0..aab63ca 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -227,10 +227,10 @@ typedef enum _NDIS_802_11_STATUS_TYPE } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE; //Added new types for PMKID Candidate lists. -typedef struct _PMKID_CANDIDATE { +struct pmkid_candidate { NDIS_802_11_MAC_ADDRESS BSSID; unsigned long Flags; -} PMKID_CANDIDATE, *PPMKID_CANDIDATE; +}; typedef struct _BSSID_INFO { @@ -248,7 +248,7 @@ typedef struct tagSPMKIDCandidateEvent { NDIS_802_11_STATUS_TYPE StatusType; unsigned long Version; // Version of the structure unsigned long NumCandidates; // No. of pmkid candidates - PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST]; + struct pmkid_candidate CandidateList[MAX_PMKIDLIST]; } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent; //-- diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index 6738478..cc4f5b9 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c @@ -4438,7 +4438,7 @@ bAdd_PMKID_Candidate( ) { PSDevice pDevice = (PSDevice)hDeviceContext; - PPMKID_CANDIDATE pCandidateList; + struct pmkid_candidate *pCandidateList; unsigned int ii = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/9] staging: rtl8188eu: Remove code implementing NAT
Driver has code which does Network address translation (NAT), and i don't see how this code is useful for driver. navin patidar (9): staging: rtl8188eu: Remove function rtw_br_client_tx() staging: rtl8188eu: Remove unused functons defined in rtw_br_ext.c staging: rtl8188eu: Remove function nat25_db_cleanup() staging: rtl8188eu: Remove pppoe_connection_in_progress from struct adapter staging: rtl8188eu: Remove function nat25_db_expire() staging: rtl8188eu: Remove function netdev_br_init() staging: rtl8188eu: core: Remove file rtw_br_ext.c staging: rtl8188eu: Remove unused members of struct adapter staging: rtl8188eu: Remove file rtw_br_ext.h drivers/staging/rtl8188eu/Makefile |1 - drivers/staging/rtl8188eu/core/rtw_br_ext.c| 1118 drivers/staging/rtl8188eu/core/rtw_cmd.c |4 +- drivers/staging/rtl8188eu/core/rtw_mlme.c | 18 - drivers/staging/rtl8188eu/core/rtw_xmit.c | 135 --- drivers/staging/rtl8188eu/include/drv_types.h | 10 - drivers/staging/rtl8188eu/include/rtw_br_ext.h | 66 -- drivers/staging/rtl8188eu/include/usb_osintf.h |3 - drivers/staging/rtl8188eu/os_dep/os_intfs.c| 31 - 9 files changed, 1 insertion(+), 1385 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/core/rtw_br_ext.c delete mode 100644 drivers/staging/rtl8188eu/include/rtw_br_ext.h -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] mfd: rtsx: add dma transfer function
On 16 June 2014 14:20, Lee Jones wrote: >> From: Micky Ching >> >> rtsx driver using a single function for transfer data, dma map/unmap are >> placed in one fix function. We need map/unmap dma in different place(for >> mmc async driver), so add three function for dma map, dma transfer and >> dma unmap. >> >> Signed-off-by: Micky Ching >> --- >> drivers/mfd/rtsx_pcr.c | 76 >> ++ >> include/linux/mfd/rtsx_pci.h |6 >> 2 files changed, 54 insertions(+), 28 deletions(-) > > I don't see any glaring issues with this patch. Does it rely on the > first patch, or vise versa, or can it just be applied? The mmc part in patch2 relies on this one, but please go ahead and apply the mfd patch if you see it good. I can later provide my ack for the mmc parts, in patch2, when it's a reviewed properly and thus you can take it through your tree. Kind regards Uffe ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] imx-drm: imx-hdmi: fix hdmi hotplug detection initial state
On Wed, Jun 11, 2014 at 5:17 AM, Russell King - ARM Linux wrote: > The problem here is that we need more inteligence from CCF in order to > do that - we need it to be able to reprogram the dividers so that the > IPU DI0 clock remains at 148.5MHz while increasing the output of > pll5_video_div three-fold. > > Another solution would be to source the LDB clock from PLL3 at 480MHz, > this gives a pixel clock of 68.6MHz (3sf). The other options are Ok, I have tried this approach: --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -441,8 +441,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || cpu_is_imx6dl()) { - clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); - clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); + clk_set_parent(clk[ldb_di0_sel], clk[pll3_usb_otg]); + clk_set_parent(clk[ldb_di1_sel], clk[pll3_usb_otg]); } and it allows HDMI and LVDS to be displayed if I boot with the HDMI kernel connected. Would this be an acceptable solution in the meantime? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] vme_tsi148: Allow setting VMEbus Global Timeout
- Original Message - > From: "Martyn Welch" > Sent: Monday, June 16, 2014 4:56:16 AM > Subject: Re: [PATCH] vme_tsi148: Allow setting VMEbus Global Timeout > > On 06/06/14 20:41, Aaron Sierra wrote: > > Add a "gto" parameter to this driver so that the VMEbus Global Timeout > > value can be lowered from the default (8h -> 2048 us) or disabled > > completely. > > > > This patch also updates the TSI148_LCSR_VCTRL_GTO_* defines to match > > the Tsi148 User Reference Manual, which shows these values to be 4-bits > > instead of 3-bits. > > > > Signed-off-by: Aaron Sierra > > Hi Aaron, > > Sorry for the delay. > > Would it be worth at least warning the user that the GTO has not been > set should they try to use an invalid GTO? Yeah, I think that's a good idea. I'll make the change and resubmit. > Other than that, looks good to me. > > Martyn ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] mmc: rtsx: add support for async request
On 16 June 2014 11:09, micky wrote: > On 06/16/2014 04:42 PM, Ulf Hansson wrote: >>> >>> @@ -36,7 +37,10 @@ struct realtek_pci_sdmmc { >>> > struct rtsx_pcr *pcr; >>> > struct mmc_host *mmc; >>> > struct mmc_request *mrq; >>> >+ struct workqueue_struct *workq; >>> >+#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" >>> > >>> >+ struct work_struct work; >> >> I am trying to understand why you need a work/workqueue to implement >> this feature. Is that really the case? >> >> Could you elaborate on the reasons? > > Hi Uffe, > > we need return as fast as possible in mmc_host_ops request(ops->request) > callback, > so the mmc core can continue handle next request. > when next request everything is ready, it will wait previous done(if not > done), > then call ops->request(). > > we can't use atomic context, because we use mutex_lock() to protect ops->request should never executed in atomic context. Is that your concern? > resource, and we have to hold the lock during handle request. > So I use workq, we just queue a work and return in ops->request(), > The mmc core can continue without blocking at ops->request(). > > Best Regards. > micky. Kind regards Uffe ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 09/10] ARM: dts: mbimx51sd: Add display support.
On 06/16/2014 12:11 PM, Denis Carikli wrote:> + reg_lcd_3v3: lcd-en { > + compatible = "regulator-fixed"; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_reg_lcd_3v3>; > + regulator-name = "lcd-3v3"; > + regulator-min-microvolt = <330>; > + regulator-max-microvolt = <330>; > + gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>; > + regulator-boot-on; > + }; > +}; This is wrong, I'll fix it in the next serie. What it really does is to make regulator-fixed think that the gpio is active low, the bindings documentation(fixed-regulator.txt) says: > - enable-active-high: Polarity of GPIO is Active high > If this property is missing, the default assumed is Active low. Then regulator-boot-on will make it think that the regulator is already on and so the regulator will be disabled. From the bindings documentation (regulator.txt): > regulator-boot-on: bootloader/firmware enabled regulator Which result at the lcd regulator being physically powered on at boot. I didn't see that because powering it on at boot is what I want. How can I do that beside doing it in userspace by issuing the following commands: echo 4 > /sys/devices/display-subsystem/graphics/fb0/blank echo 0 > /sys/devices/display-subsystem/graphics/fb0/blank Denis. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] mfd: rtsx: add dma transfer function
> From: Micky Ching > > rtsx driver using a single function for transfer data, dma map/unmap are > placed in one fix function. We need map/unmap dma in different place(for > mmc async driver), so add three function for dma map, dma transfer and > dma unmap. > > Signed-off-by: Micky Ching > --- > drivers/mfd/rtsx_pcr.c | 76 > ++ > include/linux/mfd/rtsx_pci.h |6 > 2 files changed, 54 insertions(+), 28 deletions(-) I don't see any glaring issues with this patch. Does it rely on the first patch, or vise versa, or can it just be applied? > diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c > index 1d15735..d01b8c2 100644 > --- a/drivers/mfd/rtsx_pcr.c > +++ b/drivers/mfd/rtsx_pcr.c > @@ -337,40 +337,64 @@ static void rtsx_pci_add_sg_tbl(struct rtsx_pcr *pcr, > int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, > int num_sg, bool read, int timeout) > { > - struct completion trans_done; > - u8 dir; > - int err = 0, i, count; > - long timeleft; > - unsigned long flags; > - struct scatterlist *sg; > - enum dma_data_direction dma_dir; > - u32 val; > - dma_addr_t addr; > - unsigned int len; > + int err = 0, count; > > dev_dbg(&(pcr->pci->dev), "--> %s: num_sg = %d\n", __func__, num_sg); > + count = rtsx_pci_dma_map_sg(pcr, sglist, num_sg, read); > + if (count < 1) > + return -EINVAL; > + dev_dbg(&(pcr->pci->dev), "DMA mapping count: %d\n", count); > + > + err = rtsx_pci_dma_transfer(pcr, sglist, count, read, timeout); > + > + rtsx_pci_dma_unmap_sg(pcr, sglist, num_sg, read); > + > + return err; > +} > +EXPORT_SYMBOL_GPL(rtsx_pci_transfer_data); > + > +int rtsx_pci_dma_map_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, > + int num_sg, bool read) > +{ > + enum dma_data_direction dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; > > - /* don't transfer data during abort processing */ > if (pcr->remove_pci) > return -EINVAL; > > if ((sglist == NULL) || (num_sg <= 0)) > return -EINVAL; > > - if (read) { > - dir = DEVICE_TO_HOST; > - dma_dir = DMA_FROM_DEVICE; > - } else { > - dir = HOST_TO_DEVICE; > - dma_dir = DMA_TO_DEVICE; > - } > + return dma_map_sg(&(pcr->pci->dev), sglist, num_sg, dir); > +} > +EXPORT_SYMBOL_GPL(rtsx_pci_dma_map_sg); > > - count = dma_map_sg(&(pcr->pci->dev), sglist, num_sg, dma_dir); > - if (count < 1) { > - dev_err(&(pcr->pci->dev), "scatterlist map failed\n"); > +void rtsx_pci_dma_unmap_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist, > + int num_sg, bool read) > +{ > + enum dma_data_direction dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; > + > + dma_unmap_sg(&(pcr->pci->dev), sglist, num_sg, dir); > +} > +EXPORT_SYMBOL_GPL(rtsx_pci_dma_unmap_sg); > + > +int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist, > + int count, bool read, int timeout) > +{ > + struct completion trans_done; > + struct scatterlist *sg; > + dma_addr_t addr; > + long timeleft; > + unsigned long flags; > + unsigned int len; > + int i, err = 0; > + u32 val; > + u8 dir = read ? DEVICE_TO_HOST : HOST_TO_DEVICE; > + > + if (pcr->remove_pci) > + return -ENODEV; > + > + if ((sglist == NULL) || (count < 1)) > return -EINVAL; > - } > - dev_dbg(&(pcr->pci->dev), "DMA mapping count: %d\n", count); > > val = ((u32)(dir & 0x01) << 29) | TRIG_DMA | ADMA_MODE; > pcr->sgi = 0; > @@ -400,12 +424,10 @@ int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct > scatterlist *sglist, > } > > spin_lock_irqsave(&pcr->lock, flags); > - > if (pcr->trans_result == TRANS_RESULT_FAIL) > err = -EINVAL; > else if (pcr->trans_result == TRANS_NO_DEVICE) > err = -ENODEV; > - > spin_unlock_irqrestore(&pcr->lock, flags); > > out: > @@ -413,8 +435,6 @@ out: > pcr->done = NULL; > spin_unlock_irqrestore(&pcr->lock, flags); > > - dma_unmap_sg(&(pcr->pci->dev), sglist, num_sg, dma_dir); > - > if ((err < 0) && (err != -ENODEV)) > rtsx_pci_stop_cmd(pcr); > > @@ -423,7 +443,7 @@ out: > > return err; > } > -EXPORT_SYMBOL_GPL(rtsx_pci_transfer_data); > +EXPORT_SYMBOL_GPL(rtsx_pci_dma_transfer); > > int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len) > { > diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h > index a383597..74346d5 100644 > --- a/include/linux/mfd/rtsx_pci.h > +++ b/include/linux/mfd/rtsx_pci.h > @@ -943,6 +943,12 @@ void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr); > int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout); > int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlis
[PATCH 3/3] drivers/staging/bcm/Misc: style: removed void returns
Signed-off-by: Robin Schroer --- drivers/staging/bcm/Misc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c index a0637eb..a1c833c 100644 --- a/drivers/staging/bcm/Misc.c +++ b/drivers/staging/bcm/Misc.c @@ -21,7 +21,6 @@ static void default_wimax_protocol_initialize(struct bcm_mini_adapter *Adapter) Adapter->LinkStatus = SYNC_UP_REQUEST; Adapter->TransferMode = IP_PACKET_ONLY_MODE; Adapter->usBestEffortQueueIndex = -1; - return; } int InitAdapter(struct bcm_mini_adapter *psAdapter) @@ -460,7 +459,6 @@ void StatisticsResponse(struct bcm_mini_adapter *Adapter, void *pvBuffer) Adapter->StatisticsPointer = ntohl(*(__be32 *)pvBuffer); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "Stats at %x", (unsigned int)Adapter->StatisticsPointer); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "%s <", __func__); - return; } /** @@ -545,7 +543,6 @@ void LinkControlResponseMessage(struct bcm_mini_adapter *Adapter, PUCHAR pucBuff memcpy(Adapter->dev->dev_addr, puMacAddr, MAC_ADDRESS_SIZE); } BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "%s <=", __func__); - return; } void SendIdleModeResponse(struct bcm_mini_adapter *Adapter) @@ -776,8 +773,6 @@ void DumpPackInfo(struct bcm_mini_adapter *Adapter) for (uiLoopIndex = 0; uiLoopIndex < MIBS_MAX_HIST_ENTRIES; uiLoopIndex++) BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_INFO, DBG_LVL_ALL, "Adapter->aTxPktSizeHist[%x] = %x\n", uiLoopIndex, Adapter->aTxPktSizeHist[uiLoopIndex]); - - return; } int reset_card_proc(struct bcm_mini_adapter *ps_adapter) @@ -1426,7 +1421,6 @@ static void HandleShutDownModeRequest(struct bcm_mini_adapter *Adapter, PUCHAR p } BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "<\n"); - return; } void ResetCounters(struct bcm_mini_adapter *Adapter) -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] drivers/staging/bcm/Misc: style: added blank lines after declarations
Signed-off-by: Robin Schroer --- drivers/staging/bcm/Misc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c index 7b2fa0f..f2bc699 100644 --- a/drivers/staging/bcm/Misc.c +++ b/drivers/staging/bcm/Misc.c @@ -28,6 +28,7 @@ int InitAdapter(struct bcm_mini_adapter *psAdapter) { int i = 0; int Status = STATUS_SUCCESS; + BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Initialising Adapter = %p", psAdapter); if (psAdapter == NULL) { @@ -96,6 +97,7 @@ int InitAdapter(struct bcm_mini_adapter *psAdapter) void AdapterFree(struct bcm_mini_adapter *Adapter) { int count; + beceem_protocol_reset(Adapter); vendorextnExit(Adapter); @@ -158,6 +160,7 @@ static int create_worker_threads(struct bcm_mini_adapter *psAdapter) static struct file *open_firmware_file(struct bcm_mini_adapter *Adapter, const char *path) { struct file *flp = filp_open(path, O_RDONLY, S_IRWXU); + if (IS_ERR(flp)) { pr_err(DRV_NAME "Unable To Open File %s, err %ld", path, PTR_ERR(flp)); flp = NULL; @@ -402,6 +405,7 @@ int CopyBufferToControlPacket(struct bcm_mini_adapter *Adapter, void *ioBuffer) void LinkMessage(struct bcm_mini_adapter *Adapter) { struct bcm_link_request *pstLinkRequest = NULL; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LINK_UP_MSG, DBG_LVL_ALL, "=>"); if (Adapter->LinkStatus == SYNC_UP_REQUEST && Adapter->AutoSyncup) { pstLinkRequest = kzalloc(sizeof(struct bcm_link_request), GFP_ATOMIC); @@ -534,6 +538,7 @@ void LinkControlResponseMessage(struct bcm_mini_adapter *Adapter, PUCHAR pucBuff } } else if (SET_MAC_ADDRESS_RESPONSE == *pucBuffer) { PUCHAR puMacAddr = (pucBuffer + 1); + Adapter->LinkStatus = SYNC_UP_REQUEST; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "MAC address response, sending SYNC_UP"); LinkMessage(Adapter); @@ -548,6 +553,7 @@ void SendIdleModeResponse(struct bcm_mini_adapter *Adapter) int status = 0, NVMAccess = 0, lowPwrAbortMsg = 0; struct timeval tv; struct bcm_link_request stIdleResponse = {{0} }; + memset(&tv, 0, sizeof(tv)); stIdleResponse.Leader.Status = IDLE_MESSAGE; stIdleResponse.Leader.PLength = IDLE_MODE_PAYLOAD_LENGTH; @@ -1224,6 +1230,7 @@ int rdmalt(struct bcm_mini_adapter *Adapter, unsigned int uiAddress, unsigned in int wrmWithLock(struct bcm_mini_adapter *Adapter, unsigned int uiAddress, PCHAR pucBuff, size_t sSize) { int status = STATUS_SUCCESS; + down(&Adapter->rdmwrmsync); if ((Adapter->IdleMode == TRUE) || @@ -1282,6 +1289,7 @@ exit: static void HandleShutDownModeWakeup(struct bcm_mini_adapter *Adapter) { int clear_abort_pattern = 0, Status = 0; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, ">\n"); /* target has woken up From Shut Down */ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "Clearing Shut Down Software abort pattern\n"); @@ -1440,6 +1448,7 @@ void ResetCounters(struct bcm_mini_adapter *Adapter) struct bcm_classifier_rule *GetFragIPClsEntry(struct bcm_mini_adapter *Adapter, USHORT usIpIdentification, ULONG SrcIP) { unsigned int uiIndex = 0; + for (uiIndex = 0; uiIndex < MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES; uiIndex++) { if ((Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) && (Adapter->astFragmentedPktClassifierTable[uiIndex].usIpIdentification == usIpIdentification) && @@ -1454,6 +1463,7 @@ struct bcm_classifier_rule *GetFragIPClsEntry(struct bcm_mini_adapter *Adapter, void AddFragIPClsEntry(struct bcm_mini_adapter *Adapter, struct bcm_fragmented_packet_info *psFragPktInfo) { unsigned int uiIndex = 0; + for (uiIndex = 0; uiIndex < MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES; uiIndex++) { if (!Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) { memcpy(&Adapter->astFragmentedPktClassifierTable[uiIndex], psFragPktInfo, sizeof(struct bcm_fragmented_packet_info)); @@ -1465,6 +1475,7 @@ void AddFragIPClsEntry(struct bcm_mini_adapter *Adapter, struct bcm_fragmented_p void DelFragIPClsEntry(struct bcm_mini_adapter *Adapter, USHORT usIpIdentification, ULONG SrcIp) { unsigned int uiIndex = 0; + for (uiIndex = 0; uiIndex < MAX_FRAGMENTEDIP_CLASSIFICATION_ENTRIES; uiIndex++) { if ((Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) && (Adapter->astFragmentedPktClassifierTable[uiIndex].usIpIdentification == usIpIdentification) && @@ -1528,6 +1539,7 @@ void flush_queue(struct bcm_mini_adapter *Adapter, unsigned int iQIndex) { struct sk_buff *PacketToDrop = NULL;
[PATCH 2/3] drivers/staging/bcm/Misc: style: removed duplicate parentheses
Signed-off-by: Robin Schroer --- drivers/staging/bcm/Misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c index f2bc699..a0637eb 100644 --- a/drivers/staging/bcm/Misc.c +++ b/drivers/staging/bcm/Misc.c @@ -284,7 +284,7 @@ int CopyBufferToControlPacket(struct bcm_mini_adapter *Adapter, void *ioBuffer) pLeader->Status == CM_CONTROL_NEWDSX_MULTICLASSIFIER_REQ) { if ((pLeader->Status == LINK_UP_CONTROL_REQ) && (pLinkReq->szData[0] == LINK_DOWN_REQ_PAYLOAD)) { - if ((pLinkReq->szData[1] == LINK_SYNC_DOWN_SUBTYPE)) { + if (pLinkReq->szData[1] == LINK_SYNC_DOWN_SUBTYPE) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Link Down Sent in Idle Mode\n"); Adapter->usIdleModePattern = ABORT_IDLE_SYNCDOWN; /* LINK DOWN sent in Idle Mode */ } else { @@ -630,7 +630,7 @@ void SendIdleModeResponse(struct bcm_mini_adapter *Adapter) } status = CopyBufferToControlPacket(Adapter, &stIdleResponse); - if ((status != STATUS_SUCCESS)) { + if (status != STATUS_SUCCESS) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "fail to send the Idle mode Request\n"); Adapter->bPreparingForLowPowerMode = false; StartInterruptUrb((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); @@ -1393,7 +1393,7 @@ static void SendShutModeResponse(struct bcm_mini_adapter *Adapter) } Status = CopyBufferToControlPacket(Adapter, &stShutdownResponse); - if ((Status != STATUS_SUCCESS)) { + if (Status != STATUS_SUCCESS) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "fail to send the Idle mode Request\n"); Adapter->bPreparingForLowPowerMode = false; StartInterruptUrb((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: Fix sparse warnings for undeclared symbols
This patch fixes the sparse warnings in drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c: sec_lproc.c:58:6: warning: symbol 'sec_flags2str' was not declared. Should it be static? Signed-off-by: Scott Weir --- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c index 1213621..1928bf5 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c @@ -55,7 +55,7 @@ struct proc_dir_entry *sptlrpc_proc_root = NULL; EXPORT_SYMBOL(sptlrpc_proc_root); -char *sec_flags2str(unsigned long flags, char *buf, int bufsize) +static char *sec_flags2str(unsigned long flags, char *buf, int bufsize) { buf[0] = '\0'; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]
Nick, Sorry for the delay in responding. I'm staring at the manual for the ca91c142 and the relevant bits in the VSIx_CTL registers definitely need to be set to 0 for A16, likewise with the LM_CTL register. The pattern (3<<16) would enable one of the "reserved" address spaces. Martyn On 12/06/14 15:33, nick wrote: Here is the fixed patch. Having issues with using Thunderbird so just used Evolution for now. Nick --- drivers/vme/bridges/vme_ca91cx42.h.orig 2014-06-11 22:50:29.339671939 -0400 +++ drivers/vme/bridges/vme_ca91cx42.h 2014-06-11 23:15:36.027685173 -0400 Fixes bug issues with wrong bus width in if statments in vme_ca91cx42.c Signed-off-by: Nicholas Krause @@ -526,7 +526,7 @@ static const int CA91CX42_LINT_LM[] = { #define CA91CX42_VSI_CTL_SUPER_SUPR (1<<21) #define CA91CX42_VSI_CTL_VAS_M(7<<16) -#define CA91CX42_VSI_CTL_VAS_A16 0 +#define CA91CX42_VSI_CTL_VAS_A16 (3<<16) #define CA91CX42_VSI_CTL_VAS_A24 (1<<16) #define CA91CX42_VSI_CTL_VAS_A32 (1<<17) #define CA91CX42_VSI_CTL_VAS_USER1(3<<17) @@ -549,7 +549,7 @@ static const int CA91CX42_LINT_LM[] = { #define CA91CX42_LM_CTL_SUPR (1<<21) #define CA91CX42_LM_CTL_NPRIV (1<<20) #define CA91CX42_LM_CTL_AS_M (5<<16) -#define CA91CX42_LM_CTL_AS_A16 0 +#define CA91CX42_LM_CTL_AS_A16 (3<<16) #define CA91CX42_LM_CTL_AS_A24(1<<16) #define CA91CX42_LM_CTL_AS_A32(1<<17) -- Martyn Welch (Lead Software Engineer) | Registered in England and Wales GE Intelligent Platforms | (3828642) at 100 Barbirolli Square T +44(0)1327322748 | Manchester, M2 3AB E martyn.we...@ge.com | VAT:GB 927559189 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v14 03/10] imx-drm: Correct BGR666 and the board's dts that use them.
On Mon, Jun 16, 2014 at 12:11:17PM +0200, Denis Carikli wrote: > The current BGR666 is not consistent with the other color mapings like BGR24. > BGR666 should be in the same byte order than BGR24. > > Signed-off-by: Denis Carikli > Acked-by: Philipp Zabel As I said probably around v10 time, I already have this patch queued, and I was going to send it to Greg before the previous merge window, but due to the number of patches I was already carrying, it was lost amongst the trees. -- 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 02/10] imx-drm: Add RGB666 support for parallel display.
On Mon, Jun 16, 2014 at 12:11:16PM +0200, Denis Carikli wrote: > Signed-off-by: Denis Carikli > Acked-by: Philipp Zabel As I said probably around v10 time, I already have this patch queued, and I was going to send it to Greg before the previous merge window, but due to the number of patches I was already carrying, it was lost amongst the trees. -- 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 01/10] [media] v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.
On Mon, Jun 16, 2014 at 12:11:15PM +0200, Denis Carikli wrote: > That new macro is needed by the imx_drm staging driver > for supporting the QVGA display of the eukrea-cpuimx51 board. As I said probably around v10 time, I already have this patch queued, and I was going to send it to Greg before the previous merge window, but due to the number of patches I was already carrying, it was lost amongst the trees. -- 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 v14 02/10] imx-drm: Add RGB666 support for parallel display.
Signed-off-by: Denis Carikli Acked-by: Philipp Zabel --- ChangeLog v13->v14: - Rebased ChangeLog v9->v13: - Rebased ChangeLog v8->v9: - Rebased. - Added Philipp Zabel's ack. - Shortened the patch title. ChangeLog v8->v9: - Removed the Cc. They are now set in git-send-email directly. - Rebased. ChangeLog v7->v8: - Shrinked even more the Cc list. ChangeLog v6->v7: - Shrinked even more the Cc list. ChangeLog v5->v6: - Remove people not concerned by this patch from the Cc list. ChangeLog v3->v5: - Use the correct RGB order. ChangeLog v2->v3: - Added some interested people in the Cc list. - Removed the commit message long desciption that was just a copy of the short description. - Rebased the patch. - Fixed a copy-paste error in the ipu_dc_map_clear parameter. --- .../bindings/staging/imx-drm/fsl-imx-drm.txt |4 ++-- drivers/gpu/ipu-v3/ipu-dc.c|9 + drivers/staging/imx-drm/parallel-display.c |2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt index e75f0e5..c0eb95a 100644 --- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt @@ -60,8 +60,8 @@ Required properties: - compatible: Should be "fsl,imx-parallel-display" Optional properties: - interface_pix_fmt: How this display is connected to the - display interface. Currently supported types: "rgb24", "rgb565", "bgr666" - and "lvds666". + display interface. Currently supported types: "rgb24", "rgb565", "bgr666", + "rgb666" and "lvds666". - edid: verbatim EDID data block describing attached display. - ddc: phandle describing the i2c bus handling the display data channel diff --git a/drivers/gpu/ipu-v3/ipu-dc.c b/drivers/gpu/ipu-v3/ipu-dc.c index 2326c75..100d410 100644 --- a/drivers/gpu/ipu-v3/ipu-dc.c +++ b/drivers/gpu/ipu-v3/ipu-dc.c @@ -93,6 +93,7 @@ enum ipu_dc_map { IPU_DC_MAP_BGR666, IPU_DC_MAP_LVDS666, IPU_DC_MAP_BGR24, + IPU_DC_MAP_RGB666, }; struct ipu_dc { @@ -161,6 +162,8 @@ static int ipu_pixfmt_to_map(u32 fmt) return IPU_DC_MAP_LVDS666; case V4L2_PIX_FMT_BGR24: return IPU_DC_MAP_BGR24; + case V4L2_PIX_FMT_RGB666: + return IPU_DC_MAP_RGB666; default: return -EINVAL; } @@ -452,6 +455,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev, ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 1, 15, 0xff); /* green */ ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 0, 23, 0xff); /* blue */ + /* rgb666 */ + ipu_dc_map_clear(priv, IPU_DC_MAP_RGB666); + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 0, 5, 0xfc); /* blue */ + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 1, 11, 0xfc); /* green */ + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 2, 17, 0xfc); /* red */ + return 0; } diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-drm/parallel-display.c index b567832..64b34336 100644 --- a/drivers/staging/imx-drm/parallel-display.c +++ b/drivers/staging/imx-drm/parallel-display.c @@ -218,6 +218,8 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB565; else if (!strcmp(fmt, "bgr666")) imxpd->interface_pix_fmt = V4L2_PIX_FMT_BGR666; + else if (!strcmp(fmt, "rgb666")) + imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB666; else if (!strcmp(fmt, "lvds666")) imxpd->interface_pix_fmt = v4l2_fourcc('L', 'V', 'D', '6'); } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 10/10] ARM: dts: mbimx51sd: Add CMO-QVGA backlight support.
Signed-off-by: Denis Carikli --- ChangeLog v13->v14: - None ChangeLog v11->v13: - No changes ChangeLog v9->v11: - Now uses the drm-panel instead of the display-timings. ChangeLog v8->v9: - Removed the Cc. They are now set in git-send-email directly. - The backlight is now on at boot. ChangeLog v6->v7: - Shrinked even more the Cc list. ChangeLog v5->v6: - Reordered the Cc list. ChangeLog v3->v5: - Updated to the new GPIO defines. ChangeLog v2->v3: - Splitted out from the patch that added support for the cpuimx51/mbimxsd51 boards. - This patch now only adds backlight support. - Added some interested people in the Cc list, and removed some people that might be annoyed by the receiving of that patch which is unrelated to their subsystem. --- .../imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts index d273d09..6e36dae 100644 --- a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts +++ b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts @@ -17,9 +17,19 @@ model = "Eukrea MBIMXSD51 with the CMO-QVGA Display"; compatible = "eukrea,mbimxsd51-baseboard-cmo-qvga", "eukrea,mbimxsd51-baseboard", "eukrea,cpuimx51", "fsl,imx51"; + backlight: backlight { + compatible = "gpio-backlight"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_backlight_1>; + gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>; + default-brightness-level = <1>; + default-on; + }; + panel: panel { compatible = "eukrea,mbimxsd51-cmo-qvga", "simple-panel"; power-supply = <®_lcd_3v3>; + backlight = <&backlight>; }; reg_lcd_3v3: lcd-en { -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 04/10] imx-drm: use defines for clock polarity settings
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_GBR24 v4l2_fourcc('G', 'B', 'R', '3') +#define CLK_POL_NEGEDGE0 +#define CLK_POL_POSEDGE1 + +#define ENABLE_POL_LOW 0 +#define ENABLE_POL_HIGH1 + /* * 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; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 08/10] drm/panel: Add Eukrea mbimxsd51 displays.
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, + .height = 0, + }, +}; + +static const struct drm_display_mode eukrea_mbimxsd51_dvivga_mode = { + .clock = 23750, + .hdisplay = 640, + .hsync_start = 640 + 80, + .hsync_end = 640 + 80 + 16, + .htotal = 640 + 80 + 16 + 64, + .vdisplay = 480, + .vsync_start = 480 + 3, + .vsync_end = 480 + 3 + 13, + .vtotal = 480 + 3 + 13 + 4, + .vrefresh = 60, + .pol_flags = DRM_MODE_FLAG_POL_PIXDATA_POSEDGE | +DRM_MODE_FLAG_POL_DE_HIGH, +}; + +static const struct panel_desc eukrea_mbimxsd51_dvivga = { + .modes = &eukrea_mbimxsd51_dvivga_mode, + .num_modes = 1, + /* This is a DVI adapter for external displays */
[PATCH v14 09/10] ARM: dts: mbimx51sd: Add display support.
The CMO-QVGA, DVI-SVGA and DVI-VGA are added. Signed-off-by: Denis Carikli --- ChangeLog v13->v14: - None ChangeLog v10->v13: - Rebased - Removed enable-active-high in reg_lcd_3v3: its GPIO already has the GPIO_ACTIVE_HIGH flag. Without this removal, the display was off at boot and powering it off and on was necessary to get an image on it after the boot. ChangeLog v10->v11: - Now uses the drm-panel instead of the display-timings. This is to get regulator support, which is lacking in the imx-drm driver when using the display-timings. ChangeLog v9->v10: - Rebased - Now enables the cmo-qvga regulator at boot. ChangeLog v8->v9: - Removed the Cc. They are now set in git-send-email directly. - updated pixelclk-active after the following patch: "imx-drm: Match ipu_di_signal_cfg's clk_pol with its description." ChangeLog v7->v8: - Rebased the patch: added the now required imx-drm node. - Adapted the svga clock-frequency value in order to still be able to display an image after the following commit: "imx-drm: ipu-v3: more inteligent DI clock selection" ChangeLog v6->v7: - Shrinked even more the Cc list. - Since the pingrp headers were removed, the references to it where replaced by the actual pins. - Added the targets to arch/arm/boot/dts/Makefile ChangeLog v5->v6: - Reordered the Cc list. ChangeLog v3->v5: - Updated to new GPIO defines. - Updated to new licenses checkpatch requirements. - one whitespace cleanup. ChangeLog v2->v3: - Splitted out from the patch that added support for the cpuimx51/mbimxsd51 boards. - This patch now only adds display support. - Added some interested people in the Cc list, and removed some people that might be annoyed by the receiving of that patch which is unrelated to their subsystem. - rebased and reworked the dts displays addition. - Also rebased and reworked the fsl,pins usage. --- arch/arm/boot/dts/Makefile |3 ++ .../imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts | 40 .../imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts | 28 +++ .../imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts | 28 +++ .../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts | 49 5 files changed, 148 insertions(+) create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 0f1e8be..f0ec7b7 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -177,6 +177,9 @@ dtb-$(CONFIG_ARCH_MXC) += \ imx51-babbage.dtb \ imx51-digi-connectcore-jsk.dtb \ imx51-eukrea-mbimxsd51-baseboard.dtb \ + imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dtb \ + imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dtb \ + imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dtb \ imx53-ard.dtb \ imx53-m53evk.dtb \ imx53-mba53.dtb \ diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts new file mode 100644 index 000..d273d09 --- /dev/null +++ b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts @@ -0,0 +1,40 @@ +/* + * Copyright 2013 Eukréa Electromatique + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "imx51-eukrea-mbimxsd51-baseboard.dts" + +/ { + model = "Eukrea MBIMXSD51 with the CMO-QVGA Display"; + compatible = "eukrea,mbimxsd51-baseboard-cmo-qvga", "eukrea,mbimxsd51-baseboard", "eukrea,cpuimx51", "fsl,imx51"; + + panel: panel { + compatible = "eukrea,mbimxsd51-cmo-qvga", "simple-panel"; + power-supply = <®_lcd_3v3>; + }; + + reg_lcd_3v3: lcd-en { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_lcd_3v3>; + regulator-name = "lcd-3v3"; + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + }; +}; + +&display { + status = "okay"; + fsl,panel = <&panel>; +}; diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts new f
[PATCH v14 07/10] imx-drm: Use drm_display_mode timings flags.
The previous hardware behaviour was kept if the flags are not set. Signed-off-by: Denis Carikli --- ChangeLog v13->v14: - Rebased ChangeLog v12->v13: - This patch doesn't need the DRM_MODE_FLAG_POL_*_PRESERVE flags anymore. - code cleanup to improve readability: - ENABLE_POL_PRESERVE is now gone - Less modifications in ipu_di_init_sync_panel - more readable modifications in int ipu_crtc_mode_set ChangeLog v11->v12: - Rebased: It now uses the following new flags defines names: CLK_POL, ENABLE_POL - The inversions in ipuv3-crtc.c are now fixed. - ipuv3-crtc.c was still using mode->private_flags from the previous versions of this patchset, that's now fixed. ChangeLog v10->v11: - This patch was splitted-out and adapted from: "Prepare imx-drm for extra display-timings retrival." - The display-timings dt specific part was removed. - The flags names were changed to use the DRM ones from: "drm: drm_display_mode: add signal polarity flags" --- drivers/gpu/ipu-v3/ipu-di.c |2 ++ drivers/staging/imx-drm/ipuv3-crtc.c | 18 -- include/video/imx-ipu-v3.h |4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c index d00f357..1a1e116 100644 --- a/drivers/gpu/ipu-v3/ipu-di.c +++ b/drivers/gpu/ipu-v3/ipu-di.c @@ -597,6 +597,8 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) if (sig->clk_pol == CLK_POL_POSEDGE) di_gen |= DI_GEN_POLARITY_DISP_CLK; + else if (sig->clk_pol == CLK_POL_NEGEDGE) + di_gen &= ~DI_GEN_POLARITY_DISP_CLK; ipu_di_write(di, di_gen, DI_GENERAL); diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c index 7fec438..7fdf575 100644 --- a/drivers/staging/imx-drm/ipuv3-crtc.c +++ b/drivers/staging/imx-drm/ipuv3-crtc.c @@ -165,8 +165,22 @@ 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 = ENABLE_POL_HIGH; - sig_cfg.clk_pol = CLK_POL_NEGEDGE; + if (mode->pol_flags & DRM_MODE_FLAG_POL_PIXDATA_POSEDGE) + sig_cfg.clk_pol = CLK_POL_POSEDGE; + else if (mode->pol_flags & DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE) + sig_cfg.clk_pol = CLK_POL_NEGEDGE; + else + /* If no PIXDATA flags were set, keep the old behaviour */ + sig_cfg.clk_pol = CLK_POL_NEGEDGE; + + if (mode->pol_flags & DRM_MODE_FLAG_POL_DE_HIGH) + sig_cfg.enable_pol = ENABLE_POL_HIGH; + else if (mode->pol_flags & DRM_MODE_FLAG_POL_DE_LOW) + sig_cfg.enable_pol = ENABLE_POL_LOW; + else + /* If no DE flags were set, keep the old behaviour */ + sig_cfg.enable_pol = ENABLE_POL_HIGH; + 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 305..e660522 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -43,10 +43,10 @@ struct ipu_di_signal_cfg { unsigned clksel_en:1; unsigned clkidle_en:1; unsigned data_pol:1;/* true = inverted */ - unsigned clk_pol:1; - unsigned enable_pol:1; unsigned Hsync_pol:1; /* true = active high */ unsigned Vsync_pol:1; + u8 clk_pol; + u8 enable_pol; u16 width; u16 height; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 03/10] imx-drm: Correct BGR666 and the board's dts that use them.
The current BGR666 is not consistent with the other color mapings like BGR24. BGR666 should be in the same byte order than BGR24. Signed-off-by: Denis Carikli Acked-by: Philipp Zabel --- ChangeLog v13->v14: - Rebased ChangeLog v10->v13: - Rebased ChangeLog v9->v10: - Rebased. - Added Philipp Zabel's Ack. - Included Lothar Waßmann's suggestion about imx-ldb.c. - Shortened the patch title ChangeLog v8->v9: - Removed the Cc. They are now set in git-send-email directly. ChangeLog v7->v8: - Shrinked even more the Cc list. ChangeLog v6->v7: - Shrinked even more the Cc list. ChangeLog v5->v6: - Remove people not concerned by this patch from the Cc list. - Added a better explanation of the change. ChangeLog v5: - New patch. --- arch/arm/boot/dts/imx51-apf51dev.dts |2 +- arch/arm/boot/dts/imx53-m53evk.dts |2 +- drivers/gpu/ipu-v3/ipu-dc.c |4 ++-- drivers/staging/imx-drm/imx-ldb.c|4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/imx51-apf51dev.dts b/arch/arm/boot/dts/imx51-apf51dev.dts index c5a9a24..7b3851d 100644 --- a/arch/arm/boot/dts/imx51-apf51dev.dts +++ b/arch/arm/boot/dts/imx51-apf51dev.dts @@ -18,7 +18,7 @@ display@di1 { compatible = "fsl,imx-parallel-display"; - interface-pix-fmt = "bgr666"; + interface-pix-fmt = "rgb666"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ipu_disp1>; diff --git a/arch/arm/boot/dts/imx53-m53evk.dts b/arch/arm/boot/dts/imx53-m53evk.dts index d5d146a..4b036b4 100644 --- a/arch/arm/boot/dts/imx53-m53evk.dts +++ b/arch/arm/boot/dts/imx53-m53evk.dts @@ -24,7 +24,7 @@ soc { display1: display@di1 { compatible = "fsl,imx-parallel-display"; - interface-pix-fmt = "bgr666"; + interface-pix-fmt = "rgb666"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ipu_disp1>; diff --git a/drivers/gpu/ipu-v3/ipu-dc.c b/drivers/gpu/ipu-v3/ipu-dc.c index 100d410..9974d41 100644 --- a/drivers/gpu/ipu-v3/ipu-dc.c +++ b/drivers/gpu/ipu-v3/ipu-dc.c @@ -439,9 +439,9 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev, /* bgr666 */ ipu_dc_map_clear(priv, IPU_DC_MAP_BGR666); - ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 5, 0xfc); /* blue */ + ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 17, 0xfc); /* blue */ ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 1, 11, 0xfc); /* green */ - ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 17, 0xfc); /* red */ + ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 5, 0xfc); /* red */ /* lvds666 */ ipu_dc_map_clear(priv, IPU_DC_MAP_LVDS666); diff --git a/drivers/staging/imx-drm/imx-ldb.c b/drivers/staging/imx-drm/imx-ldb.c index 7e3f019..5d22e40 100644 --- a/drivers/staging/imx-drm/imx-ldb.c +++ b/drivers/staging/imx-drm/imx-ldb.c @@ -188,11 +188,11 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder) switch (imx_ldb_ch->chno) { case 0: pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH0_24) ? - V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_BGR666; + V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_RGB666; break; case 1: pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH1_24) ? - V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_BGR666; + V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_RGB666; break; default: dev_err(ldb->dev, "unable to config di%d panel format\n", -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 05/10] ARM: dts: imx5*, imx6*: correct display-timings nodes.
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 --- ChangeLog v13->v14: - None ChangeLog v10->v11: - imx53-tx53-x03x.dts change was removed because it already had the correct setting. ChangeLog v9->v10: - New patch that was splitted out of: "staging imx-drm: Use de-active and pixelclk-active display-timings." --- arch/arm/boot/dts/imx51-babbage.dts |2 ++ arch/arm/boot/dts/imx53-m53evk.dts|2 ++ arch/arm/boot/dts/imx6qdl-gw53xx.dtsi |2 ++ arch/arm/boot/dts/imx6qdl-gw54xx.dtsi |2 ++ arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi |2 ++ arch/arm/boot/dts/imx6qdl-sabreauto.dtsi |2 ++ arch/arm/boot/dts/imx6qdl-sabrelite.dtsi |2 ++ arch/arm/boot/dts/imx6qdl-sabresd.dtsi|2 ++ 8 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts index ee51a10..b64a9e3 100644 --- a/arch/arm/boot/dts/imx51-babbage.dts +++ b/arch/arm/boot/dts/imx51-babbage.dts @@ -56,6 +56,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; diff --git a/arch/arm/boot/dts/imx53-m53evk.dts b/arch/arm/boot/dts/imx53-m53evk.dts index 4b036b4..d03ced7 100644 --- a/arch/arm/boot/dts/imx53-m53evk.dts +++ b/arch/arm/boot/dts/imx53-m53evk.dts @@ -41,6 +41,8 @@ vfront-porch = <9>; vsync-len = <3>; vsync-active = <1>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi index d3125f0..7f993d6 100644 --- a/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi +++ b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi @@ -512,6 +512,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi index 532347f..e06cf9e 100644 --- a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi +++ b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi @@ -534,6 +534,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi index 4c4b175..bcf5178 100644 --- a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi +++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi @@ -353,6 +353,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 009abd6..230bbc6 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -405,6 +405,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index 6df6127..9f6b406 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -353,6 +353,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/
[PATCH v14 01/10] [media] v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.
That new macro is needed by the imx_drm staging driver for supporting the QVGA display of the eukrea-cpuimx51 board. Signed-off-by: Denis Carikli Acked-by: Mauro Carvalho Chehab Acked-by: Laurent Pinchart Acked-by: Philipp Zabel --- ChangeLog v13->v14: - None ChangeLog v10->v13: - No changes ChangeLog v9->v10: - Rebased on top of: "211e7f2 [media] DocBook media: drop the old incorrect packed RGB table" - Added Philipp Zabel's Ack. ChangeLog v8->v9: - Removed the Cc. They are now set in git-send-email directly. ChangeLog v7->v8: - Added Mauro Carvalho Chehab back to the list of Cc ChangeLog v6->v7: - Shrinked even more the Cc list. ChangeLog v5->v6: - Remove people not concerned by this patch from the Cc list. ChangeLog v3->v4: - Added Laurent Pinchart's Ack. ChangeLog v2->v3: - Added some interested people in the Cc list. - Added Mauro Carvalho Chehab's Ack. - Added documentation. --- .../DocBook/media/v4l/pixfmt-packed-rgb.xml| 39 include/uapi/linux/videodev2.h |1 + 2 files changed, 40 insertions(+) diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index e1c4f8b..88a7fe1 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml @@ -279,6 +279,45 @@ colorspace V4L2_COLORSPACE_SRGB. + + V4L2_PIX_FMT_RGB666 + 'RGBH' + + r5 + r4 + r3 + r2 + r1 + r0 + g5 + g4 + + g3 + g2 + g1 + g0 + b5 + b4 + b3 + b2 + + b1 + b0 + + + + + + + + + + + + + + + V4L2_PIX_FMT_BGR24 'BGR3' diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 168ff50..08cac01 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -299,6 +299,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */ +#define V4L2_PIX_FMT_RGB666 v4l2_fourcc('R', 'G', 'B', 'H') /* 18 RGB-6-6-6 */ #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v14 06/10] drm: drm_display_mode: add signal polarity flags
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 --- 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_NEGEDGE BIT(1) +#define DRM_MODE_FLAG_POL_PIXDATA_POSEDGE BIT(2) +#define DRM_MODE_FLAG_POL_DE_LOW BIT(3) +#define DRM_MODE_FLAG_POL_DE_HIGH BIT(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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]
On 16/06/14 10:56, Dan Carpenter wrote: On Mon, Jun 16, 2014 at 10:47:25AM +0100, Martyn Welch wrote: Nick, Sorry for the delay in responding. I'm staring at the manual for the ca91c142 and the relevant bits in the VSIx_CTL registers definitely need to be set to 0 for A16, likewise with the LM_CTL register. The pattern (3<<16) would enable one of the "reserved" address spaces. Nick emailed me privately that this was a static checker warning. These warnings are often false positives... But I'm worried about the test: if ((ctl & CA91CX42_VSI_CTL_VAS_M) == CA91CX42_VSI_CTL_VAS_A16) *aspace = VME_A16; That could be true when we didn't intend it. If I'm not mistaken, CA91CX42_VSI_CTL_VAS_A16 is currently defined as 0. So: if ((ctl & (7<<16) == 0) *aspace = VME_A16; Which looks right to me, it's checking to see if the relevant bits in the register are all zero, am I missing something obvious? Martyn -- Martyn Welch (Lead Software Engineer) | Registered in England and Wales GE Intelligent Platforms | (3828642) at 100 Barbirolli Square T +44(0)1327322748 | Manchester, M2 3AB E martyn.we...@ge.com | VAT:GB 927559189 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]
On Mon, Jun 16, 2014 at 10:47:25AM +0100, Martyn Welch wrote: > Nick, > > Sorry for the delay in responding. > > I'm staring at the manual for the ca91c142 and the relevant bits in > the VSIx_CTL registers definitely need to be set to 0 for A16, > likewise with the LM_CTL register. The pattern (3<<16) would enable > one of the "reserved" address spaces. > Nick emailed me privately that this was a static checker warning. These warnings are often false positives... But I'm worried about the test: if ((ctl & CA91CX42_VSI_CTL_VAS_M) == CA91CX42_VSI_CTL_VAS_A16) *aspace = VME_A16; That could be true when we didn't intend it. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] vme_tsi148: Allow setting VMEbus Global Timeout
On 06/06/14 20:41, Aaron Sierra wrote: Add a "gto" parameter to this driver so that the VMEbus Global Timeout value can be lowered from the default (8h -> 2048 us) or disabled completely. This patch also updates the TSI148_LCSR_VCTRL_GTO_* defines to match the Tsi148 User Reference Manual, which shows these values to be 4-bits instead of 3-bits. Signed-off-by: Aaron Sierra Hi Aaron, Sorry for the delay. Would it be worth at least warning the user that the GTO has not been set should they try to use an invalid GTO? Other than that, looks good to me. Martyn --- drivers/vme/bridges/vme_tsi148.c | 12 drivers/vme/bridges/vme_tsi148.h | 14 -- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c index 61e706c..5fec483 100644 --- a/drivers/vme/bridges/vme_tsi148.c +++ b/drivers/vme/bridges/vme_tsi148.c @@ -42,6 +42,7 @@ static void tsi148_remove(struct pci_dev *); /* Module parameter */ static bool err_chk; static int geoid; +static int gto = -1; static const char driver_name[] = "vme_tsi148"; @@ -2414,6 +2415,14 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_test; } + /* Setup VMEbus Global Timeout based on "gto" module parameter */ + if (!gto || ((gto > 2) && (gto < 12))) { + data = ioread32be(tsi148_device->base + TSI148_LCSR_VCTRL); + data &= ~TSI148_LCSR_VCTRL_GTO_M; + data |= gto ? (gto - 3) : TSI148_LCSR_VCTRL_GTO_DIS; + iowrite32be(data, tsi148_device->base + TSI148_LCSR_VCTRL); + } + /* Initialize wait queues & mutual exclusion flags */ init_waitqueue_head(&tsi148_device->dma_queue[0]); init_waitqueue_head(&tsi148_device->dma_queue[1]); @@ -2760,5 +2769,8 @@ module_param(err_chk, bool, 0); MODULE_PARM_DESC(geoid, "Override geographical addressing"); module_param(geoid, int, 0); +MODULE_PARM_DESC(gto, "VMEbus Global Timeout, 0=disabled, 3-11 (2^x usec)"); +module_param(gto, int, 0); + MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge"); MODULE_LICENSE("GPL"); diff --git a/drivers/vme/bridges/vme_tsi148.h b/drivers/vme/bridges/vme_tsi148.h index f5ed143..ad48a7c 100644 --- a/drivers/vme/bridges/vme_tsi148.h +++ b/drivers/vme/bridges/vme_tsi148.h @@ -779,16 +779,18 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_VCTRL_ATOEN(1<<7) /* Arbiter Time-out Enable */ #define TSI148_LCSR_VCTRL_ROBIN(1<<6) /* VMEbus Round Robin */ -#define TSI148_LCSR_VCTRL_GTO_M(7<<0)/* VMEbus Global Time-out Mask +#define TSI148_LCSR_VCTRL_GTO_M(0xf<<0) /* VMEbus Global Time-out Mask */ -#define TSI148_LCSR_VCTRL_GTO_8 (0<<0) /* 8 us */ -#define TSI148_LCSR_VCTRL_GTO_16 (1<<0) /* 16 us */ -#define TSI148_LCSR_VCTRL_GTO_32 (2<<0) /* 32 us */ -#define TSI148_LCSR_VCTRL_GTO_64 (3<<0) /* 64 us */ +#define TSI148_LCSR_VCTRL_GTO_8 (0<<0) /* 8 us */ +#define TSI148_LCSR_VCTRL_GTO_16 (1<<0)/* 16 us */ +#define TSI148_LCSR_VCTRL_GTO_32 (2<<0)/* 32 us */ +#define TSI148_LCSR_VCTRL_GTO_64 (3<<0)/* 64 us */ #define TSI148_LCSR_VCTRL_GTO_128 (4<<0) /* 128 us */ #define TSI148_LCSR_VCTRL_GTO_256 (5<<0) /* 256 us */ #define TSI148_LCSR_VCTRL_GTO_512 (6<<0) /* 512 us */ -#define TSI148_LCSR_VCTRL_GTO_DIS (7<<0)/* Disabled */ +#define TSI148_LCSR_VCTRL_GTO_1024 (7<<0)/* 1024 us */ +#define TSI148_LCSR_VCTRL_GTO_2048 (8<<0)/* 2048 us (default) */ +#define TSI148_LCSR_VCTRL_GTO_DIS (0xf<<0) /* Disabled */ /* * VMEbus Status Register CRG + $23C -- Martyn Welch (Lead Software Engineer) | Registered in England and Wales GE Intelligent Platforms | (3828642) at 100 Barbirolli Square T +44(0)1327322748 | Manchester, M2 3AB E martyn.we...@ge.com | VAT:GB 927559189 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement
On Sun, Jun 15, 2014 at 07:20:57PM +0200, Rickard Strandqvist wrote: > The same code regardless of the outcome of the if statement. This may of > course be a miss and there should be a difference in the code. > And clean up another duplicate line of code. > > This was partly found using a static code analysis program called cppcheck. > We don't need a cover letter for a single patch. Just put this stuff in the patch description next time. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] mmc: rtsx: add support for async request
On 06/16/2014 04:42 PM, Ulf Hansson wrote: @@ -36,7 +37,10 @@ struct realtek_pci_sdmmc { > struct rtsx_pcr *pcr; > struct mmc_host *mmc; > struct mmc_request *mrq; >+ struct workqueue_struct *workq; >+#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" > >+ struct work_struct work; I am trying to understand why you need a work/workqueue to implement this feature. Is that really the case? Could you elaborate on the reasons? Hi Uffe, we need return as fast as possible in mmc_host_ops request(ops->request) callback, so the mmc core can continue handle next request. when next request everything is ready, it will wait previous done(if not done), then call ops->request(). we can't use atomic context, because we use mutex_lock() to protect resource, and we have to hold the lock during handle request. So I use workq, we just queue a work and return in ops->request(), The mmc core can continue without blocking at ops->request(). Best Regards. micky. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: remove non-ascii-characters from HalBtc8812a1Ant.c
On Sat, Jun 14, 2014 at 08:56:34PM +0200, Toralf Förster wrote: > those characters breaks the html-formatter tool of Cppcheck > Cppcheck should be fixed. > Signed-off-by: Toralf Förster > --- > drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c > b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c > index 5a54bb1..e7fa7f4 100644 > --- a/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c > +++ b/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c > @@ -1670,7 +1670,7 @@ halbtc8812a1ant_TdmaDurationAdjustForAcl( > if (dn <= 0) > dn = 0; > > - if(up >= n) // if ?s?? n ??2?? retry count??0, > ?h?ռeWiFi duration > + if(up >= n) // Leaving an empty comment just to annoy checkpatch.pl is a pointless thing. These are Chinese comments. According to google translate it means: "if consecutive n-2 seconds retry count is 0, width-modulated WiFi duration" Git hub has a better html generator than cppcheck so you can admire the original Chinese characters and cut and paste. https://github.com/Canonical-kernel/Ubuntu-kernel/blob/master/drivers/staging/rtl8821ae/btcoexist/HalBtc8812a1Ant.c regarsd, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] mmc: rtsx: add support for async request
On 6 June 2014 09:05, wrote: > From: Micky Ching > > Add support for non-blocking request, pre_req() runs dma_map_sg() and > post_req() runs dma_unmap_sg(). This patch can increase card read/write > speed, especially for high speed card and slow speed CPU. > > Test on intel i3(800MHz - 2.3GHz) performance mode(2.3GHz), SD card > clock 208MHz > > run dd if=/dev/mmcblk0 of=/dev/null bs=64k count=1024 > before: > 67108864 bytes (67 MB) copied, 0.85427 s, 78.6 MB/s > after: > 67108864 bytes (67 MB) copied, 0.74799 s, 89.7 MB/s > > Signed-off-by: Micky Ching > --- > drivers/mmc/host/rtsx_pci_sdmmc.c | 133 > +++-- > 1 file changed, 127 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c > b/drivers/mmc/host/rtsx_pci_sdmmc.c > index 1c68e0d..a2c0858 100644 > --- a/drivers/mmc/host/rtsx_pci_sdmmc.c > +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -36,7 +37,10 @@ struct realtek_pci_sdmmc { > struct rtsx_pcr *pcr; > struct mmc_host *mmc; > struct mmc_request *mrq; > + struct workqueue_struct *workq; > +#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" > > + struct work_struct work; I am trying to understand why you need a work/workqueue to implement this feature. Is that really the case? Could you elaborate on the reasons? Kind regards Uffe > struct mutexhost_mutex; > > u8 ssc_depth; > @@ -48,6 +52,11 @@ struct realtek_pci_sdmmc { > int power_state; > #define SDMMC_POWER_ON 1 > #define SDMMC_POWER_OFF0 > + > + unsigned intsg_count; > + s32 cookie; > + unsigned intcookie_sg_count; > + boolusing_cookie; > }; > > static inline struct device *sdmmc_dev(struct realtek_pci_sdmmc *host) > @@ -86,6 +95,77 @@ static void sd_print_debug_regs(struct realtek_pci_sdmmc > *host) > #define sd_print_debug_regs(host) > #endif /* DEBUG */ > > +/* > + * sd_pre_dma_transfer - do dma_map_sg() or using cookie > + * > + * @pre: if called in pre_req() > + * return: > + * 0 - do dma_map_sg() > + * 1 - using cookie > + */ > +static int sd_pre_dma_transfer(struct realtek_pci_sdmmc *host, > + struct mmc_data *data, bool pre) > +{ > + struct rtsx_pcr *pcr = host->pcr; > + int read = data->flags & MMC_DATA_READ; > + int count = 0; > + int using_cookie = 0; > + > + if (!pre && data->host_cookie && data->host_cookie != host->cookie) { > + dev_err(sdmmc_dev(host), > + "error: data->host_cookie = %d, host->cookie = %d\n", > + data->host_cookie, host->cookie); > + data->host_cookie = 0; > + } > + > + if (pre || data->host_cookie != host->cookie) { > + count = rtsx_pci_dma_map_sg(pcr, data->sg, data->sg_len, > read); > + } else { > + count = host->cookie_sg_count; > + using_cookie = 1; > + } > + > + if (pre) { > + host->cookie_sg_count = count; > + if (++host->cookie < 0) > + host->cookie = 1; > + data->host_cookie = host->cookie; > + } else { > + host->sg_count = count; > + } > + > + return using_cookie; > +} > + > +static void sdmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, > + bool is_first_req) > +{ > + struct realtek_pci_sdmmc *host = mmc_priv(mmc); > + struct mmc_data *data = mrq->data; > + > + if (data->host_cookie) { > + dev_err(sdmmc_dev(host), > + "error: reset data->host_cookie = %d\n", > + data->host_cookie); > + data->host_cookie = 0; > + } > + > + sd_pre_dma_transfer(host, data, true); > + dev_dbg(sdmmc_dev(host), "pre dma sg: %d\n", host->cookie_sg_count); > +} > + > +static void sdmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, > + int err) > +{ > + struct realtek_pci_sdmmc *host = mmc_priv(mmc); > + struct rtsx_pcr *pcr = host->pcr; > + struct mmc_data *data = mrq->data; > + int read = data->flags & MMC_DATA_READ; > + > + rtsx_pci_dma_unmap_sg(pcr, data->sg, data->sg_len, read); > + data->host_cookie = 0; > +} > + > static int sd_read_data(struct realtek_pci_sdmmc *host, u8 *cmd, u16 > byte_cnt, > u8 *buf, int buf_len, int timeout) > { > @@ -415,7 +495,7 @@ static int sd_rw_multi(struct realtek_pci_sdmmc *host, > struct mmc_request *mrq) > > rtsx_pci_send_cmd_no_wait(pcr); > > - err = rtsx_pci_transfer_data(pcr, data->sg, data->sg_len, read, > 1); > + err = rtsx_pci_dma_tra
Attention,
Office of the Honorable Minister of Finance Federal Ministry of Finance (FMF) FMF Annex Complex Building Garki, Abuja-Nigeria Our Ref:CBN/FMF/CBX/021/07/014 Contract No: MAV.NNPC/FGN/MIN. Attention, I am Director Federal Ministry of Finance and was instructed by the President Federal Republic of Nigeria Dr. Good luck Jonathan to find out before the end of this year, WHY your contract/ claim of your fund have not been credited to your account, after instructions has been passed to all various Government quarters that all over due contract/ claim payments should be released as alot of petitions by beneficiary's has been received by the Minister. What this office wants you to reconfirm, with your telephone and fax numbers,any other information?s below, WHY you have not received your payment up-till date? However I will give my assistance to make sure your file is in order for payment as two people came for the claim of the fund and submitted account saying that you are not well. (1) Your Full Name. (2) Phone, Fax and Mobile Number#. (3) Company?s Name, Position and Address. (4) Profession, Age and Marital Status. (5) Copy Of Your Intl Passport or Scanned Identity to prove you. But you must give me a promissory note stating your willingness to give me a reasonable amount of money from your contract Payment immediately you get the payment, after receiving all the needed information?s from you I will pass your payment to the Deputy Governor of Central Bank of Nigeria Dr. Kingsley Chiedu Moghalu will make the transfer of your fund to your account because our Central Bank Governor will be busy in the office. Yours faithfully Mrs. Ngozi Okonjo-Iweala (Director Federal Ministry of finance Nigeria) +234701-762-8305 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: remove memset(0) after LIBCFS_ALLOC
On Sat, Jun 14, 2014 at 05:29:51PM +1000, Vitaly Osipov wrote: > Joe Perches mentioned on driverdev-devel that memset after LIBCFS_ALLOC > is not necessary as it is already done during LIBCFS_ALLOC_POST. This > commit removes these unnecessary memsets. Based on the results of running > a cocci patch along the lines of: > > @@ > expression E1, E2; > @@ > > LIBCFS_ALLOC (E1,E2); > ... > - memset(E1,0,E2); > > Signed-off-by: Vitaly Osipov Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: ced1401: fix sparse warning for ced1401
On Sat, Jun 14, 2014 at 02:04:38PM +0900, Seunghun Lee wrote: > This patch fixes below warning. > > drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in > assignment (different address spaces) > drivers/staging/ced1401/ced_ioc.c:703:30:expected void *[usertype] > lpvBuff > drivers/staging/ced1401/ced_ioc.c:703:30:got char [noderef] > *puBuf > > Signed-off-by: Seunghun Lee No. This silences the warning by disabling Sparse. Fix the annotations instead. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: slicoss: Fix coding style issue
On Fri, Jun 13, 2014 at 10:04:35AM -0700, Greg KH wrote: > On Fri, Jun 13, 2014 at 05:52:33PM +0200, Benedict Boerger wrote: > > Fix a coding style issue found by checkpatch.pl. > > Use ether_addr_copy instead of memcpy. > > > > Done to complete a eudyptula task. > > > > Signed-off-by: Benedict Boerger > > > > --- > > drivers/staging/slicoss/slicoss.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/slicoss/slicoss.c > > b/drivers/staging/slicoss/slicoss.c > > index 48841e7..02807a3 100644 > > --- a/drivers/staging/slicoss/slicoss.c > > +++ b/drivers/staging/slicoss/slicoss.c > > @@ -1790,7 +1790,7 @@ static int slic_mcast_add_list(struct adapter > > *adapter, char *address) > > if (mcaddr == NULL) > > return 1; > > > > - memcpy(mcaddr->address, address, ETH_ALEN); > > + ether_addr_copy(mcaddr->address, address); > > > > mcaddr->next = adapter->mcastaddrs; > > adapter->mcastaddrs = mcaddr; > > Are you sure this is correct? It's not always a one-to-one replacement > from what I have been told. I hate this checkpatch.pl warning because it just encourages people to add bugs. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse
On Mon, Jun 16, 2014 at 10:40:19AM +0300, Dan Carpenter wrote: > On Sun, Jun 15, 2014 at 09:32:27PM +0200, Sam Ravnborg wrote: > > diff --git a/expand.c b/expand.c > > index 0f6720c..4a96de4 100644 > > --- a/expand.c > > +++ b/expand.c > > @@ -187,7 +187,7 @@ static int simplify_int_binop(struct expression *expr, > > struct symbol *ctype) > > return 0; > > r = right->value; > > if (expr->op == SPECIAL_LEFTSHIFT || expr->op == SPECIAL_RIGHTSHIFT) { > > - if (r >= ctype->bit_size) { > > + if (expr->flags & Int_const_expr && r >= ctype->bit_size) { > > Thanks! I had no idea how to start writing a fix for this, but the test > should be: > if (expr->right->flags & Int_const_expr > > Otherwise both sides of the shift have to be const. Thanks - will fix. I will update the test case to check for this, and then send a proper patch. Sam ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: fix Missing a blank line after declarations warnings
Wrong description, doesn't apply, and breaks the build. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: vt6655: remove unnecessary typedef struct.
On Fri, Jun 13, 2014 at 12:23:43PM +0200, Martin Kepplinger wrote: > Remove a totally unnecessary typedef. This is more readable now. Choose a lower case name for the struct, otherwise we have to change all these again in a while. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: vt6655: preserve address space by not casting
On Fri, Jun 13, 2014 at 12:11:51PM +0200, Martin Kepplinger wrote: > Fix the sparse error: cast removes address space of expression. > --- > Is that even correct? It's correct but not complete. vt6655 impliment their own versions of ethtool_ioctl() when they should be using the standard versions. The vt6655 version of ethtool_ioctl() should be annotated so it's marked that the second parameter is marked as a __user pointer. It doesn't print a Sparse warning because at a certain point Sparse just says: "warning: too many warnings" and gives up. > I haven't signed-off on it yet. > ethtool_ioctl() takes a (void *) as user data, dereferenced and assigend to > u32. > applies to next-20140611 It doesn't dereference the pointer. You are getting mixed up with the vt6656 version of ethtool_ioctl() I think? You're not allowed to dereference __user pointers. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse
On Sun, Jun 15, 2014 at 09:32:27PM +0200, Sam Ravnborg wrote: > diff --git a/expand.c b/expand.c > index 0f6720c..4a96de4 100644 > --- a/expand.c > +++ b/expand.c > @@ -187,7 +187,7 @@ static int simplify_int_binop(struct expression *expr, > struct symbol *ctype) > return 0; > r = right->value; > if (expr->op == SPECIAL_LEFTSHIFT || expr->op == SPECIAL_RIGHTSHIFT) { > - if (r >= ctype->bit_size) { > + if (expr->flags & Int_const_expr && r >= ctype->bit_size) { Thanks! I had no idea how to start writing a fix for this, but the test should be: if (expr->right->flags & Int_const_expr Otherwise both sides of the shift have to be const. > if (conservative) > return 0; > r = check_shift_count(expr, ctype, r); > regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: goldfish: fix coding style.
Using an else following a break or return can unnecessarily indent code blocks. This patch fixes coding style reported by checkpatch.pl, a part of eudyptula challenge. Signed-off-by: Hoang Tran --- drivers/staging/goldfish/goldfish_audio.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c index cbd4567..a166424 100644 --- a/drivers/staging/goldfish/goldfish_audio.c +++ b/drivers/staging/goldfish/goldfish_audio.c @@ -203,10 +203,10 @@ static int goldfish_audio_open(struct inode *ip, struct file *fp) AUDIO_INT_WRITE_BUFFER_2_EMPTY); AUDIO_WRITE(audio_data, AUDIO_INT_ENABLE, AUDIO_INT_MASK); return 0; - } else { - atomic_dec(&open_count); - return -EBUSY; } + + atomic_dec(&open_count); + return -EBUSY; } static int goldfish_audio_release(struct inode *ip, struct file *fp) @@ -223,8 +223,8 @@ static long goldfish_audio_ioctl(struct file *fp, unsigned int cmd, /* temporary workaround, until we switch to the ALSA API */ if (cmd == 315) return -1; - else - return 0; + + return 0; } static irqreturn_t goldfish_audio_interrupt(int irq, void *dev_id) -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: Use %ld to format long
Hi Greg, On Wed, Jun 11, 2014 at 7:00 PM, Geert Uytterhoeven wrote: > drivers/staging/lustre/lustre/llite/rw26.c: In function ‘ll_direct_IO_26’: > drivers/staging/lustre/lustre/llite/rw26.c:388: warning: format ‘%zd’ expects > type ‘signed size_t’, but argument 6 has type ‘long int’ > drivers/staging/lustre/lustre/llite/rw26.c:388: warning: format ‘%zd’ expects > type ‘signed size_t’, but argument 10 has type ‘long int’ > > Introduced by commit b41a1fe067c34b40736860458b9d62b2139471d5 ("staging: > lustre: Use %zd to format ssize_t"), which was part of a series to fix > issues in -next. However, the commits introducing the issues never made it > to mainline. They have now, so please drop this patch. > Signed-off-by: Geert Uytterhoeven > --- > drivers/staging/lustre/lustre/llite/rw26.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/llite/rw26.c > b/drivers/staging/lustre/lustre/llite/rw26.c > index 55ca8d3c3e46..5b944d3fb80c 100644 > --- a/drivers/staging/lustre/lustre/llite/rw26.c > +++ b/drivers/staging/lustre/lustre/llite/rw26.c > @@ -386,7 +386,7 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb, > return -EINVAL; > > CDEBUG(D_VFSTRACE, > - "VFS Op:inode=%lu/%u(%p), size=%zd (max %lu), > offset=%lld=%llx, pages %zd (max %lu)\n", > + "VFS Op:inode=%lu/%u(%p), size=%ld (max %lu), > offset=%lld=%llx, pages %ld (max %lu)\n", >inode->i_ino, inode->i_generation, inode, count, MAX_DIO_SIZE, >file_offset, file_offset, count >> PAGE_CACHE_SHIFT, >MAX_DIO_SIZE >> PAGE_CACHE_SHIFT); > -- > 1.9.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel