Re: [PATCH 0/6] use devicemodel with parport
On Mon, Jun 01, 2015 at 03:18:11PM +0900, Greg Kroah-Hartman wrote: > On Mon, Jun 01, 2015 at 11:16:51AM +0530, Sudip Mukherjee wrote: > > On Mon, Jun 01, 2015 at 07:05:30AM +0900, Greg Kroah-Hartman wrote: > > > On Wed, May 20, 2015 at 08:56:56PM +0530, Sudip Mukherjee wrote: > > > And then there are some pending bugs in bugzilla. I am also planning to > > add the code for epst in paride (i saw in many forums that people are > > not able to use their scanner on latest kernels). > > "epst"? What's that? it was part of ppscsi, mainly needed to use HP scanjet 5100C. I had a short look and it seems like the other parts of ppscsi are already there in paride, but somehow epst was leftout and Tim says he is not interested with that code now. And besides paride might get orphaned now, so there is noone else to re-add that support in the newer kernels. My only hesitation is that I donot have the scanner to test the code. :( regards sudip > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: adv_pci1724: Remove redundant return statements
On 01/06/15 07:06, Sharma, Abhishek (A.) wrote: From: Abhishek Sharma Replace unnecessary conditional checks for variable 'ret' and replace by single return statement. Signed-off-by: Abhishek Sharma diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index f7a7dab..9677111 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -180,11 +180,7 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev, s->insn_write= adv_pci1724_insn_write; s->private = (void *)PCI1724_DAC_CTRL_MODE_GAIN; - ret = comedi_alloc_subdev_readback(s); - if (ret) - return ret; - - return 0; + return comedi_alloc_subdev_readback(s); } static struct comedi_driver adv_pci1724_driver = { OK. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.
On Sun, May 31, 2015 at 02:43:16PM -0500, Petros Koutoupis wrote: > Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a > Linux > RAM drive module which allows the user to dynamically create, remove, and > resize > RAM-based block devices. RapidDisk is designed to work with both volatile and > non-volatile memory. In the case of volatile memory, memory is allocated only > when > needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO > Write-Through caching node to a slower block device. > > Signed-off-by: Petros Koutoupis This feels like it could be merged without going through staging. It looks like ok code to me. > --- > Kconfig |2 > Makefile |1 > rapiddisk/Documentation/rxdsk.txt | 74 ++ > rapiddisk/Kconfig | 10 > rapiddisk/Makefile|2 > rapiddisk/rxcache.c | 1181 > ++ > rapiddisk/rxcommon.h | 22 > rapiddisk/rxdsk.c | 799 + > 8 files changed, 2091 insertions(+) > > diff -uNpr linux-next.orig/drivers/staging/Kconfig > linux-next/drivers/staging/Kconfig > --- linux-next.orig/drivers/staging/Kconfig 2015-05-30 13:37:03.929726967 > -0500 > +++ linux-next/drivers/staging/Kconfig 2015-05-31 13:36:08.673757913 -0500 > @@ -112,4 +112,6 @@ source "drivers/staging/fsl-mc/Kconfig" > > source "drivers/staging/wilc1000/Kconfig" > > +source "drivers/staging/rapiddisk/Kconfig" > + > endif # STAGING > diff -uNpr linux-next.orig/drivers/staging/Makefile > linux-next/drivers/staging/Makefile > --- linux-next.orig/drivers/staging/Makefile2015-05-30 13:37:03.921726968 > -0500 > +++ linux-next/drivers/staging/Makefile 2015-05-31 13:36:08.753757911 -0500 > @@ -48,3 +48,4 @@ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += > obj-$(CONFIG_FB_TFT) += fbtft/ > obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ > obj-$(CONFIG_WILC1000) += wilc1000/ > +obj-$(CONFIG_RXDSK)+= rapiddisk/ > diff -uNpr linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt > linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt > --- linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt > 1969-12-31 18:00:00.0 -0600 > +++ linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt > 2015-05-31 13:38:29.893753897 -0500 > @@ -0,0 +1,74 @@ > +RapidDisk (rxdsk) RAM disk and RapidCache (rxcache) Linux modules > + > +== Description == > + > +RapidDisk or rxdsk was designed to be used in high performing environments > +and has been designed with simplicity in mind. Utilizing a user land binary, > +the system administrator is capable of dynamically adding new RAM based > +block devices of varying sizes, removing existing ones to even listing all > +existing RAM block devices. The rxdsk module has been designed to allocate > +from the system's memory pages and is capable of addressing memory to > +support Gigabytes if not a Terabyte of available Random Access Memory. > + > +RapidCache or rxcache is designed to leverage the high speed performing > +technologies of the RapidDisk RAM disk and utilizing the Device Mapper > +framework, map an rxdsk volume to act as a block device's Write/Read-through > +cache. This can significantly boost the performance of a local or remote > +disk device. > + > + > +== Module Parameters == > + > +RapidDisk > +- > +max_rxcnt: Total RAM Disk devices available for use. (Default = 128 = MAX) > (int) > +max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) > (int) > +nr_requests: Number of requests at a given time for the request queue. > (Default = 128) (int) > + > +RapidCache > +- > +None. > + > + > +== Usage == > + > +RapidDisk > +- > +It is advised to utilize the userland utility, rxadm, but this is > essentially what is > +written to the /proc/rxctl proc file to manage rxdsk volumes: > + > +Attach a new rxdsk volume by typing (size in sectors): > +# echo "rxdsk attach 0 8192" > /proc/rxctl > + > +Attach a non-volatile rxdsk volume by typing (starting / ending addresses > +in decimal format): > +# echo "rxdsk attach-nv 0 1234 56789" > /proc/rxctl > + > +Detach an existing rxdsk volume by typing: > +# echo "rxdsk detach 0" > /proc/rxctl > + > +Resize an existing rxdsk volume by typing (size in sectors): > +# echo "rxdsk resize 0 65536" > /proc/rxctl > + > + > +Note - the integer after the "rxdsk " is the RapidDisk volume > number. "0" > +would signify "rxd0." > + > +RapidCache > +- > +It is advised to utilize the userland utility, rxadm, but this is > essentially what is > +sent to the dmsetup command: > + > +Map an existing rxdsk volume to a block device by typing: > +# echo 0 4194303 rxcache /dev/sdb /dev/rxd0 0 8 196608|dmsetup create > rxc0 > + > +Parameter 1: Start block of source volume (in se
Re: [PATCHv3] staging: sm750fb: Add missing Kconfig dependency
On Sun, May 31, 2015 at 11:36:09AM +0900, gre...@linuxfoundation.org wrote: > On Thu, May 28, 2015 at 08:51:06AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > The sm750fb driver has few Framebuffer configuration dependencies that > > need to be selected in order to get compiled successfully. > > > > Signed-off-by: Gujulan Elango Hari Prasath > > --- > > v3: Fix alignment issues addressed by Dan Carpenter. > > > > v2:Addressed the review comments by Sudhip Mukherjee as I had > > missed out a few other dependencies for this driver in my previous > > version of the patch. > > > > Signed-off-by: Gujulan Elango Hari Prasath > > 2 signed-off-by lines??? sorry about that Greg,I will send a v4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: ni_at_a2150: remove extra spaces before tab
On 01/06/15 05:14, Joglekar Tejas wrote: This patch fix warning given by checkpatch.pl abouts spaces given before tab Signed-off-by: Joglekar Tejas --- drivers/staging/comedi/drivers/ni_at_a2150.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 3a972d1..60469bb 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -106,7 +106,7 @@ TRIG_WAKE_EOS #define IRQ_LVL_BITS(x) (((x) & 0xf) << 4)/* sets irq level */ #define FIFO_INTR_EN_BIT0x100 /* enable fifo interrupts */ #define FIFO_INTR_FHF_BIT 0x200 /* interrupt fifo half full */ -#define DMA_INTR_EN_BIT 0x800 /* enable interrupt on dma terminal count */ +#define DMA_INTR_EN_BIT 0x800 /* enable interrupt on dma terminal count */ #define DMA_DEM_EN_BIT 0x1000 /* enables demand mode dma */ #define I8253_BASE_REG0x14 OK. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv4] staging: sm750fb: Add missing Kconfig dependency
From: Hari Prasath Gujulan Elango The sm750fb driver has few Framebuffer configuration dependencies that need to be selected in order to get compiled successfully Signed-off-by: Hari Prasath Gujulan Elango --- v4: Final version with From name & signed off by matching v3: Fix alignment issues addressed by Dan Carpenter. v2:Addressed the review comments by Sudhip Mukherjee as I had missed out a few other dependencies for this driver in my previous version of the patch. --- drivers/staging/sm750fb/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig index c40d088..ccebc25 100644 --- a/drivers/staging/sm750fb/Kconfig +++ b/drivers/staging/sm750fb/Kconfig @@ -1,6 +1,10 @@ config FB_SM750 tristate "Silicon Motion SM750 framebuffer support" depends on FB && PCI + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT help Frame buffer driver for the Silicon Motion SM750 chip with 2D accelearion and dual head support. -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rts5208: remove variable and check directly
On Sun, May 31, 2015 at 11:34:23AM +0900, gre...@linuxfoundation.org wrote: > On Fri, May 15, 2015 at 11:33:53AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > This trivial patch removes temporary variable to check return value of > > a function and checks return value directly. > > > > Signed-off-by: Hari Prasath Gujulan Elango > > Same name problem here, and on all of your other patches you sent in. > Please fix up and resend all of them, I've now dropped them from my > queue. > > thanks, > > greg k-h Please excuse me for the mess.Our company's e-mail display's the last name and first name in this fashion and theres nothing much we could do about it.Hence we have decided to use the additional 'From' field suggested by you in the body of the commit message.I will send a new version of the patches which has this issue. regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2] staging: rts5208: remove variable and check directly
From: Hari Prasath Gujulan Elango This trivial patch removes temporary variable to check return value of a function and checks return value directly. Signed-off-by: Hari Prasath Gujulan Elango --- v2:signed off by and From names were not matching in previous version as pointed out by Greg. --- drivers/staging/rts5208/ms.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index ee818b0..ab6e8bc 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -52,7 +52,6 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 trans_mode, u8 tpc, u8 cnt, u8 cfg) { struct ms_info *ms_card = &(chip->ms_card); - int retval; u8 *ptr; dev_dbg(rtsx_dev(chip), "%s: tpc = 0x%x\n", __func__, tpc); @@ -72,8 +71,7 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 trans_mode, rtsx_add_cmd(chip, READ_REG_CMD, MS_TRANS_CFG, 0, 0); - retval = rtsx_send_cmd(chip, MS_CARD, 5000); - if (retval < 0) { + if (rtsx_send_cmd(chip, MS_CARD, 5000) < 0) { rtsx_clear_ms_error(chip); ms_set_err_code(chip, MS_TO_ERROR); rtsx_trace(chip); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: remove unwanted assignment
On Sun, May 31, 2015 at 11:33:32AM +0900, gre...@linuxfoundation.org wrote: > On Thu, May 14, 2015 at 09:04:00AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > remove an unwanted assignment to a variable which is overwritten in the > > very next line.The first value assigned is not used. > > > > Signed-off-by: Hari Prasath Gujulan Elango > > Your name doesn't match the From: line, please fix up your email client > and resend. > > thanks, > > greg k-h Greg,this is not a problem with mail client.I am using Mutt.I will send a v2 for this as well. Thanks for your time to review it. regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2] staging: rtl8188eu: remove unwanted assignment
From: Hari Prasath Gujulan Elango remove an unwanted assignment to a variable which is overwritten in the very next line.The first value assigned is not used. Signed-off-by: Hari Prasath Gujulan Elango --- v2: From name & signed off by were not matching.Added the From field in commit message. --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 7b01d5a..8726222 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -2077,7 +2077,6 @@ static void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_l break; } - rate_bitmap = 0x0fff; rate_bitmap = ODM_Get_Rate_Bitmap(&haldata->odmpriv, mac_id, mask, rssi_level); DBG_88E("%s => mac_id:%d, networkType:0x%02x, mask:0x%08x\n\t ==> rssi_level:%d, rate_bitmap:0x%08x\n", __func__, mac_id, networkType, mask, rssi_level, rate_bitmap); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8712: fix indentation issue
On Sun, May 31, 2015 at 09:56:54AM +0900, gre...@linuxfoundation.org wrote: > On Tue, May 12, 2015 at 12:25:22PM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > Fixed indentation issue in few lines. > > > > Signed-off-by: Hari Prasath Gujulan Elango > > Same name problem :( v2 on the way.Thanks for your review. regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2] staging: rtl8712: fix indentation issue
From: Hari Prasath Gujulan Elango Fixed indentation issue in few lines Signed-off-by: Hari Prasath Gujulan Elango --- v2:From name & signed off by were not matching.Added the From field in commit message --- drivers/staging/rtl8712/recv_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c index 799a0f9..4201ce7 100644 --- a/drivers/staging/rtl8712/recv_linux.c +++ b/drivers/staging/rtl8712/recv_linux.c @@ -132,9 +132,9 @@ void r8712_recv_indicatepkt(struct _adapter *padapter, return; _recv_indicatepkt_drop: /*enqueue back to free_recv_queue*/ -if (precv_frame) + if (precv_frame) r8712_free_recvframe(precv_frame, pfree_recv_queue); -precvpriv->rx_drop++; + precvpriv->rx_drop++; } static void _r8712_reordering_ctrl_timeout_handler (unsigned long data) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: remove ununsed Macro
From: Hari Prasath Gujulan Elango Remove the ununsed Macro.This patch needs to be applied after my previous patch is applied whose title is given below because this macro becomes ununsed after that.This was suggested by Sudip. staging: dgnc: delete all references to 'flipbuf' Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/dgnc/dgnc_driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 3dee9f3..ebb3439 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -66,7 +66,6 @@ /* 4 extra for alignment play space */ #define WRITEBUFLEN((4096) + 4) -#define MYFLIPLEN N_TTY_BUF_SIZE #define dgnc_jiffies_from_ms(a) (((a) * HZ) / 1000) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: delete all references to 'flipbuf'
On Sat, May 30, 2015 at 11:18:00AM +0530, Sudip Mukherjee wrote: > On Fri, May 29, 2015 at 07:17:37AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > This patch deletes all references to 'flipbuf'.Memory is allocated and > > freed but never used anywhere in the driver.Also deleted an ununsed > > Macro defined in the header file. > after your patch MYFLIPLEN becomes unused now. > can u please remove that also in a separate patch? > > regards > sudip > Sudip,I have sent out a new patch with the ununsed Macro removed.Thanks for your review comment. Regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2] staging: rts5208: remove variable and check directly
On Mon, Jun 01, 2015 at 09:41:52AM +, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango > > This trivial patch removes temporary variable to check return value of > a function and checks return value directly. > This isn't an improvement. We want to adopt normal kernel error codes every where but this code moves us backward. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: check return value before using pointer
On Sat, May 30, 2015 at 11:12:01AM +0530, Sudip Mukherjee wrote: > On Thu, May 28, 2015 at 12:35:22PM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > Check the return value of kcalloc first and then use the pointer. > > > > Signed-off-by: Gujulan Elango Hari Prasath > > --- > > > - > > - if (!brd->msgbuf) { > > + if (!brd->msgbuf_head) { > > kfree(brd); > > return -ENOMEM; > > } > > > > + brd->msgbuf = brd->msgbuf_head; > > + > > + > checkpatch with --strict complains about multiple blank lines. > > regards > sudip Ok Sudip.I never knew of the strict option.I will fix and send a v2 thanks & regards hari prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2] staging: dgnc: check return value before using pointer
From: Hari Prasath Gujulan Elango Check the return value of kcalloc first and then use the pointer Signed-off-by: Hari Prasath Gujulan Elango --- v2:Deleted multiple empty lines as checkpatch.pl with strict option warned about it as per review comments from sudip --- drivers/staging/dgnc/dgnc_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 7546aff..0ed16db 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -384,13 +384,13 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* make a temporary message buffer for the boot messages */ brd->msgbuf_head = kcalloc(8192, sizeof(u8), GFP_KERNEL); - brd->msgbuf = brd->msgbuf_head; - - if (!brd->msgbuf) { + if (!brd->msgbuf_head) { kfree(brd); return -ENOMEM; } + brd->msgbuf = brd->msgbuf_head; + /* store the info for the board we've found */ brd->magic = DGNC_BOARD_MAGIC; brd->boardnum = dgnc_NumBoards; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2] staging: rts5208: remove variable and check directly
On Mon, Jun 01, 2015 at 01:12:18PM +0300, Dan Carpenter wrote: > On Mon, Jun 01, 2015 at 09:41:52AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > From: Hari Prasath Gujulan Elango > > > > This trivial patch removes temporary variable to check return value of > > a function and checks return value directly. > > > > This isn't an improvement. We want to adopt normal kernel error codes > every where but this code moves us backward. > > regards, > dan carpenter > Dan yes this doesn't make any improvement.The 'retval' variable was used only at this place so removed it. This 'retval' value is not returned as well in this function. regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: remove unwanted else block
On Sat, May 30, 2015 at 11:35:01AM +0530, Sudip Mukherjee wrote: > On Fri, May 29, 2015 at 08:16:21AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > Remove the unwanted else block > something is wrong. This patch is also not applying. > I am on staging-testing. > > regards > sudip > Sudip,it applies fine for me. We will see if anyone else faces the same problem in applying the patch.I am sending a v2 with From name & signed off by corrected. regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2] staging: dgnc: remove unwanted else block
From: Gujulan Elango Hari Prasath Remove the unwanted else block Signed-off-by: Gujulan Elango Hari Prasath --- v2:From name & signed off by were not matching.Added the From field in commit message. --- drivers/staging/dgnc/dgnc_tty.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 2397c66..ca07b7f 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -899,10 +899,6 @@ void dgnc_check_queue_flow_control(struct channel_t *ch) ch->ch_stops_sent = 0; ch->ch_bd->bd_ops->send_start_character(ch); } - /* No FLOW */ - else { - /* Nothing needed. */ - } } } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/6] hv:scsi:Untangle the storage protocol negotiation from the vmbus protocol negotiation.
On Fri, May 29, 2015 at 01:29:16PM -0700, K. Y. Srinivasan wrote: > - if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || > - vstor_packet->status != 0) > + if (vstor_packet->status != 0) { > + ret = -EINVAL; > goto cleanup; > + } There is not actually any cleanup, goto cleanup is just a do-nothing goto. In the original code, we returned success here. That always looked like a "forgot to set the error code" bug to me, but do-nothing labels always introduce ambiguous looking "forgot to set the error code" bugs so I can never be positive. Could you take a look at the other "goto cleanup;" places in this function and maybe add a comment, change it to something more clear like "return 0;" or fix the error code? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/6] scsi: storvsc: Rather than look for sets of specific protocol versions, make decisions based on ranges.
On Fri, May 29, 2015 at 01:29:14PM -0700, K. Y. Srinivasan wrote: > From: keith.ma...@microsoft.com Keith's name is wrong. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2] staging: rts5208: remove variable and check directly
On Mon, Jun 01, 2015 at 10:27:35AM +, Gujulan Elango, Hari Prasath (H.) wrote: > On Mon, Jun 01, 2015 at 01:12:18PM +0300, Dan Carpenter wrote: > > On Mon, Jun 01, 2015 at 09:41:52AM +, Gujulan Elango, Hari Prasath (H.) > > wrote: > > > From: Hari Prasath Gujulan Elango > > > > > > This trivial patch removes temporary variable to check return value of > > > a function and checks return value directly. > > > > > > > This isn't an improvement. We want to adopt normal kernel error codes > > every where but this code moves us backward. > > > > regards, > > dan carpenter > > > > Dan yes this doesn't make any improvement.The 'retval' variable was used > only at this place so removed it. This 'retval' value is not returned as > well in this function. It's not returned but it probably should be eventually. Also the original code is slightly easier to read. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2] staging: rts5208: remove variable and check directly
On Mon, Jun 01, 2015 at 02:02:06PM +0300, Dan Carpenter wrote: > On Mon, Jun 01, 2015 at 10:27:35AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > On Mon, Jun 01, 2015 at 01:12:18PM +0300, Dan Carpenter wrote: > > > On Mon, Jun 01, 2015 at 09:41:52AM +, Gujulan Elango, Hari Prasath > > > (H.) wrote: > > > > From: Hari Prasath Gujulan Elango > > > > > > > > This trivial patch removes temporary variable to check return value of > > > > a function and checks return value directly. > > > > > > > > > > This isn't an improvement. We want to adopt normal kernel error codes > > > every where but this code moves us backward. > > > > > > regards, > > > dan carpenter > > > > > > > Dan yes this doesn't make any improvement.The 'retval' variable was used > > only at this place so removed it. This 'retval' value is not returned as > > well in this function. > > It's not returned but it probably should be eventually. Also the > original code is slightly easier to read. > > regards, > dan carpenter > Fine Dan,lets discard this patch.I agree with you. Thanks & Regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: remove ununsed Macro
On Mon, Jun 01, 2015 at 10:08:46AM +, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango > > Remove the ununsed Macro.This patch needs to be applied after my > previous patch is applied whose title is given below because this macro > becomes ununsed after that.This was suggested by Sudip. If you need patches to be applied in order, please send a patch series, properly numbered. You sent me 3 patches for this driver, and I have no idea what order they need to go in, so I'm going to just drop them all and wait for you to resend them. Remember the text you have in the changelog stays there for forever, don't put things in it that do not matter. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings
On Mon, Jun 01, 2015 at 01:03:16PM +0900, Greg KH wrote: > On Sun, May 31, 2015 at 11:24:42PM -0300, Gaston Gonzalez wrote: > > On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote: > > > On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote: > > > > On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote: > > > > > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote: > > > > > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote: > > > > > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote: > > > > > > > > Fix the following sparse warnings: > > > > > > > > > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: > > > > > > > > warning: incorrect type in assignment (different base types) > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: > > > > > > > > expected restricted __le16 [usertype] frame_ctl > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: > > > > > > > > got int > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: > > > > > > > > warning: invalid assignment: |= > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: > > > > > > > > left side has type restricted __le16 > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: > > > > > > > > right side has type int > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Gaston Gonzalez > > > > > > > > --- > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 > > > > > > > > +++-- > > > > > > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > Still doesn't apply, but this might be a git bug, see below: > > > > > > > > > > > > > > > diff --git > > > > > > > > a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c > > > > > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c > > > > > > > > index d2e8b12..0477ba1 100644 > > > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c > > > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c > > > > > > > > @@ -660,2 +660,2 @@ inline struct sk_buff > > > > > > > > *ieee80211_authentication_req(struct ieee80211_network *be > > > > > > > > auth = (struct ieee80211_authentication *) > > > > > > > > skb_put(skb, sizeof(struct > > > > > > > > ieee80211_authentication)); > > > > > > > > > > > > > > > > - auth->header.frame_ctl = IEEE80211_STYPE_AUTH; > > > > > > > > - if (challengelen) auth->header.frame_ctl |= > > > > > > > > IEEE80211_FCTL_WEP; > > > > > > > > + auth->header.frame_ctl = > > > > > > > > cpu_to_le16(IEEE80211_STYPE_AUTH); > > > > > > > > + if (challengelen) > > > > > > > > + auth->header.frame_ctl |= > > > > > > > > cpu_to_le16(IEEE80211_FCTL_WEP); > > > > > > > > > > > > > > > > auth->header.duration_id = 0x013a; //FIXME > > > > > > > > > > > > > > > > -- > > > > > > > > 2.1.4 > > > > > > > > > > > > > > This patch is not created properly. Did you edit it by hand? If > > > > > > > not, > > > > > > > we need to report a bug as the diff is obviously wrong, look at > > > > > > > the @@@ > > > > > > > line. > > > > > > > > > > > > > > Can you update your version of git to see if it's fixed there? > > > > > > > > > > > > > > Also, patch tells you that this is broken: > > > > > > > > > > > > > > checking file > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c > > > > > > > patch: malformed patch at line 132: > > > > > > > skb_put(skb, sizeof(struct ieee80211_authentication)); > > > > > > > > > > > > Greg, > > > > > > > > > > > > The patch was prepared using git format-patch. The git version I'm > > > > > > using: > > > > > > > > > > > > gaston22:\-$ git --version > > > > > > git version 2.1.4 > > > > > > > > > > > > I did deleted 4 whitespaces by hand after running checkpatch.pl on > > > > > > the patch. > > > > > > Could that drive the issue? However, I could properly apply the > > > > > > patch using 'git > > > > > > am' from an email and get the git log right. > > > > > > > > > > Yes, but is there really a commit there? That's what messed me up > > > > > last > > > > > time, git applied it, but with no actual diff (which is probably a bug > > > > > too, just a different one...) > > > > > > > > > > > > > Yes, there was a commit. In fact the patch prepare: git format-patch -1 > > > > > > > > > And if you edited it by hand, that might explain the issue, what did > > > > > the > > > > > "original" patch look like? > > > > > > > > Attached the original patch I submitted: > > > > 0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch > > > > > > Which is broken. > > > > > > > Attached is also the patch without the hand-edited deletions: > > > > > > > > ieee80211_softmac_fixes_v3.patch > > > > > > That patch is correct. > > > > >
Re: [PATCH] staging: dgnc: remove ununsed Macro
On Mon, Jun 01, 2015 at 09:05:54PM +0900, gre...@linuxfoundation.org wrote: > On Mon, Jun 01, 2015 at 10:08:46AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > From: Hari Prasath Gujulan Elango > > > > Remove the ununsed Macro.This patch needs to be applied after my > > previous patch is applied whose title is given below because this macro > > becomes ununsed after that.This was suggested by Sudip. > > If you need patches to be applied in order, please send a patch series, > properly numbered. You sent me 3 patches for this driver, and I have no > idea what order they need to go in, so I'm going to just drop them all > and wait for you to resend them. > > Remember the text you have in the changelog stays there for forever, > don't put things in it that do not matter. > > thanks, > > greg k-h sorry about that.First I sent only one patch. When i sent that,I didn't realize that a MACRO went unused.It was pointed to me as a review comment by Sudip.Both are changes in the same driver.I will send both these patches as patchset.Please discard this and the other related patch whicl deletes reference to 'flipbuf'.Excuse me for the inconvenience caused. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: cleanup not needed else clauses
cleanup checkpatch.pl warnings about not needed else clauses after a break or return Signed-off-by: Antonio Murdaca --- drivers/staging/lustre/lustre/fid/fid_request.c| 5 ++- .../staging/lustre/lustre/include/lprocfs_status.h | 3 +- drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 36 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 11 --- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 3 +- drivers/staging/lustre/lustre/lov/lov_request.c| 3 +- drivers/staging/lustre/lustre/mdc/mdc_request.c| 8 ++--- drivers/staging/lustre/lustre/obdclass/cl_object.c | 6 ++-- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 6 ++-- drivers/staging/lustre/lustre/osc/osc_lock.c | 3 +- drivers/staging/lustre/lustre/osc/osc_request.c| 14 + drivers/staging/lustre/lustre/ptlrpc/pinger.c | 8 ++--- 13 files changed, 50 insertions(+), 59 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 7aee393..d124727 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -201,10 +201,9 @@ static int seq_client_alloc_seq(const struct lu_env *env, CERROR("%s: Can't allocate new meta-sequence, rc %d\n", seq->lcs_name, rc); return rc; - } else { - CDEBUG(D_INFO, "%s: New range - "DRANGE"\n", - seq->lcs_name, PRANGE(&seq->lcs_space)); } + CDEBUG(D_INFO, "%s: New range - "DRANGE"\n", + seq->lcs_name, PRANGE(&seq->lcs_space)); } else { rc = 0; } diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index d030847..e423ade 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -422,9 +422,8 @@ static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc, else spin_lock(&stats->ls_lock); return 1; - } else { - return stats->ls_biggest_alloc_num; } + return stats->ls_biggest_alloc_num; } } diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c index 19448fe..47aa8c4 100644 --- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c @@ -836,25 +836,25 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj, *exceed = 1; } return result; - } else { - /* -* region is within kms and, hence, within real file -* size (A). We need to increase i_size to cover the -* read region so that generic_file_read() will do its -* job, but that doesn't mean the kms size is -* _correct_, it is only the _minimum_ size. If -* someone does a stat they will get the correct size -* which will always be >= the kms value here. -* b=11081 -*/ - if (cl_isize_read(inode) < kms) { - cl_isize_write_nolock(inode, kms); - CDEBUG(D_VFSTRACE, - DFID" updating i_size %llu\n", - PFID(lu_object_fid(&obj->co_lu)), - (__u64)cl_isize_read(inode)); + } + + /* +* region is within kms and, hence, within real file +* size (A). We need to increase i_size to cover the +* read region so that generic_file_read() will do its +* job, but that doesn't mean the kms size is +* _correct_, it is only the _minimum_ size. If +* someone does a stat they will get the correct size +* which will always be >= the kms value here. +* b=11081 +*/ + if (cl_isize_read(inode) < kms) { + cl_isize_write_nolock(inode, kms); + CDEBUG(D_VFSTRACE, + DFID" updating i_size %llu\n", + PFID(lu_object_fid(&obj->co_lu)), + (__u64)cl_isize_read(inode)); - } } } ccc_object_size_unlock(
[Patchv2] staging: fbtft: replace fbtft_dev_dbg with standard dev_dbg call
From: Madhusudhanan Ravindran This patch attempts to simplify the debugging using standard dev_dbg call so that individual debug prints can be enabled or disbled by dynamic debugging rather than using module params. Signed-off-by: Madhusudhanan Ravindran --- v2: added From: line in the changelog. --- drivers/staging/fbtft/fb_agm1264k-fl.c |6 +++--- drivers/staging/fbtft/fbtft-core.c | 15 +++ drivers/staging/fbtft/fbtft.h |5 - 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 8f5af1d..94dd49c 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -94,7 +94,7 @@ static void reset(struct fbtft_par *par) if (par->gpio.reset == -1) return; - fbtft_dev_dbg(DEBUG_RESET, par, par->info->device, "%s()\n", __func__); + dev_dbg(par->info->device, "%s()\n", __func__); gpio_set_value(par->gpio.reset, 0); udelay(20); @@ -107,7 +107,7 @@ static int verify_gpios(struct fbtft_par *par) { int i; - fbtft_dev_dbg(DEBUG_VERIFY_GPIOS, par, par->info->device, + dev_dbg(par->info->device, "%s()\n", __func__); if (par->EPIN < 0) { @@ -145,7 +145,7 @@ static int verify_gpios(struct fbtft_par *par) static unsigned long request_gpios_match(struct fbtft_par *par, const struct fbtft_gpio *gpio) { - fbtft_dev_dbg(DEBUG_REQUEST_GPIOS_MATCH, par, par->info->device, + dev_dbg(par->info->device, "%s('%s')\n", __func__, gpio->name); if (strcasecmp(gpio->name, "wr") == 0) { diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index ce64521..d01856f 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -486,7 +486,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagelist) index = page->index << PAGE_SHIFT; y_low = index / info->fix.line_length; y_high = (index + PAGE_SIZE - 1) / info->fix.line_length; - fbtft_dev_dbg(DEBUG_DEFERRED_IO, par, info->device, + dev_dbg(info->device, "page->index=%lu y_low=%d y_high=%d\n", page->index, y_low, y_high); if (y_high > info->var.yres - 1) @@ -507,7 +507,7 @@ static void fbtft_fb_fillrect(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_FILLRECT, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, rect->dx, rect->dy, rect->width, rect->height); sys_fillrect(info, rect); @@ -520,7 +520,7 @@ static void fbtft_fb_copyarea(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_COPYAREA, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, area->dx, area->dy, area->width, area->height); sys_copyarea(info, area); @@ -533,7 +533,7 @@ static void fbtft_fb_imageblit(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_IMAGEBLIT, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, image->dx, image->dy, image->width, image->height); sys_imageblit(info, image); @@ -547,7 +547,7 @@ static ssize_t fbtft_fb_write(struct fb_info *info, const char __user *buf, struct fbtft_par *par = info->par; ssize_t res; - fbtft_dev_dbg(DEBUG_FB_WRITE, par, info->dev, + dev_dbg(info->dev, "%s: count=%zd, ppos=%llu\n", __func__, count, *ppos); res = fb_sys_write(info, buf, count, ppos); @@ -570,11 +570,10 @@ static int fbtft_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info) { - struct fbtft_par *par = info->par; unsigned val; int ret = 1; - fbtft_dev_dbg(DEBUG_FB_SETCOLREG, par, info->dev, + dev_dbg(info->dev, "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n", __func__, regno, red, green, blue, transp); @@ -601,7 +600,7 @@ static int fbtft_fb_blank(int blank, struct fb_info *info) struct fbtft_par *par = info->par; int ret = -EINVAL; - fbtft_dev_dbg(DEBUG_FB_BLANK, par, info->dev, "%s(blank=%d)\n", + dev_dbg(info->dev, "%s(blank=%d)\n", __func__, blank); if (!par->fbtftops.blank) diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 9fd98cb..7d817eb 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -430,11
[Patchv2] staging: emxx_udc: remove commented code
From: Madhusudhanan Ravindran removed the commented INFO lines. Signed-off-by: Madhusudhanan Ravindran --- v2: added From: line in the changelog. --- drivers/staging/emxx_udc/emxx_udc.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 163ca56..4178d96 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2249,8 +2249,6 @@ static int _nbu2ss_pullup(struct nbu2ss_udc *udc, int is_on) if (is_on) { /* D+ Pullup */ -/* INFO(" --- D+ Pullup\n"); */ - if (udc->driver) { reg_dt = (_nbu2ss_readl(&udc->p_regs->USB_CONTROL) | PUE2) & ~(u32)CONNECTB; @@ -2260,8 +2258,6 @@ static int _nbu2ss_pullup(struct nbu2ss_udc *udc, int is_on) } else { /* D+ Pulldown */ -/* INFO(" --- D+ Pulldown\n"); */ - reg_dt = (_nbu2ss_readl(&udc->p_regs->USB_CONTROL) | CONNECTB) & ~(u32)PUE2; @@ -2731,8 +2727,6 @@ static int nbu2ss_ep_queue( ep = container_of(_ep, struct nbu2ss_ep, ep); udc = ep->udc; -/* INFO("=== %s(ep%d), zero=%d\n", __func__, ep->epnum, _req->zero); */ - if (udc->vbus_active == 0) { dev_info(udc->dev, "Can't ep_queue (VBUS OFF)\n"); return -ESHUTDOWN; @@ -2808,8 +2802,6 @@ static int nbu2ss_ep_dequeue( struct nbu2ss_udc *udc; unsigned long flags; - /*INFO("=== %s()\n", __func__);*/ - /* catch various bogus parameters */ if ((_ep == NULL) || (_req == NULL)) { /* pr_err("%s, bad param(1)\n", __func__); */ @@ -2855,8 +2847,6 @@ static int nbu2ss_ep_set_halt(struct usb_ep *_ep, int value) struct nbu2ss_ep*ep; struct nbu2ss_udc *udc; -/* INFO("=== %s()\n", __func__); */ - if (!_ep) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -2909,8 +2899,6 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep) unsigned long flags; struct fc_regs *preg; -/* INFO("=== %s()\n", __func__); */ - if (!_ep) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -2957,8 +2945,6 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep) struct nbu2ss_udc *udc; unsigned long flags; -/* INFO("=== %s()\n", __func__); */ - if (!_ep) { pr_err("udc: %s, bad param\n", __func__); return; @@ -3013,8 +2999,6 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget) u32 data; struct nbu2ss_udc *udc; -/* INFO("=== %s()\n", __func__); */ - if (pgadget == NULL) { pr_err("udc: %s, bad param\n", __func__); return -EINVAL; @@ -3043,8 +3027,6 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget) struct nbu2ss_udc *udc; -/* INFO("=== %s()\n", __func__); */ - if (pgadget == NULL) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -3083,8 +3065,6 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget, struct nbu2ss_udc *udc; unsigned long flags; -/* INFO("=== %s()\n", __func__); */ - if (pgadget == NULL) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -3102,7 +3082,6 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget, /*-*/ static int nbu2ss_gad_vbus_session(struct usb_gadget *pgadget, int is_active) { -/* INFO("=== %s()\n", __func__); */ return 0; } @@ -3112,8 +3091,6 @@ static int nbu2ss_gad_vbus_draw(struct usb_gadget *pgadget, unsigned mA) struct nbu2ss_udc *udc; unsigned long flags; -/* INFO("=== %s()\n", __func__); */ - if (pgadget == NULL) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -3134,8 +3111,6 @@ static int nbu2ss_gad_pullup(struct usb_gadget *pgadget, int is_on) struct nbu2ss_udc *udc; unsigned long flags; -/* INFO("=== %s()\n", __func__); */ - if (pgadget == NULL) { pr_err("%s, bad param\n", __func__); return -EINVAL; @@ -3164,7 +3139,6 @@ static int nbu2ss_gad_ioctl( unsigned code, unsigned long param) { -/* INFO("=== %s()\n", __func__); */ return 0; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: rtl8192u: Patch to modify if, else conditions
From: Chaitanya Dhere In this patch, the if, else conditions are modified to remove the unnecessary equality checks. This change was detected with help of coccinelle tool. Signed-off-by: Chaitanya Dhere --- .../staging/rtl8192u/ieee80211/ieee80211_softmac.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index d2e8b12..1742e58 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1364,12 +1364,10 @@ static void ieee80211_associate_complete_wq(struct work_struct *work) ieee->LinkDetectInfo.NumRecvDataInPeriod= 1; } ieee->link_change(ieee->dev); - if(ieee->is_silent_reset == 0){ + if (!ieee->is_silent_reset) { printk(">normal associate\n"); notify_wx_assoc_event(ieee); - } - else if(ieee->is_silent_reset == 1) - { + } else { printk("==>silent reset associate\n"); ieee->is_silent_reset = false; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8192u: Fix indentation issue
From: Chaitanya Dhere This change was detected with help of coccinelle tool. Signed-off-by: Chaitanya Dhere --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 1742e58..e08ef10 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1366,7 +1366,7 @@ static void ieee80211_associate_complete_wq(struct work_struct *work) ieee->link_change(ieee->dev); if (!ieee->is_silent_reset) { printk(">normal associate\n"); - notify_wx_assoc_event(ieee); + notify_wx_assoc_event(ieee); } else { printk("==>silent reset associate\n"); ieee->is_silent_reset = false; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: use table to get channel plan from country code
From: Hari Prasath Gujulan Elango Use a table to get a channel plan from a given country code.This was a TODO mentioned as a comment in the driver. Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 19 --- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 8 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 969150a..8c05cb0 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -642,21 +642,18 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) */ int rtw_set_country(struct adapter *adapter, const char *country_code) { + int i; int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G; DBG_88E("%s country_code:%s\n", __func__, country_code); + for (i = 0; i < ARRAY_SIZE(channel_table); i++) { + if (0 == strcmp(channel_table[i].name, country_code)) { + channel_plan = channel_table[i].channel_plan; + break; + } + } - /* TODO: should have a table to match country code and RT_CHANNEL_DOMAIN */ - /* TODO: should consider 2-character and 3-character country code */ - if (0 == strcmp(country_code, "US")) - channel_plan = RT_CHANNEL_DOMAIN_FCC; - else if (0 == strcmp(country_code, "EU")) - channel_plan = RT_CHANNEL_DOMAIN_ETSI; - else if (0 == strcmp(country_code, "JP")) - channel_plan = RT_CHANNEL_DOMAIN_MKK; - else if (0 == strcmp(country_code, "CN")) - channel_plan = RT_CHANNEL_DOMAIN_CHINA; - else + if (i == ARRAY_SIZE(channel_table)) DBG_88E("%s unknown country_code:%s\n", __func__, country_code); return rtw_set_chplan_cmd(adapter, channel_plan, 1); diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 2bebf46..2bd11ac 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -191,6 +191,14 @@ struct rt_channel_plan_map { unsigned char Index2G; }; +static const struct { + int channel_plan; + char *name; +} channel_table[] = { { RT_CHANNEL_DOMAIN_FCC, "US" }, + { RT_CHANNEL_DOMAIN_ETSI, "EU" }, + { RT_CHANNEL_DOMAIN_MKK, "JP" }, + { RT_CHANNEL_DOMAIN_CHINA, "CN"} }; + enum Associated_AP { atherosAP = 0, broadcomAP = 1, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] staging: rtl8192u: Fix indentation issue
On Mon, Jun 01, 2015 at 12:39:31PM +, Dhere, Chaitanya (C.) wrote: > From: Chaitanya Dhere > > This change was detected with help of coccinelle tool. Hi, can you please let me know how to use coccinelle to detect indention issues. I never knew coccinelle can be used to check these also. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] Fix coding style issues and removed useless code
Fixed coding style issues detected by checkpatch.pl in r819xU_firmware.h and removed commented macro that was no longer needed. Changes since v1: Removed commented macro instead of fixing C99 comment style suggested by Buţiu Alexandru Octavian (2): staging: drivers: rtl8192u: r819xU_firmware.h: removed commented macro staging: rtl8192u: r819xU_firmware.h: fix line over 80 characters drivers/staging/rtl8192u/r819xU_firmware.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: drivers: rtl8192u: r819xU_firmware.h: removed commented macro
Removed commented macro that was no longer needed Signed-off-by: Buţiu Alexandru Octavian --- drivers/staging/rtl8192u/r819xU_firmware.h | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index cfa2223..d6a0224 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -2,15 +2,7 @@ #define __INC_FIRMWARE_H #define RTL8190_CPU_START_OFFSET 0x80 -/* TODO: this definition is TBD */ -//#define USB_HWDESC_HEADER_LEN0 - -/* It should be double word alignment */ -//#if DEV_BUS_TYPE==PCI_INTERFACE -//#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) 4*(v/4) - 8 -//#else #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) -//#endif typedef enum _firmware_init_step { FW_INIT_STEP0_BOOT = 0, -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8192u: r819xU_firmware.h: fix line over 80 characters
Fixed coding style issue line "over 80 characters" detected by checkpatch.pl in r819xU_firmware.h Signed-off-by: Buţiu Alexandru Octavian --- drivers/staging/rtl8192u/r819xU_firmware.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index d6a0224..24b63f2 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -2,7 +2,8 @@ #define __INC_FIRMWARE_H #define RTL8190_CPU_START_OFFSET 0x80 -#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) +#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ + (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) typedef enum _firmware_init_step { FW_INIT_STEP0_BOOT = 0, -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'
From: Hari Prasath Gujulan Elango This patch deletes all references to 'flipbuf'.Memory is allocated and freed but never used anywhere in the driver.Also deleted an ununsed Macro defined in the header file. Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/dgnc/dgnc_driver.c | 9 - drivers/staging/dgnc/dgnc_driver.h | 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 805dc61..7546aff 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -355,7 +355,6 @@ static void dgnc_cleanup_board(struct dgnc_board *brd) } } - kfree(brd->flipbuf); dgnc_Board[brd->boardnum] = NULL; @@ -581,14 +580,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) brd->msgbuf_head = NULL; spin_unlock_irqrestore(&dgnc_global_lock, flags); - /* -* allocate flip buffer for board. -* -* Okay to malloc with GFP_KERNEL, we are not at interrupt -* context, and there are no locks held. -*/ - brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL); - wake_up_interruptible(&brd->state_wait); return 0; diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index f77fed5..de9e71c 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -288,7 +288,6 @@ struct un_t { #define CH_TX_FIFO_LWM 0x0800 /* TX Fifo is below Low Water */ #define CH_BREAK_SENDING 0x1000/* Break is being sent */ #define CH_LOOPBACK 0x2000 /* Channel is in lookback mode */ -#define CH_FLIPBUF_IN_USE 0x4000 /* Channel's flipbuf is in use */ #define CH_BAUD0 0x08000 /* Used for checking B0 transitions */ #define CH_FORCED_STOP 0x2/* Output is forcibly stopped */ #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 2/2] staging: dgnc: remove ununsed Macro
From: Hari Prasath Gujulan Elango Remove the ununsed Macro Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/dgnc/dgnc_driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index de9e71c..0ec4073 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -66,7 +66,6 @@ /* 4 extra for alignment play space */ #define WRITEBUFLEN((4096) + 4) -#define MYFLIPLEN N_TTY_BUF_SIZE #define dgnc_jiffies_from_ms(a) (((a) * HZ) / 1000) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'
Really both patches should have been folded together. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'
On Mon, Jun 01, 2015 at 04:18:17PM +0300, Dan Carpenter wrote: > Really both patches should have been folded together. > > regards, > dan carpenter > Yes Dan they can very well be a single patch.I have already sent multiple versions of this patch and its confusing.I will leave it as it is for now.Greg had suggested me send it as patchset as he got confused with multiple versions of related patches and the ordering of applying them.Hence I send it like this. regards Hari ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'
On Mon, Jun 01, 2015 at 01:26:39PM +, Gujulan Elango, Hari Prasath (H.) wrote: > On Mon, Jun 01, 2015 at 04:18:17PM +0300, Dan Carpenter wrote: > > Really both patches should have been folded together. > > > > regards, > > dan carpenter > > > > Yes Dan they can very well be a single patch.I have already sent > multiple versions of this patch and its confusing.I will leave it as it > is for now.Greg had suggested me send it as patchset as he got confused > with multiple versions of related patches and the ordering of applying > them.Hence I send it like this. and somehow for these patches I am again getting that patch corrupt error. but for your other staging patches i have not got any such error. where it is going wrong? regards sudip > > regards > Hari ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Future of Ozwpan Driver - Maintainer? [Was: Re: [PATCH 0/4] ozwpan: Four remote packet-of-death vulnerabilities]
Hi all, With four security critical bug patches having finally been put in Greg's for-linus branch [1][2][3][4], I'd like to turn attention back at the bigger issue. Where is the maintainer of this driver during these discussions? The MAINTAINERS file lists Shigekatsu Tateno, and in a commit [5] from May of last year, Rupesh Gujare turned over maintenance to him. I ask because I also noted another important vulnerability in my original patch series cover letter, with the hope that the actual maintainer would take care of patching this, as it is likely a little bit nuanced: On Wed, May 13, 2015 at 8:33 PM, Jason A. Donenfeld wrote: > On a slightly related note, there are several other vulnerabilities in > this driver that are worth looking into. When ozwpan receives a packet, > it casts the packet into a variety of different structs, based on the > value of type and length parameters inside the packet. When making these > casts, and when reading bytes based on this length parameter, the actual > length of the packet in the socket buffer is never actually consulted. As > such, it's very likely that a packet could be sent that results in the > kernel reading memory in adjacent buffers, resulting in an information > leak, or from unpaged addresses, resulting in a crash. In the former case, > it may be possible with certain message types to actually send these > leaked adjacent bytes back to the sender of the packet. So, I'd highly > recommend the maintainers of this driver go branch-by-branch from the > initial rx function, adding checks to ensure all reads and casts are > within the bounds of the socket buffer. It seems a bit odd to not receive any review from the actual maintainer, and seeing that there is still a pending security issue that hasn't been addressed, I wonder if we should revisit what Dan suggested last week: On Thu, May 28, 2015 at 1:04 PM, Dan Carpenter wrote: > Maybe we should just delete these ozwpan drivers entirely... They were > merged when Ozmodevices was its own company and I don't think anyone is > working on them any more. I know for a fact that the drivers *are* in use places, though not necessarily with the upstream codebase. Also, it was more or less exactly a year ago when Atmel appointed the new maintainer, which makes me hope that somebody there still cares about them. But I'm not sure exactly. What's the best way to proceed? Is anybody in a position to reach out and nudge the maintainer? Or is it just the case that Atmel's vacation policy is awesome, and he's just been hanging out on the beach, and I'm jumping the gun with this email? Thanks, Jason [1] https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?id=d114b9fe78c8d6fc6e70808c2092aa307c36dc8e [2] https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?id=b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c [3] https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?id=04bf464a5dfd9ade0dda918e44366c2c61fce80b [4] https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?id=9a59029bc218b48eff8b5d4dde5662fd79d3e1a8 [5] https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/ozwpan?h=staging-linus&id=96747a8f4e7d187f236ad392d86a37a4d1ba0b32 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wlan-ng: fix long line
Style (line over 80 chars) in drivers/staging/wlan-ng/prism2fw.c Signed-off-by: Douglas Barbonaglia Sathler Figueiredo --- drivers/staging/wlan-ng/prism2fw.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 9408644..fe36613 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -708,7 +708,10 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks, continue; } - /* Validate plug address against chunk data and identify chunk */ + /* +* Validate plug address against +* chunk data and identify chunk +*/ for (c = 0; c < nfchunks; c++) { cstart = fchunk[c].addr; cend = fchunk[c].addr + fchunk[c].len; @@ -923,7 +926,8 @@ static int read_fwfile(const struct ihex_binrec *record) rcnt, s3info[ns3info].len, s3info[ns3info].type); - if (((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info)) { + if (((s3info[ns3info].len - 1) * sizeof(u16)) > + sizeof(s3info[ns3info].info)) { pr_err("S3 inforec length too long - aborting\n"); return 1; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.
On Mon, 2015-06-01 at 13:04 +0900, Greg KH wrote: > On Sun, May 31, 2015 at 09:43:57PM -0500, Petros Koutoupis wrote: > 1969-12-31 18:00:00.0 -0600 > > +++ linux-next/drivers/staging/rapiddisk/TODO 2015-05-31 > > 21:35:26.683515775 -0500 > > @@ -0,0 +1,5 @@ > > +TODO: > > +- checkpatch.pl cleanups (warnings) > > That's all that you need to do? Why not just do it today, and get it > merged to the "real" part of the kernel? Why put it into staging at > all? > I know this is no a good reason but I was being cautious with introducing a larger patch into the kernel. Although, seeing how both you and Dan Carpenter feel that it should not be in staging but instead in the "real" part of the kernel, I will make the modifications according to Dan's suggestions and resubmit. > That's really not a good reason for it to go into staging, have you > submitted it to the "real" part of the kernel already and did they tell > you to go here instead? Why did you pick staging for this code? > No, I did not. Again, just my being cautious. > thanks, > > greg k-h As always, thank you for your insight and guidance. Regards, Petros ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.
Dan, You have indeed given me a good amount of homework. Anyway, I will address everything according to your comments and suggestions and resubmit to the "real" part of the kernel and not staging. Thank you very much. Regards, Petros On Mon, 2015-06-01 at 12:18 +0300, Dan Carpenter wrote: > On Sun, May 31, 2015 at 02:43:16PM -0500, Petros Koutoupis wrote: > > Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a > > Linux > > RAM drive module which allows the user to dynamically create, remove, and > > resize > > RAM-based block devices. RapidDisk is designed to work with both volatile > > and > > non-volatile memory. In the case of volatile memory, memory is allocated > > only when > > needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO > > Write-Through caching node to a slower block device. > > > > Signed-off-by: Petros Koutoupis > > This feels like it could be merged without going through staging. It > looks like ok code to me. > > > > > --- > > Kconfig |2 > > Makefile |1 > > rapiddisk/Documentation/rxdsk.txt | 74 ++ > > rapiddisk/Kconfig | 10 > > rapiddisk/Makefile|2 > > rapiddisk/rxcache.c | 1181 > > ++ > > rapiddisk/rxcommon.h | 22 > > rapiddisk/rxdsk.c | 799 + > > 8 files changed, 2091 insertions(+) > > > > diff -uNpr linux-next.orig/drivers/staging/Kconfig > > linux-next/drivers/staging/Kconfig > > --- linux-next.orig/drivers/staging/Kconfig 2015-05-30 > > 13:37:03.929726967 -0500 > > +++ linux-next/drivers/staging/Kconfig 2015-05-31 13:36:08.673757913 -0500 > > @@ -112,4 +112,6 @@ source "drivers/staging/fsl-mc/Kconfig" > > > > source "drivers/staging/wilc1000/Kconfig" > > > > +source "drivers/staging/rapiddisk/Kconfig" > > + > > endif # STAGING > > diff -uNpr linux-next.orig/drivers/staging/Makefile > > linux-next/drivers/staging/Makefile > > --- linux-next.orig/drivers/staging/Makefile2015-05-30 > > 13:37:03.921726968 -0500 > > +++ linux-next/drivers/staging/Makefile 2015-05-31 13:36:08.753757911 -0500 > > @@ -48,3 +48,4 @@ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += > > obj-$(CONFIG_FB_TFT) += fbtft/ > > obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ > > obj-$(CONFIG_WILC1000) += wilc1000/ > > +obj-$(CONFIG_RXDSK)+= rapiddisk/ > > diff -uNpr > > linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt > > linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt > > --- linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt > > 1969-12-31 18:00:00.0 -0600 > > +++ linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt > > 2015-05-31 13:38:29.893753897 -0500 > > @@ -0,0 +1,74 @@ > > +RapidDisk (rxdsk) RAM disk and RapidCache (rxcache) Linux modules > > + > > +== Description == > > + > > +RapidDisk or rxdsk was designed to be used in high performing environments > > +and has been designed with simplicity in mind. Utilizing a user land > > binary, > > +the system administrator is capable of dynamically adding new RAM based > > +block devices of varying sizes, removing existing ones to even listing all > > +existing RAM block devices. The rxdsk module has been designed to allocate > > +from the system's memory pages and is capable of addressing memory to > > +support Gigabytes if not a Terabyte of available Random Access Memory. > > + > > +RapidCache or rxcache is designed to leverage the high speed performing > > +technologies of the RapidDisk RAM disk and utilizing the Device Mapper > > +framework, map an rxdsk volume to act as a block device's > > Write/Read-through > > +cache. This can significantly boost the performance of a local or remote > > +disk device. > > + > > + > > +== Module Parameters == > > + > > +RapidDisk > > +- > > +max_rxcnt: Total RAM Disk devices available for use. (Default = 128 = MAX) > > (int) > > +max_sectors: Maximum sectors (in KB) for the request queue. (Default = > > 127) (int) > > +nr_requests: Number of requests at a given time for the request queue. > > (Default = 128) (int) > > + > > +RapidCache > > +- > > +None. > > + > > + > > +== Usage == > > + > > +RapidDisk > > +- > > +It is advised to utilize the userland utility, rxadm, but this is > > essentially what is > > +written to the /proc/rxctl proc file to manage rxdsk volumes: > > + > > +Attach a new rxdsk volume by typing (size in sectors): > > +# echo "rxdsk attach 0 8192" > /proc/rxctl > > + > > +Attach a non-volatile rxdsk volume by typing (starting / ending addresses > > +in decimal format): > > +# echo "rxdsk attach-nv 0 1234 56789" > /proc/rxctl > > + > > +Detach an existing rxdsk volume by typing: > > +# echo "rxdsk detach 0" > /proc/rxctl > > + > > +Resize an existing rxdsk volume by typing (
Re: [PATCH 12/13] staging: unisys: Remove unneeded fields in diagchannel.h
On Sun, May 31, 2015 at 10:16:37AM +0900, Greg KH wrote: > On Tue, May 26, 2015 at 02:40:57PM -0400, Don Zickus wrote: > > From: David Kershner > > > > Diagchannel.h is used primarily for the diagnostics channel. The > > diagnostics channel is not being used by linux guests currently, so > > the majority of the file is not needed. What is left is what is > > needed to perform postcode vmcalls. Those postcodes will eventually > > end up in the diag channel. > > > > Signed-off-by: David Kershner > > Signed-off-by: Benjamin Romer > > > > Conflicts: > > drivers/staging/unisys/visorbus/visorbus_main.c > > drivers/staging/unisys/visorbus/visorchipset.c > > What are these lines here for? Probably popped up when I refreshed the patches. Sorry about that. Cheers, Don ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/13 V3] Continued rest of unisys driver update
On Sun, May 31, 2015 at 10:17:30AM +0900, Greg KH wrote: > On Tue, May 26, 2015 at 02:40:45PM -0400, Don Zickus wrote: > > Hi, > > > > GregKH ran into an issue where the last 13 patches didn't apply. > > > > It looks like Ben cleaned up the patches to address checkpatch.pl > > warnings and forgot to refresh the patchset. > > > > I just refreshed the patchset and everything should apply on top > > of staging-testing (commit a30baec189f7db458). > > A bunch of these don't have a signed-off-by from the driver maintainers. > So I'll wait for them to review them before applying it. It would be > best if someone just resent the patches to me when that happens. Sorry about that. I will work with Ben to do that. Cheers, Don ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: xgifb: remove braces around else clause
From: Hari Prasath Gujulan Elango Remove braces around else clause with single line Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/xgifb/vb_init.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 2b233af..8deab76 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -484,9 +484,9 @@ static void XGINew_SetDRAMDefaultRegister340( if (HwDeviceExtension->jChipType == XG27) xgifb_reg_set(P3c4, 0x17, 0x02); /* SR17 DDRII */ - } else { + } else xgifb_reg_set(P3c4, 0x17, 0x00); /* SR17 DDR */ - } + xgifb_reg_set(P3c4, 0x1A, 0x87); /* SR1A */ temp = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); @@ -972,9 +972,8 @@ static void XGINew_ChkSenseStatus(struct vb_device_info *pVBInfo) CR3CData = xgifb_reg_get(pVBInfo->P3d4, 0x3c); if (!(CR3CData & DisplayDeviceFromCMOS)) tempcx = 0x1FF0; - } else { + } else tempcx = 0x1FF0; - } tempbx &= tempcx; xgifb_reg_set(pVBInfo->P3d4, 0x3d, (tempbx & 0x00FF)); @@ -1129,10 +1128,9 @@ static void XGINew_GetXG27Sense(struct vb_device_info *pVBInfo) /* LVDS setting */ xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x21); - } else { + } else /* TMDS/DVO setting */ xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); - } xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: xgifb: remove braces around else clause
On 06/01, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango > > Remove braces around else clause with single line > > Signed-off-by: Hari Prasath Gujulan Elango > --- > drivers/staging/xgifb/vb_init.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c > index 2b233af..8deab76 100644 > --- a/drivers/staging/xgifb/vb_init.c > +++ b/drivers/staging/xgifb/vb_init.c > @@ -484,9 +484,9 @@ static void XGINew_SetDRAMDefaultRegister340( > if (HwDeviceExtension->jChipType == XG27) > xgifb_reg_set(P3c4, 0x17, 0x02); /* SR17 DDRII */ > > - } else { > + } else > xgifb_reg_set(P3c4, 0x17, 0x00); /* SR17 DDR */ > - } If any of the branches in the conditional statement is long enough to use braces you cannot do this. The 'else' should have braces around it. See in https://www.kernel.org/doc/Documentation/CodingStyle, Chapter 3. - konrad > + > xgifb_reg_set(P3c4, 0x1A, 0x87); /* SR1A */ > > temp = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); > @@ -972,9 +972,8 @@ static void XGINew_ChkSenseStatus(struct vb_device_info > *pVBInfo) > CR3CData = xgifb_reg_get(pVBInfo->P3d4, 0x3c); > if (!(CR3CData & DisplayDeviceFromCMOS)) > tempcx = 0x1FF0; > - } else { > + } else > tempcx = 0x1FF0; > - } > > tempbx &= tempcx; > xgifb_reg_set(pVBInfo->P3d4, 0x3d, (tempbx & 0x00FF)); > @@ -1129,10 +1128,9 @@ static void XGINew_GetXG27Sense(struct vb_device_info > *pVBInfo) > /* LVDS setting */ > xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); > xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x21); > - } else { > + } else > /* TMDS/DVO setting */ > xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); > - } > xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense); > > } > -- > 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
[PATCH v4 00/16] Continued rest of unisys driver update
This patch set contains the remaining changes from our driver cleanup efforts, that did not apply to staging-next. No functional changes have been made, these have simply been rebased so they will apply cleanly, and have proper sign-offs. David Kershner (4): staging: unisys: Update diag serverity enum staging: unisys: Remove unneeded fields in diagchannel.h staging: unisys: Clean up diag_serverity enum staging: unisys: Add the bus device to the visor device list. Don Zickus (11): staging: unisys: Move channel creation up the stack staging: unisys: Convert pending_msg_hdr to a pointer staging: unisys: Prepare vbus_hdr_info to be public staging: unisys: Migrate bus from devdata to visor_device staging: unisys: Remove unused cruft staging: unisys: Remove server flags staging: unisys: Do not use 0 as the default bus root device number staging: unisys: Convert bus creation to use visor_device staging: unisys: Convert device creation to use visor_device staging: unisys: Fix double sysfs create for module version staging: unisys: Fix clean up path Jes Sorensen (1): staging: unisys: Removed unused entries from struct visor_channeltype_descriptor drivers/staging/unisys/include/diagchannel.h | 420 + drivers/staging/unisys/include/visorbus.h | 17 +- drivers/staging/unisys/visorbus/visorbus_main.c| 511 + drivers/staging/unisys/visorbus/visorbus_private.h | 107 + drivers/staging/unisys/visorbus/visorchipset.c | 507 5 files changed, 346 insertions(+), 1216 deletions(-) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 02/16] staging: unisys: Convert pending_msg_hdr to a pointer
From: Don Zickus In order for bus/dev_info structs to become public structs, one element, pending_msg_hdr, needs to become opaque. This is to keep all the internals of the controlvm struct private to the bus layer. So a simple conversion of embedding the pending_msg_hdr struct into a pointer is done. The rest of the patch is the fallout. The rules are modified slightly. Instead of relying on the 'id' to be CONTROLVM_INVALID to indicate invalid, just use the pointer set to NULL. In addition, because bus/dev_info can be NULL and we still need to send a response, pass pending_msg_hdr to all 'responders' instead of bus/ That change causes some fallout in the success case. Instead of setting state bits and clearing info in the responders, do all that magic in the responder wrappers. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_private.h | 4 +- drivers/staging/unisys/visorbus/visorchipset.c | 185 + 2 files changed, 118 insertions(+), 71 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 912b6cd..f371f9d 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -57,7 +57,7 @@ struct visorchipset_device_info { u64 reserved2; u32 switch_no; /* when devState.attached==1 */ u32 internal_port_no; /* when devState.attached==1 */ - struct controlvm_message_header pending_msg_hdr;/* CONTROLVM_MESSAGE */ + struct controlvm_message_header *pending_msg_hdr;/* CONTROLVM_MESSAGE */ /** For private use by the bus driver */ void *bus_driver_context; }; @@ -84,7 +84,7 @@ struct visorchipset_bus_info { /* Add new fields above. */ /* Remaining bits in this 32-bit word are unused. */ } flags; - struct controlvm_message_header pending_msg_hdr;/* CONTROLVM MsgHdr */ + struct controlvm_message_header *pending_msg_hdr;/* CONTROLVM MsgHdr */ /** For private use by the bus driver */ void *bus_driver_context; }; diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 3d08661..2478889 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -962,37 +962,17 @@ enum crash_obj_type { }; static void -bus_responder(enum controlvm_id cmd_id, struct visorchipset_bus_info *p, +bus_responder(enum controlvm_id cmd_id, + struct controlvm_message_header *pending_msg_hdr, int response) { - bool need_clear = false; - u32 bus_no = p->bus_no; + if (pending_msg_hdr == NULL) + return; /* no controlvm response needed */ - if (!p) + if (pending_msg_hdr->id != (u32)cmd_id) return; - if (response < 0) { - if ((cmd_id == CONTROLVM_BUS_CREATE) && - (response != (-CONTROLVM_RESP_ERROR_ALREADY_DONE))) - /* undo the row we just created... */ - busdevices_del(&dev_info_list, bus_no); - } else { - if (cmd_id == CONTROLVM_BUS_CREATE) - p->state.created = 1; - if (cmd_id == CONTROLVM_BUS_DESTROY) - need_clear = true; - } - - if (p->pending_msg_hdr.id == CONTROLVM_INVALID) - return; /* no controlvm response needed */ - if (p->pending_msg_hdr.id != (u32)cmd_id) - return; - controlvm_respond(&p->pending_msg_hdr, response); - p->pending_msg_hdr.id = CONTROLVM_INVALID; - if (need_clear) { - bus_info_clear(p); - busdevices_del(&dev_info_list, bus_no); - } + controlvm_respond(pending_msg_hdr, response); } static void @@ -1004,14 +984,12 @@ device_changestate_responder(enum controlvm_id cmd_id, u32 bus_no = p->bus_no; u32 dev_no = p->dev_no; - if (!p) - return; - if (p->pending_msg_hdr.id == CONTROLVM_INVALID) + if (p->pending_msg_hdr == NULL) return; /* no controlvm response needed */ - if (p->pending_msg_hdr.id != cmd_id) + if (p->pending_msg_hdr->id != cmd_id) return; - controlvm_init_response(&outmsg, &p->pending_msg_hdr, response); + controlvm_init_response(&outmsg, p->pending_msg_hdr, response); outmsg.cmd.device_change_state.bus_no = bus_no; outmsg.cmd.device_change_state.dev_no = dev_no; @@ -1020,35 +998,20 @@ device_changestate_responder(enum controlvm_id cmd_id, if (!visorchannel_signalinsert(controlvm_channel, CONTROLVM_QUEUE_REQUEST, &outmsg)) return; - - p->pending_msg_hdr.id = CONTROLVM_INVALID; }
[PATCH v4 06/16] staging: unisys: Remove server flags
From: Don Zickus The bus driver doesn't work in server mode, just remove the left over pieces. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c| 66 +++--- drivers/staging/unisys/visorbus/visorbus_private.h | 5 -- drivers/staging/unisys/visorbus/visorchipset.c | 2 - 3 files changed, 7 insertions(+), 66 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index ec20c46..7667b15 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1074,54 +1074,6 @@ find_visor_device_by_channel(struct visorchannel *channel) } static int -init_vbus_channel(struct visorchannel *chan) -{ - int rc = -1; - unsigned long allocated_bytes = visorchannel_get_nbytes(chan); - struct spar_vbus_channel_protocol *x = - kmalloc(sizeof(struct spar_vbus_channel_protocol), - GFP_KERNEL); - - POSTCODE_LINUX_3(VBUS_CHANNEL_ENTRY_PC, rc, POSTCODE_SEVERITY_INFO); - - if (x) { - POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR); - goto away; - } - if (visorchannel_clear(chan, 0, 0, allocated_bytes) < 0) { - POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC, -POSTCODE_SEVERITY_ERR); - goto away; - } - if (visorchannel_read - (chan, 0, x, sizeof(struct spar_vbus_channel_protocol)) < 0) { - POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC, -POSTCODE_SEVERITY_ERR); - goto away; - } - if (!SPAR_VBUS_CHANNEL_OK_SERVER(allocated_bytes)) { - POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC, -POSTCODE_SEVERITY_ERR); - goto away; - } - - if (visorchannel_write - (chan, 0, x, sizeof(struct spar_vbus_channel_protocol)) < 0) { - POSTCODE_LINUX_3(VBUS_CHANNEL_FAILURE_PC, chan, -POSTCODE_SEVERITY_ERR); - goto away; - } - - POSTCODE_LINUX_3(VBUS_CHANNEL_EXIT_PC, chan, POSTCODE_SEVERITY_INFO); - rc = 0; - -away: - kfree(x); - x = NULL; - return rc; -} - -static int get_vbus_header_info(struct visorchannel *chan, struct spar_vbus_headerinfo *hdr_info) { @@ -1296,18 +1248,14 @@ create_bus_instance(struct visorchipset_bus_info *bus_info) } dev->chipset_bus_no = id; dev->visorchannel = bus_info->visorchannel; - if (bus_info->flags.server) { - init_vbus_channel(dev->visorchannel); + if (get_vbus_header_info(dev->visorchannel, hdr_info) >= 0) { + dev->vbus_hdr_info = (void *)hdr_info; + write_vbus_chp_info(dev->visorchannel, hdr_info, + &chipset_driverinfo); + write_vbus_bus_info(dev->visorchannel, hdr_info, + &clientbus_driverinfo); } else { - if (get_vbus_header_info(dev->visorchannel, hdr_info) >= 0) { - dev->vbus_hdr_info = (void *)hdr_info; - write_vbus_chp_info(dev->visorchannel, hdr_info, - &chipset_driverinfo); - write_vbus_bus_info(dev->visorchannel, hdr_info, - &clientbus_driverinfo); - } else { - kfree(hdr_info); - } + kfree(hdr_info); } bus_count++; list_add_tail(&dev->list_all, &list_all_bus_instances); diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 57db062..af71809 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -66,11 +66,6 @@ struct visorchipset_bus_info { u8 *description;/* UTF8 */ u64 reserved1; u32 reserved2; - struct { - u32 server:1; - /* Add new fields above. */ - /* Remaining bits in this 32-bit word are unused. */ - } flags; struct controlvm_message_header *pending_msg_hdr;/* CONTROLVM MsgHdr */ /** For private use by the bus driver */ void *bus_driver_context; diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 2478889..4dd0a07 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1228,8 +1228,6 @@ bus_create(struct controlvm_message *inmsg) POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no, POSTCODE_SEVERITY_INFO); - bus_info->flags.server = inmsg->hdr.flags.server; -
[PATCH v4 08/16] staging: unisys: Convert bus creation to use visor_device
From: Don Zickus This patch removes the legacy bus_info struct and instead creates and passes around a traditional struct device. This allows us to remove a lot of the various look up code and removes the doubt if the struct exists or not. Half of the churn is just the conversion of visorchipset_bus_info to visor_device. Various cleanups include re-arranging the failure paths to make more sense. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/visorbus.h | 3 + drivers/staging/unisys/visorbus/visorbus_main.c| 131 - drivers/staging/unisys/visorbus/visorbus_private.h | 34 +- drivers/staging/unisys/visorbus/visorchipset.c | 95 --- 4 files changed, 77 insertions(+), 186 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index c60f7d4..e7f9984 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -220,4 +220,7 @@ void visorchannel_debug(struct visorchannel *channel, int num_queues, struct seq_file *seq, u32 off); void __iomem *visorchannel_get_header(struct visorchannel *channel); +#define BUS_ROOT_DEVICEUINT_MAX +struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, + struct visor_device *from); #endif diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index e5731b1..888e65d 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -93,8 +93,8 @@ static struct workqueue_struct *periodic_dev_workqueue; static long long bus_count;/** number of bus instances */ /** ever-increasing */ -static void chipset_bus_create(struct visorchipset_bus_info *bus_info); -static void chipset_bus_destroy(struct visorchipset_bus_info *bus_info); +static void chipset_bus_create(struct visor_device *bus_info); +static void chipset_bus_destroy(struct visor_device *bus_info); static void chipset_device_create(struct visorchipset_device_info *dev_info); static void chipset_device_destroy(struct visorchipset_device_info *dev_info); static void chipset_device_pause(struct visorchipset_device_info *dev_info); @@ -950,8 +950,7 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts); */ static int create_visor_device(struct visor_device *bdev, - struct visorchipset_device_info *dev_info, - u64 partition_handle) + struct visorchipset_device_info *dev_info) { int rc = -1; struct visor_device *dev = NULL; @@ -1161,8 +1160,7 @@ static void fix_vbus_dev_info(struct visor_device *visordev) { int i; - struct visorchipset_bus_info bus_info; - struct visor_device *dev = NULL; + struct visor_device *bdev; struct visor_driver *visordrv; int bus_no = visordev->chipset_bus_no; int dev_no = visordev->chipset_dev_no; @@ -1174,17 +1172,14 @@ fix_vbus_dev_info(struct visor_device *visordev) return; hdr_info = (struct spar_vbus_headerinfo *)visordev->vbus_hdr_info; + if (!hdr_info) + return; - visordrv = to_visor_driver(visordev->device.driver); - if (!visorchipset_get_bus_info(bus_no, &bus_info)) - return; - - dev = (struct visor_device *)(bus_info.bus_driver_context); - if (!dev) - return; + bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL); + if (!bdev) + return; - if (!hdr_info) - return; + visordrv = to_visor_driver(visordev->device.driver); /* Within the list of device types (by GUID) that the driver * says it supports, find out which one of those types matches @@ -1203,51 +1198,45 @@ fix_vbus_dev_info(struct visor_device *visordev) bus_device_info_init(&dev_info, chan_type_name, visordrv->name, visordrv->version, visordrv->vertag); - write_vbus_dev_info(dev->visorchannel, hdr_info, &dev_info, dev_no); + write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our evil counterpart, virtpci. */ - write_vbus_chp_info(dev->visorchannel, hdr_info, &chipset_driverinfo); - write_vbus_bus_info(dev->visorchannel, hdr_info, &clientbus_driverinfo); + write_vbus_chp_info(bdev->visorchannel, hdr_info, &chipset_driverinfo); + write_vbus_bus_info(bdev->visorchannel, hdr_info, + &clientbus_driverinfo); } /** Create a device instance for the visor bus itself. */ -static str
[PATCH v4 15/16] staging: unisys: Fix clean up path
From: Don Zickus When unloading a module, we need to cleanup the platform registration. However, unregistering the platform uncovered a couple of quirks, namely a missing device_release function. Fix things up so module unload works and allows us to reload the module. Signed-off-by: Don Zickus Signed-off-by: David Kershner Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- drivers/staging/unisys/visorbus/visorchipset.c | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index ff5561c..08bffa7 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -320,7 +320,7 @@ devmajorminor_remove_file(struct visor_device *dev, int slot) if (slot < 0 || slot >= maxdevnodes) return; myattr = (struct devmajorminor_attribute *)(dev->devnodes[slot].attr); - if (myattr) + if (!myattr) return; sysfs_remove_file(&dev->kobjdevmajorminor, &myattr->attr); kobject_uevent(&dev->device.kobj, KOBJ_OFFLINE); diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 90a3c30..99fa96e 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -331,11 +331,16 @@ static const struct attribute_group *visorchipset_dev_groups[] = { NULL }; +static void visorchipset_dev_release(struct device *dev) +{ +} + /* /sys/devices/platform/visorchipset */ static struct platform_device visorchipset_platform_device = { .name = "visorchipset", .id = -1, .dev.groups = visorchipset_dev_groups, + .dev.release = visorchipset_dev_release, }; /* Function prototypes */ @@ -2355,6 +2360,7 @@ visorchipset_exit(struct acpi_device *acpi_device) visorchannel_destroy(controlvm_channel); visorchipset_file_cleanup(visorchipset_platform_device.dev.devt); + platform_device_unregister(&visorchipset_platform_device); POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO); return 0; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 10/16] staging: unisys: Removed unused entries from struct visor_channeltype_descriptor
From: Jes Sorensen min_size/max_size aren't used anywhere, and they were just causing headaches in the drivers being ported over to the new interfaces. Signed-off-by: Jes Sorensen Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/visorbus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 581d962..e4a21e4 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -59,8 +59,6 @@ struct visorchipset_state { struct visor_channeltype_descriptor { const uuid_le guid; const char *name; - unsigned long min_size; - unsigned long max_size; }; /** Information provided by each visor driver when it registers with the -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: unisys: use schedule_timeout_interruptible()
As the actually intended timeout is not documented and msecs_to_jiffies timeouts can be a factor 10 different from the current effective timeout this needs to be checked by someone who knows the details of this driver in any case it should be passed in a HZ independent manner. I need an ack from the maintainers before I can take this. thanks, greg k-h This looks okay to me and applies cleanly to the end of our v4 series, so could you please apply it after the end of the v4 patch series I just sent? :) Thanks!! -- Ben Signed-off-by: Benjamin Romer ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 01/16] staging: unisys: Move channel creation up the stack
From: Don Zickus Instead of creating a channel struct to temporarily hold the channel info and passing it through multiple functions until the device is created, just create the channel from the start. This allows us to remove the channel_info struct. I noticed 'chan_info.addr_type' was not being used, so I just deleted it. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c| 88 +++--- drivers/staging/unisys/visorbus/visorbus_private.h | 16 +--- drivers/staging/unisys/visorbus/visorchipset.c | 54 - 3 files changed, 63 insertions(+), 95 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index a898896..49a34bb 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1010,11 +1010,9 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts); static int create_visor_device(struct visorbus_devdata *devdata, struct visorchipset_device_info *dev_info, - struct visorchipset_channel_info chan_info, u64 partition_handle) { int rc = -1; - struct visorchannel *visorchannel = NULL; struct visor_device *dev = NULL; bool gotten = false, registered1 = false, registered2 = false; u32 chipset_bus_no = dev_info->bus_no; @@ -1022,16 +1020,6 @@ create_visor_device(struct visorbus_devdata *devdata, POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, chipset_dev_no, chipset_bus_no, POSTCODE_SEVERITY_INFO); - /* prepare chan_hdr (abstraction to read/write channel memory) */ - visorchannel = visorchannel_create(chan_info.channel_addr, - chan_info.n_channel_bytes, - GFP_KERNEL, - chan_info.channel_type_uuid); - if (!visorchannel) { - POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, chipset_dev_no, -DIAG_SEVERITY_ERR); - goto away; - } dev = kmalloc(sizeof(*dev), GFP_KERNEL); if (!dev) { POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, chipset_dev_no, @@ -1040,9 +1028,8 @@ create_visor_device(struct visorbus_devdata *devdata, } memset(dev, 0, sizeof(struct visor_device)); - dev->visorchannel = visorchannel; - dev->channel_type_guid = chan_info.channel_type_uuid; - dev->channel_bytes = chan_info.n_channel_bytes; + dev->visorchannel = dev_info->visorchannel; + dev->channel_type_guid = dev_info->channel_type_guid; dev->chipset_bus_no = chipset_bus_no; dev->chipset_dev_no = chipset_dev_no; dev->device.parent = &devdata->dev; @@ -1114,8 +1101,6 @@ away: unregister_devmajorminor_attributes(dev); if (gotten) put_device(&dev->device); - if (visorchannel) - visorchannel_destroy(visorchannel); kfree(dev); } else { total_devices_created++; @@ -1134,7 +1119,7 @@ remove_visor_device(struct visor_device *dev) } static struct visor_device * -find_visor_device_by_channel(u64 channel_physaddr) +find_visor_device_by_channel(struct visorchannel *channel) { struct list_head *listentry, *listtmp; @@ -1142,8 +1127,7 @@ find_visor_device_by_channel(u64 channel_physaddr) struct visor_device *dev = list_entry(listentry, struct visor_device, list_all); - if (visorchannel_get_physaddr(dev->visorchannel) == - channel_physaddr) + if (dev->visorchannel == channel) return dev; } return NULL; @@ -1363,41 +1347,23 @@ create_bus_instance(struct visorchipset_bus_info *bus_info) goto away; } devdata->devno = id; - if ((bus_info->chan_info.channel_addr > 0) && - (bus_info->chan_info.n_channel_bytes > 0)) { - u64 channel_addr = bus_info->chan_info.channel_addr; - unsigned long n_channel_bytes = - (unsigned long) - bus_info->chan_info.n_channel_bytes; - uuid_le channel_type_guid = - bus_info->chan_info.channel_type_uuid; - - devdata->chan = visorchannel_create(channel_addr, - n_channel_bytes, - GFP_KERNEL, - channel_type_guid); - if (!devdata->chan) { - POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE
[PATCH v4 12/16] staging: unisys: Remove unneeded fields in diagchannel.h
From: David Kershner Diagchannel.h is used primarily for the diagnostics channel. The diagnostics channel is not being used by linux guests currently, so the majority of the file is not needed. What is left is what is needed to perform postcode vmcalls. Those postcodes will eventually end up in the diag channel. Signed-off-by: David Kershner Signed-off-by: Benjamin Romer Conflicts: drivers/staging/unisys/visorbus/visorbus_main.c drivers/staging/unisys/visorbus/visorchipset.c Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/diagchannel.h | 366 + drivers/staging/unisys/visorbus/visorchipset.c | 45 --- 2 files changed, 2 insertions(+), 409 deletions(-) diff --git a/drivers/staging/unisys/include/diagchannel.h b/drivers/staging/unisys/include/diagchannel.h index c1e74e8..82932c5 100644 --- a/drivers/staging/unisys/include/diagchannel.h +++ b/drivers/staging/unisys/include/diagchannel.h @@ -13,169 +13,15 @@ * details. */ -/*++ - * - * Module Name: - * - * diagchannel.h - * - * Abstract: - * - * This file defines the DiagChannel protocol. This protocol is used to aid in - * preserving event data sent by external applications. This protocol provides - * a region for event data to reside in. This data will eventually be sent to - * the Boot Partition where it will be committed to memory and/or disk. This - * file contains platform-independent data that can be built using any - * Supervisor build environment (Windows, Linux, EFI). - * -*/ - #ifndef _DIAG_CHANNEL_H_ #define _DIAG_CHANNEL_H_ #include -#include "channel.h" - -/* {EEA7A573-DB82-447c-8716-EFBEAAAE4858} */ -#define SPAR_DIAG_CHANNEL_PROTOCOL_UUID \ - UUID_LE(0xeea7a573, 0xdb82, 0x447c, \ - 0x87, 0x16, 0xef, 0xbe, 0xaa, 0xae, 0x48, 0x58) - -static const uuid_le spar_diag_channel_protocol_uuid = - SPAR_DIAG_CHANNEL_PROTOCOL_UUID; - -/* {E850F968-3263-4484-8CA5-2A35D087A5A8} */ -#define ULTRA_DIAG_ROOT_CHANNEL_PROTOCOL_GUID \ - UUID_LE(0xe850f968, 0x3263, 0x4484, \ - 0x8c, 0xa5, 0x2a, 0x35, 0xd0, 0x87, 0xa5, 0xa8) - -#define ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE - -/* Must increment this whenever you insert or delete fields within this channel -* struct. Also increment whenever you change the meaning of fields within this -* channel struct so as to break pre-existing software. Note that you can -* usually add fields to the END of the channel struct withOUT needing to -* increment this. */ -#define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2 #define MAX_MODULE_NAME_SIZE 128 /* Maximum length of module name... */ #define MAX_ADDITIONAL_INFO_SIZE 256 /* Maximum length of any additional info -* accompanying event... */ -#define MAX_SUBSYSTEMS 64 /* Maximum number of subsystems allowed in -* DiagChannel... */ -#define LOW_SUBSYSTEMS 32 /* Half of MAX_SUBSYSTEMS to allow 64-bit -* math */ -#define SUBSYSTEM_DEBUG 0 /* Standard subsystem for debug events */ -#define SUBSYSTEM_DEFAULT 1/* Default subsystem for legacy calls to -* ReportEvent */ - -/* few useful subsystem mask values */ -#define SUBSYSTEM_MASK_DEBUG 0x01/* Standard subsystem for debug -* events */ -#define SUBSYSTEM_MASK_DEFAULT 0x02 /* Default subsystem for legacy calls to -* ReportEvents */ - -/* Event parameter "Severity" is overloaded with Cause in byte 2 and Severity in - * byte 0, bytes 1 and 3 are reserved */ -#define SEVERITY_MASK 0x0FF/* mask out all but the Severity in byte 0 */ -#define CAUSE_MASK 0x0FF /* mask out all but the cause in byte 2 */ -#define CAUSE_SHIFT_AMT 16 /* shift 2 bytes to place it in byte 2 */ - -/* SubsystemSeverityFilter */ -#define SEVERITY_FILTER_MASK 0x0F /* mask out the Cause half, SeverityFilter is - * in the lower nibble */ -#define CAUSE_FILTER_MASK 0xF0 /* mask out the Severity half, CauseFilter is in -* the upper nibble */ -#define CAUSE_FILTER_SHIFT_AMT 4 /* shift amount to place it in lower or upper - * nibble */ - -/* Copied from EFI's EFI_TIME struct in efidef.h. EFI headers are not allowed -* in some of the Supervisor areas, such as Monitor, so it has been "ported" here -* for use in diagnostic event timestamps... */ -struct diag_efi_time { - u16 year; /* 1998 - 20XX */ - u8 month; /* 1 - 12 */ - u8 day; /* 1 - 31 */ - u8 hour;/* 0 - 23 */ - u8 minute; /* 0 - 59 */ - u8 second; /* 0 - 59 */ - u8 pad1; - u32 nanosecond; /* 0 - 999, 999, 999 */ -
[PATCH v4 14/16] staging: unisys: Fix double sysfs create for module version
From: Don Zickus When we combined visorchipset and visorbus into one driver we negelected to strip out some of the MODULE_ stuff from one of the files. When building the drivers in, it causes a WARN that we try to create /proc/modules/visorbus/version when it is already created. visorchipset.c is the driver entry point, remove the cruft from visorbus_main.c. Signed-off-by: Don Zickus Signed-off-by: David Kershner Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index d00d114..ff5561c 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1535,8 +1535,3 @@ int visorbus_forcenomatch = 0; module_param_named(debugref, visorbus_debugref, int, S_IRUGO); MODULE_PARM_DESC(visorbus_debugref, "1 to debug reference counting"); int visorbus_debugref = 0; - -MODULE_AUTHOR("Unisys"); -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("Supervisor bus driver for service partition: ver " VERSION); -MODULE_VERSION(VERSION); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 11/16] staging: unisys: Update diag serverity enum
From: David Kershner Give the enum the correct values instead of based on other values. Signed-off-by: David Kershner Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/diagchannel.h | 34 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/staging/unisys/include/diagchannel.h b/drivers/staging/unisys/include/diagchannel.h index e8fb867..c1e74e8 100644 --- a/drivers/staging/unisys/include/diagchannel.h +++ b/drivers/staging/unisys/include/diagchannel.h @@ -58,20 +58,6 @@ static const uuid_le spar_diag_channel_protocol_uuid = * increment this. */ #define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2 -#define SPAR_DIAG_CHANNEL_OK_CLIENT(ch)\ - (spar_check_channel_client(ch,\ - spar_diag_channel_protocol_uuid,\ - "diag",\ - sizeof(struct spar_diag_channel_protocol),\ - ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID,\ - ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE)) - -#define SPAR_DIAG_CHANNEL_OK_SERVER(bytes)\ - (spar_check_channel_server(spar_diag_channel_protocol_uuid,\ - "diag",\ - sizeof(struct spar_diag_channel_protocol),\ - bytes)) - #define MAX_MODULE_NAME_SIZE 128 /* Maximum length of module name... */ #define MAX_ADDITIONAL_INFO_SIZE 256 /* Maximum length of any additional info * accompanying event... */ @@ -204,16 +190,16 @@ struct diag_channel_event { * change is made to this enum, they should also be reflected in that file. */ enum diag_severity { DIAG_SEVERITY_ENUM_BEGIN = 0, - DIAG_SEVERITY_OVERRIDE = DIAG_SEVERITY_ENUM_BEGIN, - DIAG_SEVERITY_VERBOSE = DIAG_SEVERITY_OVERRIDE, /* 0 */ - DIAG_SEVERITY_INFO = DIAG_SEVERITY_VERBOSE + 1, /* 1 */ - DIAG_SEVERITY_WARNING = DIAG_SEVERITY_INFO + 1, /* 2 */ - DIAG_SEVERITY_ERR = DIAG_SEVERITY_WARNING + 1, /* 3 */ - DIAG_SEVERITY_PRINT = DIAG_SEVERITY_ERR + 1,/* 4 */ - DIAG_SEVERITY_SHUTOFF = DIAG_SEVERITY_PRINT + 1, /* 5 */ - DIAG_SEVERITY_ENUM_END = DIAG_SEVERITY_SHUTOFF, /* 5 */ - DIAG_SEVERITY_NONFATAL_ERR = DIAG_SEVERITY_ERR, - DIAG_SEVERITY_FATAL_ERR = DIAG_SEVERITY_PRINT + DIAG_SEVERITY_OVERRIDE = 0, + DIAG_SEVERITY_VERBOSE = 0, + DIAG_SEVERITY_INFO = 1, + DIAG_SEVERITY_WARNING = 2, + DIAG_SEVERITY_ERR = 3, + DIAG_SEVERITY_NONFATAL_ERR = 3, + DIAG_SEVERITY_PRINT = 4, + DIAG_SEVERITY_FATAL_ERR = 4, + DIAG_SEVERITY_SHUTOFF = 5, + DIAG_SEVERITY_ENUM_END = 5 }; /* Event Cause enums -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 04/16] staging: unisys: Migrate bus from devdata to visor_device
From: Don Zickus The bus device and regular device were using two different structs. Let's combine them as they are not entirely different from one another. This allows us to move this creation up the stack later and actually remove bus/dev_info easily. Most of the churn is just renaming devdata -> dev and 'struct visorbus_devdata' to 'struct visor_device'. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c | 127 +++- 1 file changed, 57 insertions(+), 70 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 06d267b..fc0f085 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -36,18 +36,6 @@ int visorbus_devicetest; int visorbus_debugref; #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024) -/** This is the private data that we store for each bus device instance. - */ -struct visorbus_devdata { - int devno; /* this is the chipset busNo */ - struct list_head list_all; - struct device dev; - struct kobject kobj; - struct visorchannel *chan; /* channel area for bus itself */ - bool vbus_valid; - void *vbus_hdr_info; -}; - #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c #define POLLJIFFIES_TESTWORK 100 #define POLLJIFFIES_NORMALCHANNEL 10 @@ -137,7 +125,7 @@ static struct ultra_vbus_deviceinfo chipset_driverinfo; /* filled in with info about this driver, wrt it servicing client busses */ static struct ultra_vbus_deviceinfo clientbus_driverinfo; -/** list of visorbus_devdata structs, linked via .list_all */ +/** list of visor_device structs, linked via .list_all */ static LIST_HEAD(list_all_bus_instances); /** list of visor_device structs, linked via .list_all */ static LIST_HEAD(list_all_device_instances); @@ -195,10 +183,10 @@ away: static void visorbus_release_busdevice(struct device *xdev) { - struct visorbus_devdata *devdata = dev_get_drvdata(xdev); + struct visor_device *dev = dev_get_drvdata(xdev); dev_set_drvdata(xdev, NULL); - kfree(devdata); + kfree(dev); kfree(xdev); } @@ -524,9 +512,6 @@ static const struct attribute_group *visorbus_dev_groups[] = { /* end implementation of specific channel attributes */ -#define to_visorbus_devdata(obj) \ - container_of(obj, struct visorbus_devdata, dev) - /* BUS instance attributes * * define & implement display of bus attributes under @@ -1008,7 +993,7 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts); * device. */ static int -create_visor_device(struct visorbus_devdata *devdata, +create_visor_device(struct visor_device *bdev, struct visorchipset_device_info *dev_info, u64 partition_handle) { @@ -1032,7 +1017,7 @@ create_visor_device(struct visorbus_devdata *devdata, dev->channel_type_guid = dev_info->channel_type_guid; dev->chipset_bus_no = chipset_bus_no; dev->chipset_dev_no = chipset_dev_no; - dev->device.parent = &devdata->dev; + dev->device.parent = &bdev->device; sema_init(&dev->visordriver_callback_lock, 1); /* unlocked */ dev->device.bus = &visorbus_type; dev->device.groups = visorbus_dev_groups; @@ -1270,7 +1255,7 @@ fix_vbus_dev_info(struct visor_device *visordev) { int i; struct visorchipset_bus_info bus_info; - struct visorbus_devdata *devdata = NULL; + struct visor_device *dev = NULL; struct visor_driver *visordrv; int bus_no = visordev->chipset_bus_no; int dev_no = visordev->chipset_dev_no; @@ -1287,8 +1272,8 @@ fix_vbus_dev_info(struct visor_device *visordev) if (!visorchipset_get_bus_info(bus_no, &bus_info)) return; - devdata = (struct visorbus_devdata *)(bus_info.bus_driver_context); - if (!devdata) + dev = (struct visor_device *)(bus_info.bus_driver_context); + if (!dev) return; if (!hdr_info) @@ -1311,28 +1296,28 @@ fix_vbus_dev_info(struct visor_device *visordev) bus_device_info_init(&dev_info, chan_type_name, visordrv->name, visordrv->version, visordrv->vertag); - write_vbus_dev_info(devdata->chan, hdr_info, &dev_info, dev_no); + write_vbus_dev_info(dev->visorchannel, hdr_info, &dev_info, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our evil counterpart, virtpci. */ - write_vbus_chp_info(devdata->chan, hdr_info, &chipset_driverinfo); - write_vbus_bus_info(devdata->chan, hdr_info, &clientbus_driverinfo); + write_vbus_chp_info(dev->visorchannel, hdr_info, &chipset_driverinfo); + write_vbus_bus_info(dev->visorchannel, hdr_info, &cl
[PATCH v4 05/16] staging: unisys: Remove unused cruft
From: Don Zickus Removing stuff that isn't being used. Another prepartion patch to allow us to use visor_device everywhere without the baggage of bus/dev_info. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c| 72 -- drivers/staging/unisys/visorbus/visorbus_private.h | 13 2 files changed, 85 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index fc0f085..ec20c46 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -31,8 +31,6 @@ int visorbus_debug; int visorbus_forcematch; int visorbus_forcenomatch; -#define MAXDEVICETEST 4 -int visorbus_devicetest; int visorbus_debugref; #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024) @@ -93,7 +91,6 @@ static struct delayed_work periodic_work; static struct workqueue_struct *periodic_test_workqueue; static struct workqueue_struct *periodic_dev_workqueue; static long long bus_count;/** number of bus instances */ -static long long total_devices_created; /** ever-increasing */ static void chipset_bus_create(struct visorchipset_bus_info *bus_info); @@ -462,33 +459,12 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr, return snprintf(buf, PAGE_SIZE, "%s\n", drv->channel_types[i - 1].name); } -static ssize_t dump_show(struct device *dev, struct device_attribute *attr, -char *buf) -{ -/* TODO: replace this with debugfs code - struct visor_device *vdev = to_visor_device(dev); - int count = 0; - struct seq_file *m = NULL; - if (vdev->visorchannel == NULL) - return 0; - m = visor_seq_file_new_buffer(buf, PAGE_SIZE - 1); - if (m == NULL) - return 0; - visorchannel_debug(vdev->visorchannel, 1, m, 0); - count = m->count; - visor_seq_file_done_buffer(m); - m = NULL; -*/ - return 0; -} - static DEVICE_ATTR_RO(physaddr); static DEVICE_ATTR_RO(nbytes); static DEVICE_ATTR_RO(clientpartition); static DEVICE_ATTR_RO(typeguid); static DEVICE_ATTR_RO(zoneguid); static DEVICE_ATTR_RO(typename); -static DEVICE_ATTR_RO(dump); static struct attribute *channel_attrs[] = { &dev_attr_physaddr.attr, @@ -497,7 +473,6 @@ static struct attribute *channel_attrs[] = { &dev_attr_typeguid.attr, &dev_attr_zoneguid.attr, &dev_attr_typename.attr, - &dev_attr_dump.attr, }; static struct attribute_group channel_attr_grp = { @@ -702,25 +677,6 @@ unregister_driver_attributes(struct visor_driver *drv) driver_remove_file(&drv->driver, &drv->version_attr); } -/* DEVICE attributes - * - * define & implement display of device attributes under - * /sys/bus/visorbus/devices/. - * - */ - -#define DEVATTR(nam, func) { \ - .attr = { .name = __stringify(nam), \ - .mode = 0444, \ - .owner = THIS_MODULE }, \ - .show = func, \ -} - -static struct device_attribute visor_device_attrs[] = { - /* DEVATTR(channel_nbytes, DEVICE_ATTR_channel_nbytes), */ - __ATTR_NULL -}; - static void dev_periodic_work(void *xdev) { @@ -1088,7 +1044,6 @@ away: put_device(&dev->device); kfree(dev); } else { - total_devices_created++; list_add_tail(&dev->list_all, &list_all_device_instances); } return rc; @@ -1400,7 +1355,6 @@ create_bus_type(void) { int rc = 0; - visorbus_type.dev_attrs = visor_device_attrs; rc = bus_register(&visorbus_type); return rc; } @@ -1428,11 +1382,6 @@ remove_all_visor_devices(void) } } -static bool entered_testing_mode; -static struct visorchannel *test_channel_infos[MAXDEVICETEST]; -static unsigned long test_bus_nos[MAXDEVICETEST]; -static unsigned long test_dev_nos[MAXDEVICETEST]; - static void chipset_bus_create(struct visorchipset_bus_info *bus_info) { @@ -1492,17 +1441,8 @@ chipset_device_create(struct visorchipset_device_info *dev_info) POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, dev_no, bus_no, POSTCODE_SEVERITY_INFO); - if (entered_testing_mode) - return; if (!visorchipset_get_bus_info(bus_no, &bus_info)) goto away; - if (visorbus_devicetest) - if (total_devices_created < MAXDEVICETEST) { - test_channel_infos[total_devices_created] = - dev_info->visorchannel; - test_bus_nos[total_devices_created] = bus_no; - test_dev_nos[total_devices_created] = dev_no; - } POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, dev_no, bus_no, POSTCODE_SEVERITY
[PATCH v4 07/16] staging: unisys: Do not use 0 as the default bus root device number
From: Don Zickus I used 0 as the device id for the bus root, neglecting the fact that device 0 is a valid id in Unisys's configuration. Modify this to use UINT_MAX instead as a unique number. As fallout from this change it was noticed the bus_no and dev_no was not defined the same way consistently. Fix visorbus.h to use u32 there. Fix the resulting printk warning too. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/visorbus.h | 4 ++-- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- drivers/staging/unisys/visorbus/visorchipset.c | 6 -- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 3152ba4..c60f7d4 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -150,8 +150,8 @@ struct visor_device { struct semaphore visordriver_callback_lock; bool pausing; bool resuming; - unsigned long chipset_bus_no; - unsigned long chipset_dev_no; + u32 chipset_bus_no; + u32 chipset_dev_no; struct visorchipset_state state; uuid_le type; uuid_le inst; diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 7667b15..e5731b1 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -572,7 +572,7 @@ static ssize_t client_bus_info_show(struct device *dev, if (vdev->name) partition_name = vdev->name; x = snprintf(p, remain, -"Client device / client driver info for %s partition (vbus #%ld):\n", +"Client device / client driver info for %s partition (vbus #%d):\n", partition_name, vdev->chipset_dev_no); p += x; remain -= x; diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 4dd0a07..618732b 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -56,6 +56,8 @@ #define UNISYS_SPAR_ID_ECX 0x70537379 #define UNISYS_SPAR_ID_EDX 0x34367261 +#define BUS_ROOT_DEVICEUINT_MAX + /* * Module parameters */ @@ -727,8 +729,8 @@ static int match_visorbus_dev_by_id(struct device *dev, void *data) u32 bus_no = id->bus_no; u32 dev_no = id->dev_no; - if (((bus_no == -1) || (vdev->chipset_bus_no == bus_no)) && - ((dev_no == -1) || (vdev->chipset_dev_no == dev_no))) + if ((vdev->chipset_bus_no == bus_no) && + (vdev->chipset_dev_no == dev_no)) return 1; return 0; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 03/16] staging: unisys: Prepare vbus_hdr_info to be public
From: Don Zickus In order to remove bus_info, we need to migrate vbus_hdr_info into the public namespace of visor_device. Because the struct is private, we use a void * to hide the contents. As a result, we need to allocate vbus_hdr_info and manage it. Also work around vbus_valid, as that variable will not be used in the public namespace. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorbus_main.c | 52 ++--- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 49a34bb..06d267b 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -45,7 +45,7 @@ struct visorbus_devdata { struct kobject kobj; struct visorchannel *chan; /* channel area for bus itself */ bool vbus_valid; - struct spar_vbus_headerinfo vbus_hdr_info; + void *vbus_hdr_info; }; #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c @@ -1276,10 +1276,13 @@ fix_vbus_dev_info(struct visor_device *visordev) int dev_no = visordev->chipset_dev_no; struct ultra_vbus_deviceinfo dev_info; const char *chan_type_name = NULL; + struct spar_vbus_headerinfo *hdr_info; if (!visordev->device.driver) return; + hdr_info = (struct spar_vbus_headerinfo *)visordev->vbus_hdr_info; + visordrv = to_visor_driver(visordev->device.driver); if (!visorchipset_get_bus_info(bus_no, &bus_info)) return; @@ -1288,7 +1291,7 @@ fix_vbus_dev_info(struct visor_device *visordev) if (!devdata) return; - if (!devdata->vbus_valid) + if (!hdr_info) return; /* Within the list of device types (by GUID) that the driver @@ -1308,16 +1311,13 @@ fix_vbus_dev_info(struct visor_device *visordev) bus_device_info_init(&dev_info, chan_type_name, visordrv->name, visordrv->version, visordrv->vertag); - write_vbus_dev_info(devdata->chan, - &devdata->vbus_hdr_info, &dev_info, dev_no); + write_vbus_dev_info(devdata->chan, hdr_info, &dev_info, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our evil counterpart, virtpci. */ - write_vbus_chp_info(devdata->chan, &devdata->vbus_hdr_info, - &chipset_driverinfo); - write_vbus_bus_info(devdata->chan, &devdata->vbus_hdr_info, - &clientbus_driverinfo); + write_vbus_chp_info(devdata->chan, hdr_info, &chipset_driverinfo); + write_vbus_bus_info(devdata->chan, hdr_info, &clientbus_driverinfo); } /** Create a device instance for the visor bus itself. @@ -1328,6 +1328,7 @@ create_bus_instance(struct visorchipset_bus_info *bus_info) struct visorbus_devdata *rc = NULL; struct visorbus_devdata *devdata = NULL; int id = bus_info->bus_no; + struct spar_vbus_headerinfo *hdr_info; POSTCODE_LINUX_2(BUS_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO); devdata = kzalloc(sizeof(*devdata), GFP_KERNEL); @@ -1336,6 +1337,13 @@ create_bus_instance(struct visorchipset_bus_info *bus_info) rc = NULL; goto away; } + + hdr_info = kzalloc(sizeof(*hdr_info), GFP_KERNEL); + if (!hdr_info) { + rc = NULL; + goto away_mem; + } + dev_set_name(&devdata->dev, "visorbus%d", id); devdata->dev.bus = &visorbus_type; devdata->dev.groups = visorbus_groups; @@ -1344,26 +1352,19 @@ create_bus_instance(struct visorchipset_bus_info *bus_info) POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, id, POSTCODE_SEVERITY_ERR); rc = NULL; - goto away; + goto away_mem2; } devdata->devno = id; devdata->chan = bus_info->visorchannel; if (bus_info->flags.server) { init_vbus_channel(devdata->chan); } else { - if (get_vbus_header_info(devdata->chan, -&devdata-> -vbus_hdr_info) >= 0) { - devdata->vbus_valid = true; - write_vbus_chp_info(devdata->chan, - &devdata-> - vbus_hdr_info, - &chipset_driverinfo - ); - write_vbus_bus_info(devdata->chan, - &devdata-> - vbus_hdr_info, -
[PATCH v4 13/16] staging: unisys: Clean up diag_serverity enum
From: David Kershner Get rid of unused values in the enum. Signed-off-by: David Kershner Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/diagchannel.h | 32 +++- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/staging/unisys/include/diagchannel.h b/drivers/staging/unisys/include/diagchannel.h index 82932c5..d2d3568 100644 --- a/drivers/staging/unisys/include/diagchannel.h +++ b/drivers/staging/unisys/include/diagchannel.h @@ -16,36 +16,28 @@ #ifndef _DIAG_CHANNEL_H_ #define _DIAG_CHANNEL_H_ -#include - #define MAX_MODULE_NAME_SIZE 128 /* Maximum length of module name... */ -#define MAX_ADDITIONAL_INFO_SIZE 256 /* Maximum length of any additional info -* accompanying event... +#define MAX_ADDITIONAL_INFO_SIZE 256 /* Maximum length of any additional +* info accompanying event... */ /* Levels of severity for diagnostic events, in order from lowest severity to -* highest (i.e. fatal errors are the most severe, and should always be logged, -* but info events rarely need to be logged except during debugging). The values -* DIAG_SEVERITY_ENUM_BEGIN and DIAG_SEVERITY_ENUM_END are not valid severity -* values. They exist merely to dilineate the list, so that future additions -* won't require changes to the driver (i.e. when checking for out-of-range -* severities in SetSeverity). The values DIAG_SEVERITY_OVERRIDE and -* DIAG_SEVERITY_SHUTOFF are not valid severity values for logging events but -* they are valid for controlling the amount of event data. This enum is also -* defined in DotNet\sParFramework\ControlFramework\ControlFramework.cs. If a -* change is made to this enum, they should also be reflected in that file. */ + * highest (i.e. fatal errors are the most severe, and should always be logged, + * but info events rarely need to be logged except during debugging). The + * values DIAG_SEVERITY_ENUM_BEGIN and DIAG_SEVERITY_ENUM_END are not valid + * severity values. They exist merely to dilineate the list, so that future + * additions won't require changes to the driver (i.e. when checking for + * out-of-range severities in SetSeverity). The values DIAG_SEVERITY_OVERRIDE + * and DIAG_SEVERITY_SHUTOFF are not valid severity values for logging events + * but they are valid for controlling the amount of event data. Changes made + * to the enum, need to be reflected in s-Par. + */ enum diag_severity { - DIAG_SEVERITY_ENUM_BEGIN = 0, - DIAG_SEVERITY_OVERRIDE = 0, DIAG_SEVERITY_VERBOSE = 0, DIAG_SEVERITY_INFO = 1, DIAG_SEVERITY_WARNING = 2, DIAG_SEVERITY_ERR = 3, - DIAG_SEVERITY_NONFATAL_ERR = 3, DIAG_SEVERITY_PRINT = 4, - DIAG_SEVERITY_FATAL_ERR = 4, - DIAG_SEVERITY_SHUTOFF = 5, - DIAG_SEVERITY_ENUM_END = 5 }; #endif -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 16/16] staging: unisys: Add the bus device to the visor device list.
From: David Kershner When the bus device was created the list_all variables were not being initialized. When the CONTROLVM_BUS_CONFIGURE message was being sent, it was failing to find the bus and produced a panic. Initialize the bus_info->list_all variable by doing a INIT_LIST_HEAD. Signed-off-by: David Kershner Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorbus/visorchipset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 99fa96e..cf35d9d 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1107,6 +1107,7 @@ bus_create(struct controlvm_message *inmsg) goto cleanup; } + INIT_LIST_HEAD(&bus_info->list_all); bus_info->chipset_bus_no = bus_no; bus_info->chipset_dev_no = BUS_ROOT_DEVICE; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 09/16] staging: unisys: Convert device creation to use visor_device
From: Don Zickus This patch removes the legacy dev_info struct and instead creates and passes around a traditional struct device. This allows us to remove a lot of the various look up code and removes the doubt if the struct exists or not. Half of the churn is just the conversion of visorchipset_device_info to visor_device. Various cleanups include re-arranging the failure paths to make more sense. Pay attention to the create_visor_device function. This had a lot of churn to simplify everything. Lots of functions disappeared because they are not needed any more. Signed-off-by: Don Zickus Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/visorbus.h | 8 +- drivers/staging/unisys/visorbus/visorbus_main.c| 146 +-- drivers/staging/unisys/visorbus/visorbus_private.h | 49 ++- drivers/staging/unisys/visorbus/visorchipset.c | 157 + 4 files changed, 80 insertions(+), 280 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index e7f9984..581d962 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -43,7 +43,7 @@ struct visor_device; extern struct bus_type visorbus_type; typedef void (*visorbus_state_complete_func) (struct visor_device *dev, - int status, void *dev_info); + int status); struct visorchipset_state { u32 created:1; u32 attached:1; @@ -106,11 +106,9 @@ struct visor_driver { * fails or completes successfully. */ int (*pause)(struct visor_device *dev, -visorbus_state_complete_func complete_func, -void *dev_info); +visorbus_state_complete_func complete_func); int (*resume)(struct visor_device *dev, - visorbus_state_complete_func complete_func, - void *dev_info); + visorbus_state_complete_func complete_func); /** These fields are for private use by the bus driver only. */ struct device_driver driver; diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 888e65d..d00d114 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -95,10 +95,10 @@ static long long bus_count; /** number of bus instances */ static void chipset_bus_create(struct visor_device *bus_info); static void chipset_bus_destroy(struct visor_device *bus_info); -static void chipset_device_create(struct visorchipset_device_info *dev_info); -static void chipset_device_destroy(struct visorchipset_device_info *dev_info); -static void chipset_device_pause(struct visorchipset_device_info *dev_info); -static void chipset_device_resume(struct visorchipset_device_info *dev_info); +static void chipset_device_create(struct visor_device *dev_info); +static void chipset_device_destroy(struct visor_device *dev_info); +static void chipset_device_pause(struct visor_device *dev_info); +static void chipset_device_resume(struct visor_device *dev_info); /** These functions are implemented herein, and are called by the chipset * driver to notify us about specific events. @@ -184,7 +184,6 @@ visorbus_release_busdevice(struct device *xdev) dev_set_drvdata(xdev, NULL); kfree(dev); - kfree(xdev); } /** This is called when device_unregister() is called for each child @@ -754,17 +753,10 @@ away: * initialized. */ if (!dev->responded_to_device_create) { - struct visorchipset_device_info dev_info; - - if (!visorchipset_get_device_info(dev->chipset_bus_no, - dev->chipset_dev_no, - &dev_info)) - /* hmm, what to do here */ - return rc; dev->responded_to_device_create = true; if (chipset_responders.device_create) - (*chipset_responders.device_create)(&dev_info, rc); + (*chipset_responders.device_create)(dev, rc); } return rc; } @@ -949,30 +941,15 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts); * device. */ static int -create_visor_device(struct visor_device *bdev, - struct visorchipset_device_info *dev_info) +create_visor_device(struct visor_device *dev) { int rc = -1; - struct visor_device *dev = NULL; - bool gotten = false, registered1 = false, registered2 = false; - u32 chipset_bus_no = dev_info->bus_no; - u32 chipset_dev_no = dev_info->dev_no; + u32 chipset_bus_no = dev->chipset_bus_no; + u32 chipset_dev_no = dev->chipset_dev_no; POSTCODE_LINUX_4(DEVICE_CREATE_EN
Re: [PATCH] staging: rtl8188eu: Kill dead calls to kill_pid()
On 05/31/2015 08:04 AM, Jakub Sitnicki wrote: There is no interface to register PIDs of processes the driver should send a signal to. Remove it. Signed-off-by: Jakub Sitnicki --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/include/osdep_service.h | 2 -- drivers/staging/rtl8188eu/include/rtw_ioctl.h | 2 -- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 2 -- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 12 5 files changed, 19 deletions(-) This patch looks good to me. ACKed-by: Larry Finger diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index c813179..bcc74dc 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -175,7 +175,6 @@ static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) }; struct adapter { - int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */ u16 chip_type; struct dvobj_priv *dvobj; diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 515e949..00472e0 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -157,8 +157,6 @@ void rtw_free_netdev(struct net_device *netdev); #define FUNC_ADPT_FMT "%s(%s)" #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name -#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1) - u64 rtw_modular64(u64 x, u64 y); /* Macros for handling unaligned memory accesses */ diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl.h b/drivers/staging/rtl8188eu/include/rtw_ioctl.h index f3aa924..ee2cb54 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ioctl.h +++ b/drivers/staging/rtl8188eu/include/rtw_ioctl.h @@ -117,6 +117,4 @@ int drv_set_info(struct net_device *MiniportAdapterContext, u32 informationbufferlength, u32 *bytesread, u32 *bytesneeded); -extern int ui_pid[3]; - #endif /* #ifndef __INC_CEINFO_ */ diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c index baff1e2..9099241 100644 --- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c @@ -41,8 +41,6 @@ void rtw_os_indicate_connect(struct adapter *adapter) { rtw_indicate_wx_assoc_event(adapter); netif_carrier_on(adapter->pnetdev); - if (adapter->pid[2] != 0) - rtw_signal_process(adapter->pid[2], SIGALRM); } void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted) diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c index ef3c73e..d0d4335 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c @@ -32,8 +32,6 @@ #include #include -int ui_pid[3] = {0, 0, 0}; - #define USB_VENDER_ID_REALTEK 0x0bda /* DID_USB_v916_20130116 */ @@ -330,11 +328,6 @@ static int rtw_resume_process(struct adapter *padapter) _exit_pwrlock(&pwrpriv->lock); - if (padapter->pid[1] != 0) { - DBG_88E("pid[1]:%d\n", padapter->pid[1]); - rtw_signal_process(padapter->pid[1], SIGUSR2); - } - rtw_roaming(padapter, NULL); ret = 0; @@ -511,11 +504,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device goto free_dvobj; } - if (ui_pid[1] != 0) { - DBG_88E("ui_pid[1]:%d\n", ui_pid[1]); - rtw_signal_process(ui_pid[1], SIGUSR2); - } - RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-871x_drv - drv_init, success!\n")); status = _SUCCESS; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: unisys: visorbus: add static declarations
On 05/28/2015 10:04 PM, Drew Fustini wrote: Add static declarations to statisfy sparse warnings in: drivers/staging/unisys/visorbus/visorbus_main.c Hi, I'd really like to take this patch, but it doesn't apply at the end of the current set of patches I'm working with, and if I put it ahead of them it'll make them not apply. Would you mind if I sent a second version of this patch with it rebased against my last set of patches, so it will apply? Thanks for the help! -- Ben ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/4] staging: wilc1000: Fix some compile time warnings
Signed-off-by: Stanislav Kholmanskikh --- Changes since V1: Split the V1 series into more logically unrelated patches and updated patch descriptions accordingly. drivers/staging/wilc1000/wilc_spi.c | 6 +++--- drivers/staging/wilc1000/wilc_wlan.c | 6 ++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 2f38dda..46f28ca 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -1194,10 +1194,10 @@ static int spi_init(wilc_wlan_inp_t *inp, wilc_debug_func func) /* Read failed. Try with CRC off. This might happen when module * is removed but chip isn't reset*/ g_spi.crc_off = 1; - PRINT_ER("[wilc spi]: Failed internal read protocol with CRC on, retyring with CRC off...\n", __LINE__); + PRINT_ER("[wilc spi %d]: Failed internal read protocol with CRC on, retyring with CRC off...\n", __LINE__); if (!spi_internal_read(WILC_SPI_PROTOCOL_OFFSET, ®)) { - /* Reaad failed with both CRC on and off, something went bad */ - PRINT_ER("[wilc spi]: Failed internal read protocol...\n", __LINE__); + /* Read failed with both CRC on and off, something went bad */ + PRINT_ER("[wilc spi %d]: Failed internal read protocol...\n", __LINE__); return 0; } } diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 92ed42a..bdee5e6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -894,8 +894,6 @@ INLINE void chip_wakeup(void) #endif void chip_sleep_manually(WILC_Uint32 u32SleepTime) { - uint32_t val32; - if (genuChipPSstate != CHIP_WAKEDUP) { /* chip is already sleeping. Do nothing */ return; @@ -2302,7 +2300,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) #else g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size); #endif - PRINT_D(TX_DBG, "g_wlan.tx_buffer = 0x%x\n", g_wlan.tx_buffer); + PRINT_D(TX_DBG, "g_wlan.tx_buffer = 0x%p\n", g_wlan.tx_buffer); if (g_wlan.tx_buffer == WILC_NULL) { /* ENOBUFS 105 */ @@ -2319,7 +2317,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) #else g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size); #endif - PRINT_D(TX_DBG, "g_wlan.rx_buffer =0x%x\n", g_wlan.rx_buffer); + PRINT_D(TX_DBG, "g_wlan.rx_buffer =0x%p\n", g_wlan.rx_buffer); if (g_wlan.rx_buffer == WILC_NULL) { /* ENOBUFS 105 */ ret = -105; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/4] staging: wilc1000: Change the prototype of WILC_WFI_init_mon_interface
WILC_WFI_init_mon_interface() should be declared with 'const char *name', not simply 'char *name', because this 'name' argument is only passed as is to alloc_netdev(), and alloc_netdev(), in turn, expects 'const char *'. Signed-off-by: Stanislav Kholmanskikh --- drivers/staging/wilc1000/linux_mon.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index a19be45..f0a20a9 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -522,7 +522,7 @@ static void WILC_WFI_mon_setup(struct net_device *dev) * @date 12 JUL 2012 * @version 1.0 */ -struct net_device *WILC_WFI_init_mon_interface(char *name, struct net_device *real_dev) +struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev) { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 9eb8f37..b63c746 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -123,7 +123,7 @@ int WILC_WFI_DeInitHostInt(struct net_device *net); int WILC_WFI_InitHostInt(struct net_device *net); void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size); int WILC_WFI_deinit_mon_interface(void); -struct net_device *WILC_WFI_init_mon_interface(char *name, struct net_device *real_dev); +struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev); #ifdef TCP_ENHANCEMENTS #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/4] staging: wilc1000: Cleanup to coreconfigurator
Fixed several syntax/style issues found with checkpatch.pl. Signed-off-by: Stanislav Kholmanskikh --- drivers/staging/wilc1000/coreconfigurator.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 01625bd..2c6b7f4 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -28,7 +28,7 @@ #define INVALID 255 #define MAC_ADDR_LEN6 #define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \ - BEACON_INTERVAL_LEN + CAP_INFO_LEN) +BEACON_INTERVAL_LEN + CAP_INFO_LEN) /*/ /* Function Macros */ @@ -675,7 +675,7 @@ WILC_Sint32 CoreConfiguratorInit(void) tstrWILC_SemaphoreAttrs strSemSendPktAttrs; tstrWILC_SemaphoreAttrs strSemPktRespAttrs; - PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit() \n"); + PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n"); WILC_SemaphoreFillDefault(&strSemSendPktAttrs); strSemSendPktAttrs.u32InitCount = 1; @@ -687,7 +687,7 @@ WILC_Sint32 CoreConfiguratorInit(void) gps8ConfigPacket = (WILC_Sint8 *)WILC_MALLOC(MAX_PACKET_BUFF_SIZE); if (gps8ConfigPacket == NULL) { - PRINT_ER("failed in gps8ConfigPacket allocation \n"); + PRINT_ER("failed in gps8ConfigPacket allocation\n"); s32Error = WILC_NO_MEM; goto _fail_; } @@ -718,13 +718,13 @@ WILC_Uint8 *get_tim_elm(WILC_Uint8 *pu8msa, WILC_Uint16 u16RxLen, WILC_Uint16 u1 /* Search for the TIM Element Field and return if the element is found */ while (u16index < (u16RxLen - FCS_LEN)) { if (pu8msa[u16index] == ITIM) { - return(&pu8msa[u16index]); + return &pu8msa[u16index]; } else { u16index += (IE_HDR_LEN + pu8msa[u16index + 1]); } } - return(0); + return 0; } /* This function gets the current channel information from @@ -736,7 +736,7 @@ WILC_Uint8 get_current_channel_802_11n(WILC_Uint8 *pu8msa, WILC_Uint16 u16RxLen) index = TAG_PARAM_OFFSET; while (index < (u16RxLen - FCS_LEN)) { if (pu8msa[index] == IDSPARMS) - return (pu8msa[index + 2]); + return pu8msa[index + 2]; else /* Increment index by length information and header */ index += pu8msa[index + 1] + IE_HDR_LEN; @@ -758,7 +758,7 @@ WILC_Uint8 get_current_channel(WILC_Uint8 *pu8msa, WILC_Uint16 u16RxLen) #else /* FIVE_GHZ_BAND */ /* Extract current channel information from */ /* the beacon/probe response frame */ - return (get_current_channel_802_11n(pu8msa, u16RxLen)); + return get_current_channel_802_11n(pu8msa, u16RxLen); #endif /* FIVE_GHZ_BAND */ #else return 0; @@ -1452,7 +1452,7 @@ void ProcessAdrWid(WILC_Char *pcPacket, WILC_Sint32 *ps32PktLen, void ProcessBinWid(WILC_Char *pcPacket, WILC_Sint32 *ps32PktLen, tstrWID *pstrWID, WILC_Uint8 *pu8val, WILC_Sint32 s32ValueSize) { - /* WILC_ERROR("processing Binary WIDs is not supported \n"); */ + /* WILC_ERROR("processing Binary WIDs is not supported\n"); */ WILC_Uint16 u16MsgLen = 0; WILC_Uint16 idx= 0; @@ -1591,7 +1591,7 @@ WILC_Sint32 further_process_response(WILC_Uint8 *resp, WILC_memcpy(pstrWIDresult->ps8WidVal, cfg_str, cfg_len); /* mostafa: no need currently for the extra NULL byte */ pstrWIDresult->s32ValueSize = cfg_len; } else { - PRINT_ER("allocated WID buffer length is smaller than the received WID Length \n"); + PRINT_ER("allocated WID buffer length is smaller than the received WID Length\n"); retval = -2; } @@ -2035,7 +2035,7 @@ WILC_Sint32 ConfigProvideResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32RespLe } else { WILC_memcpy(gstrConfigPktInfo.pcRespBuffer, pcRespBuffer, gstrConfigPktInfo.s32MaxRespBuffLen); gstrConfigPktInfo.s32BytesRead = gstrConfigPktInfo.s32MaxRespBuffLen; - PRINT_ER("BusProvideResponse() Response greater than the prepared Buffer Size \n"); + PRINT_ER("BusProvideResponse() Response greater than the prepared Buffer Size\n"); } WILC_SemaphoreRelease(&SemHandlePktResp, WILC_NULL); @@ -2084,7 +2084,7 @@ WILC_Sint32 ConfigPktReceived(WILC_Uint8 *pu8RxPacket,
[PATCH v2 4/4] staging: wilc1000: Align enum members in coreconfigurator
Aligned enum members to follow a common style per enum. Signed-off-by: Stanislav Kholmanskikh --- drivers/staging/wilc1000/coreconfigurator.c | 29 +++--- drivers/staging/wilc1000/coreconfigurator.h | 62 ++--- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 2c6b7f4..5c6d29f 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -40,11 +40,12 @@ /*/ /* Basic Frame Type Codes (2-bit) */ -typedef enum {FRAME_TYPE_CONTROL = 0x04, - FRAME_TYPE_DATA= 0x08, - FRAME_TYPE_MANAGEMENT= 0x00, - FRAME_TYPE_RESERVED = 0x0C, - FRAME_TYPE_FORCE_32BIT = 0x +typedef enum { + FRAME_TYPE_CONTROL = 0x04, + FRAME_TYPE_DATA= 0x08, + FRAME_TYPE_MANAGEMENT = 0x00, + FRAME_TYPE_RESERVED= 0x0C, + FRAME_TYPE_FORCE_32BIT = 0x } tenuBasicFrmType; /* Frame Type and Subtype Codes (6-bit) */ @@ -188,7 +189,7 @@ static tstrWID gastrWIDs[] = { {WID_QOS_ENABLE,WID_CHAR}, {WID_11I_MODE, WID_CHAR}, {WID_CURRENT_TX_RATE, WID_CHAR}, - {WID_LINKSPEED, WID_CHAR}, + {WID_LINKSPEED, WID_CHAR}, {WID_RTS_THRESHOLD, WID_SHORT}, {WID_FRAG_THRESHOLD,WID_SHORT}, {WID_SSID, WID_STR}, @@ -223,14 +224,14 @@ static tstrWID gastrWIDs[] = { {WID_MEMORY_ACCESS_32BIT, WID_INT}, {WID_MEMORY_ACCESS_16BIT, WID_SHORT}, {WID_MEMORY_ACCESS_8BIT,WID_CHAR}, - {WID_SITE_SURVEY_RESULTS, WID_STR}, - {WID_PMKID_INFO,WID_STR}, - {WID_ASSOC_RES_INFO,WID_STR}, - {WID_MANUFACTURER, WID_STR}, /* 4 Wids added for the CAPI tool*/ - {WID_MODEL_NAME,WID_STR}, - {WID_MODEL_NUM, WID_STR}, - {WID_DEVICE_NAME, WID_STR}, - {WID_SSID_PROBE_REQ, WID_STR}, + {WID_SITE_SURVEY_RESULTS, WID_STR}, + {WID_PMKID_INFO,WID_STR}, + {WID_ASSOC_RES_INFO,WID_STR}, + {WID_MANUFACTURER, WID_STR}, /* 4 Wids added for the CAPI tool*/ + {WID_MODEL_NAME,WID_STR}, + {WID_MODEL_NUM, WID_STR}, + {WID_DEVICE_NAME, WID_STR}, + {WID_SSID_PROBE_REQ,WID_STR}, #ifdef MAC_802_11N {WID_11N_ENABLE,WID_CHAR}, diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 9cdfa2a..16ce612 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -19,9 +19,9 @@ /*/ /* Number of WID Options Supported */ #define NUM_BASIC_SWITCHES 45 -#define NUM_FHSS_SWITCHES0 +#define NUM_FHSS_SWITCHES 0 -#define NUM_RSSI 5 +#define NUM_RSSI5 #ifdef MAC_802_11N #define NUM_11N_BASIC_SWITCHES 25 @@ -51,14 +51,14 @@ extern WILC_Uint16 g_num_total_switches; #define MAX_PACKET_BUFF_SIZE 1596 -#define MAX_STRING_LEN 256 -#define MAX_SURVEY_RESULT_FRAG_SIZE MAX_STRING_LEN -#define SURVEY_RESULT_LENGTH 44 -#define MAX_ASSOC_RESP_FRAME_SIZE MAX_STRING_LEN +#define MAX_STRING_LEN 256 +#define MAX_SURVEY_RESULT_FRAG_SIZE MAX_STRING_LEN +#define SURVEY_RESULT_LENGTH 44 +#define MAX_ASSOC_RESP_FRAME_SIZEMAX_STRING_LEN -#define STATUS_MSG_LEN 12 -#define MAC_CONNECTED 1 -#define MAC_DISCONNECTED 0 +#define STATUS_MSG_LEN 12 +#define MAC_CONNECTED1 +#define MAC_DISCONNECTED 0 @@ -327,10 +327,10 @@ typedef enum { WID_SUPP_PASSWORD = 0x3011, WID_SITE_SURVEY_RESULTS= 0x3012, WID_RX_POWER_LEVEL = 0x3013, - WID_MANUFACTURER = 0x3026, /*Added for CAPI tool */ - WID_MODEL_NAME = 0x3027, /*Added for CAPI tool */ - WID_MODEL_NUM = 0x3028, /*Added for CAPI tool */ - WID_DEVICE_NAME= 0x3029, /*Added for CAPI tool */ + WID_MANUFACTURER = 0x3026,/*Added for CAPI tool */ + WID_MODEL_NAME = 0x3027,/*Added for CAPI
Re: [PATCH 1/2] staging: wilc1000: Fix some compile warnings
Hello. On Sun, May 31, 2015 at 08:59:41AM +0900, Greg KH wrote: > On Sat, May 30, 2015 at 11:44:18PM +0300, Stanislav Kholmanskikh wrote: > > This patch reduces (a little bit) the amount of compile time > > warnings. > > > > The change of WILC_WFI_init_mon_interface() prototype seems to be ok, > > because alloc_netdev() also expects 'const char *name'. > > You are doing different types of fixes here, please be explicit about > what you are doing and break this up into logical patches that each only > do one type of thing. Thank you for review. I've just sent an updated version which addresses your comments. Thanks. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 00/12] wilc1000: dead code removal and other cleanup
Hi Greg, Next try, I've rebased on top of your staging-testing branch and fixed the two build errors. While I had done my normal build testing on the driver (a few hundred randconfig builds), I don't normally do 'make clean', so the stale Makefile entry ended up picking the old object files and succeeding with that. Arnd Arnd Bergmann (12): staging: wilc1000: remove time wrapper staging: wilc1000: remove unused string functions staging: wilc1000: simplify msgqueue code staging: wilc1000: remove unused memory handling code staging: wilc1000: simplify semaphore wrapper staging: wilc1000: clean up sleep wrapper staging: wilc1000: clean up timer feature staging: wilc1000: remove unused OS abstraction features staging: wilc1000: remove EXPORT_SYMTAB staging: wilc1000: remove semaphore wrapper staging: wilc1000: fix const cast warnings staging: wilc1000: fix compiler warnings drivers/staging/wilc1000/Makefile | 6 +- drivers/staging/wilc1000/coreconfigurator.c | 29 +- drivers/staging/wilc1000/fifo_buffer.c| 108 +++ drivers/staging/wilc1000/fifo_buffer.h| 2 +- drivers/staging/wilc1000/host_interface.c | 203 ++--- drivers/staging/wilc1000/host_interface.h | 40 +-- drivers/staging/wilc1000/linux_mon.c | 2 +- drivers/staging/wilc1000/linux_wlan.c | 8 +- drivers/staging/wilc1000/linux_wlan_spi.c | 3 - drivers/staging/wilc1000/wilc_errorsupport.h | 17 -- drivers/staging/wilc1000/wilc_event.h | 123 drivers/staging/wilc1000/wilc_memory.c| 7 +- drivers/staging/wilc1000/wilc_memory.h| 95 +- drivers/staging/wilc1000/wilc_msgqueue.c | 41 +-- drivers/staging/wilc1000/wilc_msgqueue.h | 30 -- drivers/staging/wilc1000/wilc_osconfig.h | 28 -- drivers/staging/wilc1000/wilc_oswrapper.h | 42 --- drivers/staging/wilc1000/wilc_platform.h | 117 +--- drivers/staging/wilc1000/wilc_semaphore.c | 70 - drivers/staging/wilc1000/wilc_semaphore.h | 115 --- drivers/staging/wilc1000/wilc_sleep.c | 10 - drivers/staging/wilc1000/wilc_sleep.h | 30 +- drivers/staging/wilc1000/wilc_spi.c | 4 +- drivers/staging/wilc1000/wilc_strutils.c | 351 -- drivers/staging/wilc1000/wilc_strutils.h | 282 - drivers/staging/wilc1000/wilc_time.c | 163 -- drivers/staging/wilc1000/wilc_time.h | 205 - drivers/staging/wilc1000/wilc_timer.c | 6 - drivers/staging/wilc1000/wilc_timer.h | 27 -- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 47 +-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 4 +- drivers/staging/wilc1000/wilc_wlan.c | 6 +- 33 files changed, 213 insertions(+), 2010 deletions(-) delete mode 100644 drivers/staging/wilc1000/wilc_event.h delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.c delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.h delete mode 100644 drivers/staging/wilc1000/wilc_time.c delete mode 100644 drivers/staging/wilc1000/wilc_time.h -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/12] staging: wilc1000: remove EXPORT_SYMTAB
The EXPORT_SYMTAB symbol has not been used in Linux for a very long time, the driver does not need to set it. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 44551ee3c697..d8d8395cc4a6 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -10,7 +10,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ -DAP_FIRMWARE=\"atmel/wilc1000_ap_fw.bin\" \ -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" -ccflags-y += -I$(src)/ -DEXPORT_SYMTAB -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ +ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ -DPLL_WORKAROUND -DCONNECT_DIRECT -DAGING_ALG \ -DWILC_PARSE_SCAN_IN_HOST -DDISABLE_PWRSAVE_AND_SCAN_DURING_IP \ -Wno-unused-function -DUSE_WIRELESS -DWILC_DEBUGFS -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 03/12] staging: wilc1000: simplify msgqueue code
The driver contains an abstraction for message queues, with optional unused features, while the driver requires the main feature. This makes the msgqueue code unconditional as it's required but removes the unused parts. A later cleanup should remove the entire msgqueue code and replace it with some normal kernel API. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_msgqueue.c | 9 - drivers/staging/wilc1000/wilc_msgqueue.h | 30 -- drivers/staging/wilc1000/wilc_osconfig.h | 3 --- drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_platform.h | 12 5 files changed, 56 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index c1d0dabed479..1113092398d1 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -1,8 +1,6 @@ #include "wilc_oswrapper.h" #include -#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE - /*! * @authorsyounan @@ -154,11 +152,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); WILC_SemaphoreFillDefault(&strSemAttrs); - #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT - if (pstrAttrs != WILC_NULL) { - strSemAttrs.u32TimeOut = pstrAttrs->u32Timeout; - } - #endif s32RetStatus = WILC_SemaphoreAcquire(&(pHandle->hSem), &strSemAttrs); if (s32RetStatus == WILC_TIMEOUT) { /* timed out, just exit without consumeing the message */ @@ -207,5 +200,3 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, return s32RetStatus; } - -#endif diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index a48be533aad9..84157368335d 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -10,10 +10,6 @@ * @version 1.0 */ -#ifndef CONFIG_WILC_MSG_QUEUE_FEATURE -#error the feature CONFIG_WILC_MSG_QUEUE_FEATURE must be supported to include this file -#endif - /*! * @struct tstrWILC_MsgQueueAttrs * @brief Message Queue API options @@ -22,38 +18,12 @@ * @version 1.0 */ typedef struct { - #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME - WILC_Char *pcName; - #endif - - #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT - WILC_Uint32 u32Timeout; - #endif - /* a dummy member to avoid compiler errors*/ WILC_Uint8 dummy; } tstrWILC_MsgQueueAttrs; /*! - * @brief Fills the MsgQueueAttrs with default parameters - * @param[out]pstrAttrs structure to be filled - * @saWILC_TimerAttrs - * @authorsyounan - * @date 30 Aug 2010 - * @version 1.0 - */ -static void WILC_MsgQueueFillDefault(tstrWILC_MsgQueueAttrs *pstrAttrs) -{ - #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME - pstrAttrs->pcName = WILC_NULL; - #endif - - #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT - pstrAttrs->u32Timeout = WILC_OS_INFINITY; - #endif -} -/*! * @brief Creates a new Message queue * @details Creates a new Message queue, if the feature * CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index f18615e09400..d89864c7697c 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -20,9 +20,6 @@ /* #define CONFIG_WILC_MEMORY_POOLS 1 */ /* #define CONFIG_WILC_MEMORY_DEBUG 1 */ /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */ -#define CONFIG_WILC_MSG_QUEUE_FEATURE -/* #define CONFIG_WILC_MSG_QUEUE_IPC_NAME */ -/* #define CONFIG_WILC_MSG_QUEUE_TIMEOUT */ /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */ /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */ /* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */ diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index c4e97ae03ae0..8b4c3dced981 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -78,9 +78,7 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_strutils.h" /* Message Queue */ -#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE #include "wilc_msgqueue.h" -#endif /* File operations */ #ifdef CONFIG_WILC_FILE_OPERATIONS_FEATURE diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index b20bbb839e5a..2f6484989565 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -50,18 +50,6 @@ #error This feature is not supported by this OS #endif -/* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */ - -/* remove the following block when implementing i
[PATCH v2 07/12] staging: wilc1000: clean up timer feature
The driver has a simple wrapper around timer_list, and an optional but unused feature to make the timer periodic. This removes support for the periodic timer and simplifies the code around timers. A follow-up should replace the remaining wrapper with open-coded timers. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_osconfig.h | 2 -- drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_platform.h | 4 drivers/staging/wilc1000/wilc_timer.c | 6 -- drivers/staging/wilc1000/wilc_timer.h | 27 --- 5 files changed, 41 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index 6da42c837928..639160d1fa4e 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -11,8 +11,6 @@ /* OS features supported */ /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */ -#define CONFIG_WILC_TIMER_FEATURE 1 -/* #define CONFIG_WILC_TIMER_PERIODIC 1 */ /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */ /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */ /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */ diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 2af32fff84aa..be6393cba8c2 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -61,9 +61,7 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_sleep.h" /* Timer support */ -#ifdef CONFIG_WILC_TIMER_FEATURE #include "wilc_timer.h" -#endif /* Memory support */ #include "wilc_memory.h" diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index 2c66c3f3a2c5..d3f8fc6f2971 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -23,10 +23,6 @@ #endif*/ -/* CONFIG_WILC_TIMER_FEATURE is implemented */ - -/* CONFIG_WILC_TIMER_PERIODIC is implemented */ - /* remove the following block when implementing its feature */ #ifdef CONFIG_WILC_ASSERTION_SUPPORT #error This feature is not supported by this OS diff --git a/drivers/staging/wilc1000/wilc_timer.c b/drivers/staging/wilc1000/wilc_timer.c index 477986dcff0a..7d2e6f19c00b 100644 --- a/drivers/staging/wilc1000/wilc_timer.c +++ b/drivers/staging/wilc1000/wilc_timer.c @@ -1,10 +1,6 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_TIMER_FEATURE - - - WILC_ErrNo WILC_TimerCreate(WILC_TimerHandle *pHandle, tpfWILC_TimerFunction pfCallback, tstrWILC_TimerAttrs *pstrAttrs) { @@ -47,5 +43,3 @@ WILC_ErrNo WILC_TimerStop(WILC_TimerHandle *pHandle, return s32RetStatus; } - -#endif diff --git a/drivers/staging/wilc1000/wilc_timer.h b/drivers/staging/wilc1000/wilc_timer.h index 1080ce24a045..41c6784ab8e1 100644 --- a/drivers/staging/wilc1000/wilc_timer.h +++ b/drivers/staging/wilc1000/wilc_timer.h @@ -10,10 +10,6 @@ * @version 1.0 */ -#ifndef CONFIG_WILC_TIMER_FEATURE -#error the feature CONFIG_WILC_TIMER_FEATURE must be supported to include this file -#endif - typedef void (*tpfWILC_TimerFunction)(void *); /*! @@ -24,34 +20,11 @@ typedef void (*tpfWILC_TimerFunction)(void *); * @version 1.0 */ typedef struct { - /*!< if set to WILC_TRUE the callback function will be called -* periodically. */ - #ifdef CONFIG_WILC_TIMER_PERIODIC - WILC_Bool bPeriodicTimer; - #endif - /* a dummy member to avoid compiler errors*/ WILC_Uint8 dummy; } tstrWILC_TimerAttrs; /*! - * @brief Fills the WILC_TimerAttrs with default parameters - * @param[out]pstrAttrs structure to be filled - * @saWILC_TimerAttrs - * @authorsyounan - * @date 16 Aug 2010 - * @version 1.0 - */ - -static void WILC_TimerFillDefault(tstrWILC_TimerAttrs *pstrAttrs) -{ - #ifdef CONFIG_WILC_TIMER_PERIODIC - pstrAttrs->bPeriodicTimer = WILC_FALSE; - #endif -} - - -/*! * @brief Creates a new timer * @details Timers are a useful utility to execute some callback function * in the future. -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/12] staging: wilc1000: remove time wrapper
The abstraction for time in this driver is completely unused, so remove it. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/Makefile | 2 +- drivers/staging/wilc1000/wilc_osconfig.h | 1 - drivers/staging/wilc1000/wilc_oswrapper.h | 5 - drivers/staging/wilc1000/wilc_platform.h | 12 -- drivers/staging/wilc1000/wilc_time.c | 163 drivers/staging/wilc1000/wilc_time.h | 205 -- 6 files changed, 1 insertion(+), 387 deletions(-) delete mode 100644 drivers/staging/wilc1000/wilc_time.c delete mode 100644 drivers/staging/wilc1000/wilc_time.h diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 13e3ed8ef31e..44551ee3c697 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -27,7 +27,7 @@ ccflags-$(CONFIG_WILC1000_DYNAMICALLY_ALLOCATE_MEMROY) += -DWILC_NORMAL_ALLOC wilc1000-objs := wilc_wfi_netdevice.o wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ wilc_memory.o wilc_msgqueue.o wilc_semaphore.o wilc_sleep.o wilc_strutils.o \ - wilc_time.o wilc_timer.o coreconfigurator.o host_interface.o \ + wilc_timer.o coreconfigurator.o host_interface.o \ fifo_buffer.o wilc_sdio.o wilc_spi.o wilc_wlan_cfg.o wilc_debugfs.o wilc1000-$(CONFIG_WILC1000_SDIO) += linux_wlan_sdio.o diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index aa98ea5b423f..f3d3108de876 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -27,7 +27,6 @@ /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */ /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */ /* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */ -#define CONFIG_WILC_TIME_FEATURE /* #define CONFIG_WILC_EVENT_FEATURE */ /* #define CONFIG_WILC_EVENT_TIMEOUT */ /* #define CONFIG_WILC_SOCKET_FEATURE */ diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 03a1ecf90625..728ce7cac85a 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -89,11 +89,6 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_fileops.h" #endif -/* Time operations */ -#ifdef CONFIG_WILC_TIME_FEATURE -#include "wilc_time.h" -#endif - /* Event support */ #ifdef CONFIG_WILC_EVENT_FEATURE #include "wilc_event.h" diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index 87e4eedcc914..35d9f8a917ce 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -73,18 +73,6 @@ #error This feature is not supported by this OS #endif -/* CONFIG_WILC_TIME_FEATURE is implemented */ - -/* remove the following block when implementing its feature */ -#ifdef CONFIG_WILC_TIME_UTC_SINCE_1970 -#error This feature is not supported by this OS -#endif - -/* remove the following block when implementing its feature */ -#ifdef CONFIG_WILC_TIME_CALENDER -#error This feature is not supported by this OS -#endif - /* remove the following block when implementing its feature */ #ifdef CONFIG_WILC_EVENT_FEATURE #error This feature is not supported by this OS diff --git a/drivers/staging/wilc1000/wilc_time.c b/drivers/staging/wilc1000/wilc_time.c deleted file mode 100644 index 27c252b462ac.. --- a/drivers/staging/wilc1000/wilc_time.c +++ /dev/null @@ -1,163 +0,0 @@ - -#define _CRT_SECURE_NO_DEPRECATE -#include "wilc_oswrapper.h" - -#ifdef CONFIG_WILC_TIME_FEATURE - - -WILC_Uint32 WILC_TimeMsec(void) -{ - WILC_Uint32 u32Time = 0; - struct timespec current_time; - - current_time = current_kernel_time(); - u32Time = current_time.tv_sec * 1000; - u32Time += current_time.tv_nsec / 100; - - - return u32Time; -} - - -#ifdef CONFIG_WILC_EXTENDED_TIME_OPERATIONS - -/** - * @brief - * @detailsfunction returns the implementation's best approximation to the - * processor time used by the process since the beginning of an - * implementation-dependent time related only to the process invocation. - * @return WILC_Uint32 - * @note - * @authorremil - * @date 11 Nov 2010 - * @version 1.0 - */ -WILC_Uint32 WILC_Clock() -{ - -} - - -/** - * @brief - * @detailsThe difftime() function computes the difference between two calendar - * times (as returned by WILC_GetTime()): time1 - time0. - * @param[in] WILC_Time time1 - * @param[in] WILC_Time time0 - * @return WILC_Double - * @note - * @authorremil - * @date 11 Nov 2010 - * @version 1.0 - */ -WILC_Double WILC_DiffTime(WILC_Time time1, WILC_Time time0) -{ - -} - - - -/** - * @brief - * @detailsThe gm
[PATCH v2 11/12] staging: wilc1000: fix const cast warnings
The wilc1000 driver produces a lot of warnings about invalid casts between const and non-const variables. This reworks the code to avoid all those warnings, by marking variables and function arguments const. A lot of the types use WILC_Uint8, I change them to const u8 for style reasons, as I'm touching them anyway. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/host_interface.c | 32 --- drivers/staging/wilc1000/host_interface.h | 24 - drivers/staging/wilc1000/linux_mon.c | 2 +- drivers/staging/wilc1000/wilc_memory.c| 2 +- drivers/staging/wilc1000/wilc_memory.h| 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 - drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- 7 files changed, 39 insertions(+), 37 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8f7adc760500..6d9bd4983e90 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4912,8 +4912,8 @@ WILC_Sint32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const WILC_Ui * @date 8 March 2012 * @version 1.0 */ -WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC_Uint8 u8PtkKeylen, -const WILC_Uint8 *mac_addr, WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx) +WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, WILC_Uint8 u8PtkKeylen, +const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx) { WILC_Sint32 s32Error = WILC_SUCCESS; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; @@ -5014,9 +5014,9 @@ WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC * @date 8 March 2012 * @version 1.0 */ -WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen, - WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, WILC_Uint8 *KeyRSC, - WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode) +WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen, + WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, const u8 *KeyRSC, + const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode) { WILC_Sint32 s32Error = WILC_SUCCESS; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; @@ -5531,7 +5531,7 @@ WILC_Sint32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *p * @version 1.0 */ WILC_Sint32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8bssid, - WILC_Uint8 *pu8ssid, size_t ssidLen, + const u8 *pu8ssid, size_t ssidLen, const WILC_Uint8 *pu8IEs, size_t IEsLen, tWILCpfConnectResult pfConnectResult, void *pvUserArg, WILC_Uint8 u8security, AUTHTYPE_T tenuAuth_type, @@ -6090,7 +6090,7 @@ WILC_Sint32 host_int_test_set_int_wid(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32 * @date * @version 1.0 */ -WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *mac, WILC_Uint32 *pu32InactiveTime) +WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, WILC_Uint32 *pu32InactiveTime) { WILC_Sint32 s32Error = WILC_SUCCESS; tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; @@ -7364,10 +7364,11 @@ WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam WILC_memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam)); if (pstrAddStationMsg->u8NumRates > 0) { - pstrAddStationMsg->pu8Rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates); - WILC_NULLCHECK(s32Error, pstrAddStationMsg->pu8Rates); + u8 *rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates); + WILC_NULLCHECK(s32Error, rates); - WILC_memcpy(pstrAddStationMsg->pu8Rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates); + WILC_memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates); + pstrAddStationMsg->pu8Rates = rates; } @@ -7391,7 +7392,7 @@ WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam * @date * @version 1.0 */ -WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8MacAddr) +WILC_Sint32 host_int_del_station(
[PATCH v2 06/12] staging: wilc1000: clean up sleep wrapper
The driver has a simple wrapper around msleep, as well as a more advanced sleep function that is unused. This removes the unused code and the options to turn the feature on or off. A follow-up should rework the code to use msleep directly. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_osconfig.h | 2 -- drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_platform.h | 6 -- drivers/staging/wilc1000/wilc_sleep.c | 10 -- drivers/staging/wilc1000/wilc_sleep.h | 30 +- 5 files changed, 1 insertion(+), 49 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index d0bf08f89906..6da42c837928 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -11,8 +11,6 @@ /* OS features supported */ /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */ -#define CONFIG_WILC_SLEEP_FEATURE 1 -#define CONFIG_WILC_SLEEP_HI_RES 1 #define CONFIG_WILC_TIMER_FEATURE 1 /* #define CONFIG_WILC_TIMER_PERIODIC 1 */ /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */ diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 32fe48a6034b..2af32fff84aa 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -58,9 +58,7 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_semaphore.h" /* Sleep support */ -#ifdef CONFIG_WILC_SLEEP_FEATURE #include "wilc_sleep.h" -#endif /* Timer support */ #ifdef CONFIG_WILC_TIMER_FEATURE diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index 36e2e707354b..2c66c3f3a2c5 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -22,12 +22,6 @@ * #error This feature is not supported by this OS #endif*/ -/* CONFIG_WILC_SLEEP_FEATURE is implemented */ - -/* remove the following block when implementing its feature */ -/* #ifdef CONFIG_WILC_SLEEP_HI_RES */ -/* #error This feature is not supported by this OS */ -/* #endif */ /* CONFIG_WILC_TIMER_FEATURE is implemented */ diff --git a/drivers/staging/wilc1000/wilc_sleep.c b/drivers/staging/wilc1000/wilc_sleep.c index b8f45146956b..98a079f3d6c9 100644 --- a/drivers/staging/wilc1000/wilc_sleep.c +++ b/drivers/staging/wilc1000/wilc_sleep.c @@ -1,8 +1,6 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_SLEEP_FEATURE - /* * @authormdaftedar * @date 10 Aug 2010 @@ -18,11 +16,3 @@ void WILC_Sleep(WILC_Uint32 u32TimeMilliSec) } } -#endif - -/* #ifdef CONFIG_WILC_SLEEP_HI_RES */ -void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec) -{ - usleep_range(u32TimeMicoSec, u32TimeMicoSec); -} -/* #endif */ diff --git a/drivers/staging/wilc1000/wilc_sleep.h b/drivers/staging/wilc1000/wilc_sleep.h index d640fb553aca..2865c8e44346 100644 --- a/drivers/staging/wilc1000/wilc_sleep.h +++ b/drivers/staging/wilc1000/wilc_sleep.h @@ -2,19 +2,6 @@ #define __WILC_SLEEP_H__ /*! - * @file wilc_sleep.h - * @brief Sleep OS Wrapper functionality - * @authorsyounan - * @sawilc_oswrapper.h top level OS wrapper file - * @date 10 Aug 2010 - * @version 1.0 - */ - -#ifndef CONFIG_WILC_SLEEP_FEATURE -#error the feature WILC_OS_FEATURE_SLEEP must be supported to include this file -#endif - -/*! * @brief forces the current thread to sleep until the given time has elapsed * @param[in] u32TimeMilliSec Time to sleep in Milli seconds * @saWILC_SleepMicrosec @@ -24,22 +11,7 @@ * @note This function offers a relatively innacurate and low resolution * sleep, for accurate high resolution sleep use u32TimeMicoSec */ +/* TODO: remove and open-code in callers */ void WILC_Sleep(WILC_Uint32 u32TimeMilliSec); -#ifdef CONFIG_WILC_SLEEP_HI_RES -/*! - * @brief forces the current thread to sleep until the given time has elapsed - * @param[in] u32TimeMicoSec Time to sleep in Micro seconds - * @saWILC_Sleep - * @authorsyounan - * @date 10 Aug 2010 - * @version 1.0 - * @note This function offers an acurare high resolution sleep, depends on - * the feature WILC_OS_FEATURE_SLEEP_HI_RES and may not be supported - * on all Operating Systems - */ -void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec); -#endif - - #endif -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 08/12] staging: wilc1000: remove unused OS abstraction features
All the remaining features from the OS abstraction layer are not used at all in the driver, so we can just remove the remaining references to them. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_errorsupport.h | 17 drivers/staging/wilc1000/wilc_event.h| 123 --- drivers/staging/wilc1000/wilc_osconfig.h | 14 --- drivers/staging/wilc1000/wilc_oswrapper.h| 22 - drivers/staging/wilc1000/wilc_platform.h | 62 -- 5 files changed, 238 deletions(-) delete mode 100644 drivers/staging/wilc1000/wilc_event.h diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h index 6405ef8ad431..4da657d17020 100644 --- a/drivers/staging/wilc1000/wilc_errorsupport.h +++ b/drivers/staging/wilc1000/wilc_errorsupport.h @@ -64,21 +64,4 @@ typedef WILC_Sint32 WILC_ErrNo; ERRORHANDLER: \ if (WILC_IS_ERR(__status__)) \ -#ifdef CONFIG_WILC_ASSERTION_SUPPORT - -/** - * @brief prints a diagnostic message and aborts the program - * @param[in] pcExpression The expression that triggered the assertion - * @param[in] pcFileName The name of the current source file. - * @param[in] u32LineNumber The line number in the current source file. - * @warning DO NOT CALL DIRECTLY. USE EQUIVALENT MACRO FUNCTION INSTEAD. - */ -void WILC_assert_INTERNAL(WILC_Char *pcExpression, WILC_Char *pcFileName, WILC_Uint32 u32LineNumber); - -#define WILC_assert(__expression__) (void)(!!(__expression__) || (WILC_assert_INTERNAL((# __expression__), __WILC_FILE__, __WILC_LINE__), 0)) - -#else -#define WILC_assert(__expression__) ((void)0) -#endif - #endif diff --git a/drivers/staging/wilc1000/wilc_event.h b/drivers/staging/wilc1000/wilc_event.h deleted file mode 100644 index 94e0f7c0bed5.. --- a/drivers/staging/wilc1000/wilc_event.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __WILC_EVENT_H__ -#define __WILC_EVENT_H__ - -/*! - * @file wilc_event.h - * @brief Event OS wrapper functionality - * @authorsyounan - * @sawilc_oswrapper.h top level OS wrapper file - * @date 10 Oct 2010 - * @version 1.0 - */ - -#ifndef CONFIG_WILC_EVENT_FEATURE -#error the feature CONFIG_WILC_EVENT_FEATURE must be supported to include this file -#endif - - -/*! - * @struct tstrWILC_TimerAttrs - * @brief Timer API options - * @authorsyounan - * @date 10 Oct 2010 - * @version 1.0 - */ -typedef struct { - /* a dummy member to avoid compiler errors*/ - WILC_Uint8 dummy; - - #ifdef CONFIG_WILC_EVENT_TIMEOUT - /*!< -* Timeout for use with WILC_EventWait, 0 to return immediately and -* WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY -*/ - WILC_Uint32 u32TimeOut; - #endif - -} tstrWILC_EventAttrs; - -/*! - * @brief Fills the WILC_TimerAttrs with default parameters - * @param[out]pstrAttrs structure to be filled - * @saWILC_TimerAttrs - * @authorsyounan - * @date 10 Oct 2010 - * @version 1.0 - */ -static void WILC_EventFillDefault(tstrWILC_EventAttrs *pstrAttrs) -{ - #ifdef CONFIG_WILC_EVENT_TIMEOUT - pstrAttrs->u32TimeOut = WILC_OS_INFINITY; - #endif -} - -/*! - * @brief Creates a new Event - * @details the Event is an object that allows a thread to wait until an external - * event occuers, Event objects have 2 states, either TRIGGERED or - * UNTRIGGERED - * @param[out]pHandle handle to the newly created event object - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure - * @satstrWILC_EventAttrs - * @authorsyounan - * @date 10 Oct 2010 - * @version 1.0 - */ -WILC_ErrNo WILC_EventCreate(WILC_EventHandle *pHandle, tstrWILC_EventAttrs *pstrAttrs); - - -/*! - * @brief Destroys a given event - * @details This will destroy a given event freeing any resources used by it - * if there are any thread blocked by the WILC_EventWait call the the - * behaviour is undefined - * @param[in] pHandle handle to the event object - * @param[in] pstrAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure - * @satstrWILC_EventAttrs - * @authorsyounan - * @date 10 Oct 2010 - * @version 1.0 - */ -WILC_ErrNo WILC_EventDestroy(WILC_EventHandle *pHandle, -tstrWILC_EventAttrs *pstrAttrs); - -/*! - * @brief Triggers a given event - * @details This function will set the given event into the TRIGGERED state, - * if the event is already in TRIGGERED, this function will have no - * effect - * @param[in] pHandle handle to the event object - * @param[in] pstrAttrs Optional attributes, NULL
[PATCH v2 12/12] staging: wilc1000: fix compiler warnings
This avoids the remaining warnings that one gets on a normal build: unused variables, unused labels, and invalid printk format strings. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/linux_wlan.c | 8 ++-- drivers/staging/wilc1000/linux_wlan_spi.c | 3 --- drivers/staging/wilc1000/wilc_spi.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.c | 6 ++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 2a74441af09e..46c7e4f3471d 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1025,7 +1025,6 @@ int repeat_power_cycle(perInterface_wlan_t *nic); static int linux_wlan_start_firmware(perInterface_wlan_t *nic) { - static int timeout = 5; int ret = 0; /* start firmware */ PRINT_D(INIT_DBG, "Starting Firmware ...\n"); @@ -1040,6 +1039,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic) ret = linux_wlan_lock_timeout(&g_linux_wlan->sync_event, 5000); if (ret) { #ifdef COMPLEMENT_BOOT + static int timeout = 5; if (timeout--) { PRINT_D(INIT_DBG, "repeat power cycle[%d]", timeout); @@ -1675,7 +1675,9 @@ _fail_2: linux_wlan_unlock(&g_linux_wlan->rxq_event); kthread_stop(g_linux_wlan->rxq_thread); +#ifndef TCP_ENHANCEMENTS _fail_1: +#endif #if (RX_BH_TYPE == RX_BH_KTHREAD) /*De-Initialize 1st thread*/ g_linux_wlan->close = 1; @@ -1999,8 +2001,8 @@ _fail_fw_start_: _fail_irq_enable_: #if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO) disable_sdio_interrupt(); -#endif _fail_irq_init_: +#endif #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO) deinit_irq(g_linux_wlan); @@ -2522,8 +2524,10 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset) int stats; unsigned char *buff_to_send = NULL; struct sk_buff *skb; +#ifndef TCP_ENHANCEMENTS char *pu8UdpBuffer; struct iphdr *ih; +#endif struct net_device *wilc_netdev; perInterface_wlan_t *nic; diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c index 0c30bbb5fa65..e5d794590f00 100644 --- a/drivers/staging/wilc1000/linux_wlan_spi.c +++ b/drivers/staging/wilc1000/linux_wlan_spi.c @@ -102,9 +102,6 @@ int linux_spi_init(void *vp) if (called == 0) { called++; - if (&wilc_bus == NULL) { - PRINT_ER("wilc_bus address is NULL\n"); - } ret = spi_register_driver(&wilc_bus); } diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 2f38ddabc654..d0e761080ca5 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -1194,10 +1194,10 @@ static int spi_init(wilc_wlan_inp_t *inp, wilc_debug_func func) /* Read failed. Try with CRC off. This might happen when module * is removed but chip isn't reset*/ g_spi.crc_off = 1; - PRINT_ER("[wilc spi]: Failed internal read protocol with CRC on, retyring with CRC off...\n", __LINE__); + PRINT_ER("[wilc spi]: Failed internal read protocol with CRC on, retyring with CRC off...\n"); if (!spi_internal_read(WILC_SPI_PROTOCOL_OFFSET, ®)) { /* Reaad failed with both CRC on and off, something went bad */ - PRINT_ER("[wilc spi]: Failed internal read protocol...\n", __LINE__); + PRINT_ER("[wilc spi]: Failed internal read protocol...\n"); return 0; } } diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 92ed42ad49ac..badc8743dd1a 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -894,8 +894,6 @@ INLINE void chip_wakeup(void) #endif void chip_sleep_manually(WILC_Uint32 u32SleepTime) { - uint32_t val32; - if (genuChipPSstate != CHIP_WAKEDUP) { /* chip is already sleeping. Do nothing */ return; @@ -2302,7 +2300,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) #else g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size); #endif - PRINT_D(TX_DBG, "g_wlan.tx_buffer = 0x%x\n", g_wlan.tx_buffer); + PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer); if (g_wlan.tx_buffer == WILC_NULL) { /* ENOBUFS 105 */ @@ -2319,7 +2317,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) #else g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size); #endif - PRINT_D(TX_DBG, "g_wlan
[PATCH v2 04/12] staging: wilc1000: remove unused memory handling code
The driver contains its own abstraction for memory allocation, most of it unused. This removes the unused parts, but the rest should also be removed later. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_memory.c| 5 -- drivers/staging/wilc1000/wilc_memory.h| 93 --- drivers/staging/wilc1000/wilc_osconfig.h | 3 - drivers/staging/wilc1000/wilc_oswrapper.h | 2 - drivers/staging/wilc1000/wilc_platform.h | 13 - 5 files changed, 116 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_memory.c b/drivers/staging/wilc1000/wilc_memory.c index cf0976b443b8..fbba38da19bc 100644 --- a/drivers/staging/wilc1000/wilc_memory.c +++ b/drivers/staging/wilc1000/wilc_memory.c @@ -1,9 +1,6 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_MEMORY_FEATURE - - /*! * @authorsyounan * @date 18 Aug 2010 @@ -59,5 +56,3 @@ void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs, { kfree(pvBlock); } - -#endif diff --git a/drivers/staging/wilc1000/wilc_memory.h b/drivers/staging/wilc1000/wilc_memory.h index 1e45641af454..012f03cae0c8 100644 --- a/drivers/staging/wilc1000/wilc_memory.h +++ b/drivers/staging/wilc1000/wilc_memory.h @@ -10,10 +10,6 @@ * @version 1.0 */ -#ifndef CONFIG_WILC_MEMORY_FEATURE -#error the feature CONFIG_WILC_MEMORY_FEATURE must be supported to include this file -#endif - /*! * @struct tstrWILC_MemoryAttrs * @brief Memory API options @@ -22,33 +18,9 @@ * @version 1.0 */ typedef struct { - #ifdef CONFIG_WILC_MEMORY_POOLS - /*!< the allocation pool to use for this memory, NULL for system -* allocation. Default is NULL -*/ - WILC_MemoryPoolHandle *pAllocationPool; - #endif - - /* a dummy member to avoid compiler errors*/ - WILC_Uint8 dummy; } tstrWILC_MemoryAttrs; /*! - * @brief Fills the tstrWILC_MemoryAttrs with default parameters - * @param[out]pstrAttrs structure to be filled - * @satstrWILC_MemoryAttrs - * @authorsyounan - * @date 16 Aug 2010 - * @version 1.0 - */ -static void WILC_MemoryFillDefault(tstrWILC_MemoryAttrs *pstrAttrs) -{ - #ifdef CONFIG_WILC_MEMORY_POOLS - pstrAttrs->pAllocationPool = WILC_NULL; - #endif -} - -/*! * @brief Allocates a given size of bytes * @param[in] u32Size size of memory in bytes to be allocated * @param[in] strAttrs Optional attributes, NULL for default @@ -145,69 +117,6 @@ void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs, WILC_Char *pcFileName, WILC_Uint32 u32LineNo); /*! - * @brief Creates a new memory pool - * @param[out]pHandle the handle to the new Pool - * @param[in] u32PoolSize The pool size in bytes - * @param[in] strAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure - * @sasttrWILC_MemoryAttrs - * @authorsyounan - * @date 16 Aug 2010 - * @version 1.0 - */ -WILC_ErrNo WILC_MemoryNewPool(WILC_MemoryPoolHandle *pHandle, WILC_Uint32 u32PoolSize, - tstrWILC_MemoryAttrs *strAttrs); - -/*! - * @brief Deletes a memory pool, freeing all memory allocated from it as well - * @param[in] pHandle the handle to the deleted Pool - * @param[in] strAttrs Optional attributes, NULL for default - * @returnError code indicating sucess/failure - * @sasttrWILC_MemoryAttrs - * @authorsyounan - * @date 16 Aug 2010 - * @version 1.0 - */ -WILC_ErrNo WILC_MemoryDelPool(WILC_MemoryPoolHandle *pHandle, tstrWILC_MemoryAttrs *strAttrs); - - -#ifdef CONFIG_WILC_MEMORY_DEBUG - -/*! - * @brief standrad malloc wrapper with custom attributes - */ - #define WILC_MALLOC_EX(__size__, __attrs__) \ - (WILC_MemoryAlloc( \ -(__size__), __attrs__, \ -(WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__)) - -/*! - * @brief standrad calloc wrapper with custom attributes - */ - #define WILC_CALLOC_EX(__size__, __attrs__) \ - (WILC_MemoryCalloc( \ -(__size__), __attrs__, \ -(WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__)) - -/*! - * @brief standrad realloc wrapper with custom attributes - */ - #define WILC_REALLOC_EX(__ptr__, __new_size__, __attrs__) \ - (WILC_MemoryRealloc( \ -(__ptr__), (__new_size__), __attrs__, \ -(WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__)) - -/*! - * @brief standrad free wrapper with custom attributes - */ - #define WILC_FREE_EX(__ptr__, __attrs__) \ - (WILC_MemoryFree( \ -(__ptr__), __attrs__, \ -(WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__)) - -#else - -/*! * @brief standrad malloc wrapper with custom attributes */ #define WILC_MALLOC_EX(__size__
[PATCH v2 02/12] staging: wilc1000: remove unused string functions
The driver provides wrappers for a lot of string operations. Some of them are unused, while others should be replaced with normal kernel functions. This replaces the unused ones for now, and leaves the other ones for a later cleanup. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_osconfig.h | 2 - drivers/staging/wilc1000/wilc_oswrapper.h | 2 - drivers/staging/wilc1000/wilc_platform.h | 4 - drivers/staging/wilc1000/wilc_strutils.c | 351 -- drivers/staging/wilc1000/wilc_strutils.h | 282 5 files changed, 641 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index f3d3108de876..f18615e09400 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -20,7 +20,6 @@ /* #define CONFIG_WILC_MEMORY_POOLS 1 */ /* #define CONFIG_WILC_MEMORY_DEBUG 1 */ /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */ -#define CONFIG_WILC_STRING_UTILS 1 #define CONFIG_WILC_MSG_QUEUE_FEATURE /* #define CONFIG_WILC_MSG_QUEUE_IPC_NAME */ /* #define CONFIG_WILC_MSG_QUEUE_TIMEOUT */ @@ -32,5 +31,4 @@ /* #define CONFIG_WILC_SOCKET_FEATURE */ /* #define CONFIG_WILC_MATH_OPERATIONS_FEATURE */ /* #define CONFIG_WILC_EXTENDED_FILE_OPERATIONS */ -/* #define CONFIG_WILC_EXTENDED_STRING_OPERATIONS */ /* #define CONFIG_WILC_EXTENDED_TIME_OPERATIONS */ diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 728ce7cac85a..c4e97ae03ae0 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -75,9 +75,7 @@ typedef WILC_Uint16 WILC_WideChar; #endif /* String Utilities */ -#ifdef CONFIG_WILC_STRING_UTILS #include "wilc_strutils.h" -#endif /* Message Queue */ #ifdef CONFIG_WILC_MSG_QUEUE_FEATURE diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index 35d9f8a917ce..b20bbb839e5a 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -50,8 +50,6 @@ #error This feature is not supported by this OS #endif -/* CONFIG_WILC_STRING_UTILS is implemented */ - /* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */ /* remove the following block when implementing its feature */ @@ -87,8 +85,6 @@ /* CONFIG_WILC_EXTENDED_FILE_OPERATIONS is implemented */ -/* CONFIG_WILC_EXTENDED_STRING_OPERATIONS is implemented */ - /* CONFIG_WILC_EXTENDED_TIME_OPERATIONS is implemented */ /* remove the following block when implementing its feature */ diff --git a/drivers/staging/wilc1000/wilc_strutils.c b/drivers/staging/wilc1000/wilc_strutils.c index 9e525d56feb8..f452fc57f71d 100644 --- a/drivers/staging/wilc1000/wilc_strutils.c +++ b/drivers/staging/wilc1000/wilc_strutils.c @@ -3,8 +3,6 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_STRING_UTILS - /*! * @authorsyounan @@ -42,50 +40,12 @@ void *WILC_memset(void *pvTarget, WILC_Uint8 u8SetValue, WILC_Uint32 u32Count) * @date 18 Aug 2010 * @version 1.0 */ -WILC_Char *WILC_strncat(WILC_Char *pcTarget, const WILC_Char *pcSource, - WILC_Uint32 u32Count) -{ - return strncat(pcTarget, pcSource, u32Count); -} - -/*! - * @authorsyounan - * @date 18 Aug 2010 - * @version 1.0 - */ WILC_Char *WILC_strncpy(WILC_Char *pcTarget, const WILC_Char *pcSource, WILC_Uint32 u32Count) { return strncpy(pcTarget, pcSource, u32Count); } -/*! - * @authorsyounan - * @date 18 Aug 2010 - * @version 1.0 - */ -WILC_Sint32 WILC_strcmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2) -{ - WILC_Sint32 s32Result; - - if (pcStr1 == WILC_NULL && pcStr2 == WILC_NULL) { - s32Result = 0; - } else if (pcStr1 == WILC_NULL){ - s32Result = -1; - } else if (pcStr2 == WILC_NULL){ - s32Result = 1; - } else { - s32Result = strcmp(pcStr1, pcStr2); - if (s32Result < 0) { - s32Result = -1; - } else if (s32Result > 0){ - s32Result = 1; - } - } - - return s32Result; -} - WILC_Sint32 WILC_strncmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2, WILC_Uint32 u32Count) { @@ -109,108 +69,6 @@ WILC_Sint32 WILC_strncmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2, return s32Result; } -/* - * @authorsyounan - * @date 1 Nov 2010 - * @version 2.0 - */ -WILC_Sint32 WILC_strcmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pcStr2) -{ - WILC_Sint32 s32Result; - - if (pcStr1 == WILC_NULL && pcStr2 == WILC_NULL) { - s32Result = 0; - } else if (pcStr1 == WILC_NULL){ - s32Result = -1; - } else if (pcStr2 == WILC_NULL){ - s32Result = 1; -
[PATCH v2 05/12] staging: wilc1000: simplify semaphore wrapper
The driver has its own API for semaphores. This should be replaced with mutexes and completions, but for the moment we can start by removing the obviously unused parts. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_osconfig.h | 1 - drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_semaphore.c | 14 -- drivers/staging/wilc1000/wilc_semaphore.h | 18 +- 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index eec93b351f14..d0bf08f89906 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -10,7 +10,6 @@ /* OS features supported */ -#define CONFIG_WILC_SEMAPHORE_FEATURE 1 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */ #define CONFIG_WILC_SLEEP_FEATURE 1 #define CONFIG_WILC_SLEEP_HI_RES 1 diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index fd5dd3c6316e..32fe48a6034b 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -55,9 +55,7 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_errorsupport.h" /* Semaphore support */ -#ifdef CONFIG_WILC_SEMAPHORE_FEATURE #include "wilc_semaphore.h" -#endif /* Sleep support */ #ifdef CONFIG_WILC_SLEEP_FEATURE diff --git a/drivers/staging/wilc1000/wilc_semaphore.c b/drivers/staging/wilc1000/wilc_semaphore.c index 637107bfb877..f09a88ca6ae4 100644 --- a/drivers/staging/wilc1000/wilc_semaphore.c +++ b/drivers/staging/wilc1000/wilc_semaphore.c @@ -1,7 +1,5 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_SEMAPHORE_FEATURE - WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle, tstrWILC_SemaphoreAttrs *pstrAttrs) @@ -33,19 +31,9 @@ WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle, { WILC_ErrNo s32RetStatus = WILC_SUCCESS; - #ifndef CONFIG_WILC_SEMAPHORE_TIMEOUT while (down_interruptible(pHandle)) ; - #else - if (pstrAttrs == WILC_NULL) { - down(pHandle); - } else { - - s32RetStatus = down_timeout(pHandle, msecs_to_jiffies(pstrAttrs->u32TimeOut)); - } - #endif - if (s32RetStatus == 0) { return WILC_SUCCESS; } else if (s32RetStatus == -ETIME) { @@ -66,5 +54,3 @@ WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle, return WILC_SUCCESS; } - -#endif diff --git a/drivers/staging/wilc1000/wilc_semaphore.h b/drivers/staging/wilc1000/wilc_semaphore.h index 3006f9f20c4d..3c0ecc326fb3 100644 --- a/drivers/staging/wilc1000/wilc_semaphore.h +++ b/drivers/staging/wilc1000/wilc_semaphore.h @@ -10,11 +10,6 @@ * @version 1.0 */ - -#ifndef CONFIG_WILC_SEMAPHORE_FEATURE -#error the feature WILC_OS_FEATURE_SEMAPHORE must be supported to include this file -#endif - /*! * @struct WILC_SemaphoreAttrs * @brief Semaphore API options @@ -28,14 +23,6 @@ typedef struct { */ WILC_Uint32 u32InitCount; - #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT - /*!< -* Timeout for use with WILC_SemaphoreAcquire, 0 to return immediately and -* WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY -*/ - WILC_Uint32 u32TimeOut; - #endif - } tstrWILC_SemaphoreAttrs; @@ -47,12 +34,9 @@ typedef struct { * @date 10 Aug 2010 * @version 1.0 */ -static void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs) +static inline void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs) { pstrAttrs->u32InitCount = 1; - #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT - pstrAttrs->u32TimeOut = WILC_OS_INFINITY; - #endif } /*! * @brief Creates a new Semaphore object -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/16] staging: wilc1000: remove time wrapper
On Sunday 31 May 2015 08:58:13 Greg KH wrote: > On Sat, May 30, 2015 at 12:09:23PM +0530, Sudip Mukherjee wrote: > > On Fri, May 29, 2015 at 10:52:16PM +0200, Arnd Bergmann wrote: > > > The abstraction for time in this driver is completely > > > unused, so remove it. > > > > > > Signed-off-by: Arnd Bergmann > > > --- > > > drivers/staging/wilc1000/wilc_osconfig.h | 1 - > > > drivers/staging/wilc1000/wilc_oswrapper.h | 5 - > > > drivers/staging/wilc1000/wilc_platform.h | 12 -- > > > drivers/staging/wilc1000/wilc_time.c | 163 > > > drivers/staging/wilc1000/wilc_time.h | 205 > > > -- > > > 5 files changed, 386 deletions(-) > > > delete mode 100644 drivers/staging/wilc1000/wilc_time.c > > > delete mode 100644 drivers/staging/wilc1000/wilc_time.h > > after this patch I am getting: > > "WARNING: could not open drivers/staging/wilc1000/wilc_time.c: No such file > > or directory" > > > > wilc_time is mentioned in the Makefile, it should have been removed from > > there also. > > Ick, not good. Sorry about that. I had actually made the same mistake before and fixed it up, but the introduced the bug again and didn't find it during my build testing because 'make' kept picking up the old object files. > Arnd, I've applied the first 4 patches, but stopped here, can you respin > the rest and resend? Done. Arnd ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 10/12] staging: wilc1000: remove semaphore wrapper
The various semaphore functions all directly translate into sema_init(), down() and up(), so we can just remove the API. This is a mostly automated conversion using simple sed scripts, plus some manual changes to account for down() returning no error. As a positive side-effect, down() no longer hangs after receiving a signal, as the original code did by looping around down_interruptible. The semaphores still need to be turned into mutexes as a follow-up step. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/Makefile | 2 +- drivers/staging/wilc1000/coreconfigurator.c | 29 +--- drivers/staging/wilc1000/fifo_buffer.c| 108 +++--- drivers/staging/wilc1000/fifo_buffer.h| 2 +- drivers/staging/wilc1000/host_interface.c | 171 +- drivers/staging/wilc1000/host_interface.h | 16 +- drivers/staging/wilc1000/wilc_msgqueue.c | 32 ++-- drivers/staging/wilc1000/wilc_oswrapper.h | 3 - drivers/staging/wilc1000/wilc_platform.h | 4 +- drivers/staging/wilc1000/wilc_semaphore.c | 56 --- drivers/staging/wilc1000/wilc_semaphore.h | 99 - drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 35 ++--- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 4 +- 13 files changed, 161 insertions(+), 400 deletions(-) delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.c delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.h diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index d8d8395cc4a6..a78c4d529a58 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -26,7 +26,7 @@ ccflags-$(CONFIG_WILC1000_DYNAMICALLY_ALLOCATE_MEMROY) += -DWILC_NORMAL_ALLOC wilc1000-objs := wilc_wfi_netdevice.o wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ - wilc_memory.o wilc_msgqueue.o wilc_semaphore.o wilc_sleep.o wilc_strutils.o \ + wilc_memory.o wilc_msgqueue.o wilc_sleep.o wilc_strutils.o \ wilc_timer.o coreconfigurator.o host_interface.o \ fifo_buffer.o wilc_sdio.o wilc_spi.o wilc_wlan_cfg.o wilc_debugfs.o diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index d5a076ed2426..bf444825711f 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -164,8 +164,8 @@ extern void host_int_ScanCompleteReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32 /*/ /* Global Variables */ /*/ -static WILC_SemaphoreHandle SemHandleSendPkt; -static WILC_SemaphoreHandle SemHandlePktResp; +static struct semaphore SemHandleSendPkt; +static struct semaphore SemHandlePktResp; static WILC_Sint8 *gps8ConfigPacket; @@ -672,18 +672,10 @@ INLINE WILC_Uint16 get_asoc_id(WILC_Uint8 *data) WILC_Sint32 CoreConfiguratorInit(void) { WILC_Sint32 s32Error = WILC_SUCCESS; - tstrWILC_SemaphoreAttrs strSemSendPktAttrs; - tstrWILC_SemaphoreAttrs strSemPktRespAttrs; - PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit() \n"); - WILC_SemaphoreFillDefault(&strSemSendPktAttrs); - strSemSendPktAttrs.u32InitCount = 1; - WILC_SemaphoreCreate(&SemHandleSendPkt, &strSemSendPktAttrs); - - WILC_SemaphoreFillDefault(&strSemPktRespAttrs); - strSemPktRespAttrs.u32InitCount = 0; - WILC_SemaphoreCreate(&SemHandlePktResp, &strSemPktRespAttrs); + sema_init(&SemHandleSendPkt, 1); + sema_init(&SemHandlePktResp, 0); gps8ConfigPacket = (WILC_Sint8 *)WILC_MALLOC(MAX_PACKET_BUFF_SIZE); if (gps8ConfigPacket == NULL) { @@ -1931,7 +1923,7 @@ WILC_Sint32 ConfigWaitResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32MaxRespBu if (gstrConfigPktInfo.bRespRequired == WILC_TRUE) { - WILC_SemaphoreAcquire(&SemHandlePktResp, WILC_NULL); + down(&SemHandlePktResp); *ps32BytesRead = gstrConfigPktInfo.s32BytesRead; } @@ -1964,7 +1956,7 @@ WILC_Sint32 SendConfigPkt(WILC_Uint8 u8Mode, tstrWID *pstrWIDs, WILC_Sint32 s32ConfigPacketLen = 0; WILC_Sint32 s32RcvdRespLen = 0; - WILC_SemaphoreAcquire(&SemHandleSendPkt, WILC_NULL); + down(&SemHandleSendPkt); /*set the packet mode*/ g_oper_mode = u8Mode; @@ -2019,7 +2011,7 @@ WILC_Sint32 SendConfigPkt(WILC_Uint8 u8Mode, tstrWID *pstrWIDs, End_ConfigPkt: - WILC_SemaphoreRelease(&SemHandleSendPkt, WILC_NULL); + up(&SemHandleSendPkt); return s32Error; } @@ -2038,7 +2030,7 @@ WILC_Sint32 ConfigProvideResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32RespLe
RE: [PATCH 1/6] scsi: storvsc: Rather than look for sets of specific protocol versions, make decisions based on ranges.
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, June 1, 2015 3:57 AM > To: KY Srinivasan > Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; oher...@suse.com; > jbottom...@parallels.com; h...@infradead.org; linux-s...@vger.kernel.org; > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com; Keith > Mange > Subject: Re: [PATCH 1/6] scsi: storvsc: Rather than look for sets of specific > protocol versions, make decisions based on ranges. > > On Fri, May 29, 2015 at 01:29:14PM -0700, K. Y. Srinivasan wrote: > > From: keith.ma...@microsoft.com > > Keith's name is wrong. Thanks Dan; I will fix this and resend. K. Y > > regards, > dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 3/6] hv:scsi:Untangle the storage protocol negotiation from the vmbus protocol negotiation.
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, June 1, 2015 3:43 AM > To: KY Srinivasan > Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; oher...@suse.com; > jbottom...@parallels.com; h...@infradead.org; linux-s...@vger.kernel.org; > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com; Keith > Mange > Subject: Re: [PATCH 3/6] hv:scsi:Untangle the storage protocol negotiation > from the vmbus protocol negotiation. > > On Fri, May 29, 2015 at 01:29:16PM -0700, K. Y. Srinivasan wrote: > > - if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO > || > > - vstor_packet->status != 0) > > + if (vstor_packet->status != 0) { > > + ret = -EINVAL; > > goto cleanup; > > + } > > There is not actually any cleanup, goto cleanup is just a do-nothing > goto. > > In the original code, we returned success here. That always looked like > a "forgot to set the error code" bug to me, but do-nothing labels always > introduce ambiguous looking "forgot to set the error code" bugs so I can > never be positive. > > Could you take a look at the other "goto cleanup;" places in this > function and maybe add a comment, change it to something more clear like > "return 0;" or fix the error code? Thanks Dan; will do. K. Y > > regards, > dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
staging: wilc1000: update TODO list
I have crossed off one item on the list, but found a few others that should not get lost, so here is an update of the wilc1000 list Signed-off-by: Arnd Bergmann diff --git a/drivers/staging/wilc1000/TODO b/drivers/staging/wilc1000/TODO index 5dfeb3eda599..95199d80a3e4 100644 --- a/drivers/staging/wilc1000/TODO +++ b/drivers/staging/wilc1000/TODO @@ -3,6 +3,12 @@ TODO: - remove OS wrapper functions - remove custom debug and tracing functions - rework comments and function headers(also coding style) -- remove build warnings +- replace all semaphores with mutexes or completions +- make spi and sdio components coexist in one build +- turn compile-time platform configuration (BEAGLE_BOARD, + PANDA_BOARD, PLAT_WMS8304, PLAT_RK, CUSTOMER_PLATFORM, ...) + into run-time options that are read from DT - support soft-ap and p2p mode - support resume/suspend function +- replace SIOCDEVPRIVATE commands with generic API functions +- use wext-core handling instead of private SIOCSIWPRIV implementation ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v1] staging: lustre: libcfs: add __user annotation in libcfs_ioctl_data
Thanks for reviewing. The 2 struct members were not marked as __user, which this patch does here. This was causing warnings with copy from/to user (see commit description). This patch also propagates the annotation to the couple of functions that are using those members. On Sat, May 30, 2015 at 7:27 PM, Greg Kroah-Hartman wrote: > On Mon, May 25, 2015 at 09:40:04PM -0700, David Decotigny wrote: >> This fixes the following sparse warnings: >>drivers/staging/lustre/lnet/lnet/api-ni.c:1926:38: warning: incorrect >> type in argument 1 (different address spaces) >>drivers/staging/lustre/lnet/lnet/api-ni.c:1926:38:expected void >> [noderef] *to >>drivers/staging/lustre/lnet/lnet/api-ni.c:1926:38:got struct >> lnet_process_id_t [usertype] * >>drivers/staging/lustre/lnet/selftest/conctl.c:833:37: warning: incorrect >> type in argument 2 (different address spaces) >>drivers/staging/lustre/lnet/selftest/conctl.c:833:37:expected void >> const [noderef] *from >>drivers/staging/lustre/lnet/selftest/conctl.c:833:37:got char >> *ioc_pbuf1 >>drivers/staging/lustre/lnet/selftest/conctl.c:918:30: warning: incorrect >> type in argument 1 (different address spaces) >>drivers/staging/lustre/lnet/selftest/conctl.c:918:30:expected void >> [noderef] *to >>drivers/staging/lustre/lnet/selftest/conctl.c:918:30:got char >> *ioc_pbuf2 >> >> Signed-off-by: David Decotigny >> --- >> drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h | 4 ++-- >> drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- >> drivers/staging/lustre/lnet/lnet/api-ni.c | 5 +++-- >> 3 files changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h >> b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h >> index 3ee3878..aa687b7 100644 >> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h >> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h >> @@ -61,9 +61,9 @@ struct libcfs_ioctl_data { >> char *ioc_inlbuf2; >> >> __u32 ioc_plen1; /* buffers in userspace */ >> - char *ioc_pbuf1; >> + char __user *ioc_pbuf1; >> __u32 ioc_plen2; /* buffers in userspace */ >> - char *ioc_pbuf2; >> + char __user *ioc_pbuf2; >> >> char ioc_bulk[0]; >> }; >> diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h >> b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h >> index 0038d29..7f06b9f7 100644 >> --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h >> +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h >> @@ -858,7 +858,7 @@ void lnet_swap_pinginfo(lnet_ping_info_t *info); >> int lnet_ping_target_init(void); >> void lnet_ping_target_fini(void); >> int lnet_ping(lnet_process_id_t id, int timeout_ms, >> - lnet_process_id_t *ids, int n_ids); >> + lnet_process_id_t __user *ids, int n_ids); >> >> int lnet_parse_ip2nets(char **networksp, char *ip2nets); >> int lnet_parse_routes(char *route_str, int *im_a_router); >> diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c >> b/drivers/staging/lustre/lnet/lnet/api-ni.c >> index 4a14e51..1a0cd57 100644 >> --- a/drivers/staging/lustre/lnet/lnet/api-ni.c >> +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c >> @@ -1470,7 +1470,7 @@ LNetCtl(unsigned int cmd, void *arg) >> id.nid = data->ioc_nid; >> id.pid = data->ioc_u32[0]; >> rc = lnet_ping(id, data->ioc_u32[1], /* timeout */ >> -(lnet_process_id_t *)data->ioc_pbuf1, >> +(lnet_process_id_t __user *)data->ioc_pbuf1, > > Why is this marking needed? If so, something must be wrong as isn't > this variable already __user now due to the other part of this patch? > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3 v4] Staging: rtl8192u: Remove two useless lines at ieee80211_wep_null
On Sun, 2015-05-31 at 10:39 +0900, Greg KH wrote: > On Thu, May 21, 2015 at 02:25:18AM +0200, Pedro Marzo Perez wrote: > > Remove two lines at ieee80211_wep_null which checkpatch.pl reported as > > errors. > > The first one because it has a C99 comment style and the second one because > > it is a void > > return which is useless. > > > > Signed-off-by: Pedro Marzo Perez > > --- > > drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c > > index bd789d1..94622cc 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c > > @@ -279,6 +279,4 @@ void __exit ieee80211_crypto_wep_exit(void) > > > > void ieee80211_wep_null(void) > > { > > -// printk(">%s()\n", __func__); > > - return; > > } > > Please just delete the function. It is not so easy, the function is exported at file drivers/staging/rtl8192u/ieee80211/ieee80211.h and used at drivers/staging/rtl8192u/ieee80211/ieee80211_module.c line 179 with several other "null" functions, it seems a dirty trick to force module loading: /* These function were added to load crypte module autoly */ ieee80211_tkip_null(); ieee80211_wep_null(); ieee80211_ccmp_null(); I guess all this stuff should be rewritten to force the autoload properly but I don't have the knowledge to fix all this. Sorry Greg :-( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: lov: remove unnecessary parentheses
fix checkpatch.pl warning about unnecessary parentheses Signed-off-by: Antonio Murdaca --- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 054ca32..0a4f1771 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -1417,7 +1417,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, __u32 flags; memcpy(&index, data->ioc_inlbuf2, sizeof(__u32)); - if ((index >= count)) + if (index >= count) return -ENODEV; if (!lov->lov_tgts[index]) -- 2.4.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/3] staging: iio_simple_dummy: fix init function
On 30/05/15 09:20, Vladimirs Ambrosovs wrote: > This patch fixes the init function for the iio_simple_dummy driver. > The main issues were absence of kfree for the allocated array, and no > devices being removed in case the probe function fails, running in a loop. > > Signed-off-by: Vladimirs Ambrosovs Thanks, Applied to the togreg branch of iio.git which will get pushed out as testing for the autobuilders to play with it once I'm home from the fools errand I am currently on in a clean room with no internet... Jonathan > --- > drivers/staging/iio/iio_simple_dummy.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/iio_simple_dummy.c > b/drivers/staging/iio/iio_simple_dummy.c > index b47bf9f..d0a9963 100644 > --- a/drivers/staging/iio/iio_simple_dummy.c > +++ b/drivers/staging/iio/iio_simple_dummy.c > @@ -722,9 +722,16 @@ static __init int iio_dummy_init(void) > for (i = 0; i < instances; i++) { > ret = iio_dummy_probe(i); > if (ret < 0) > - return ret; > + goto error_remove_devs; > } > return 0; > + > +error_remove_devs: > + while (i--) > + iio_dummy_remove(i); > + > + kfree(iio_dummy_devs); > + return ret; > } > module_init(iio_dummy_init); > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/3] staging: iio_simple_dummy: fix module_param type
On 30/05/15 09:20, Vladimirs Ambrosovs wrote: > Fix the module_param "instances" type to uint, since the variable type > holding the value is unsigned. > > Signed-off-by: Vladimirs Ambrosovs Applied to the togreg branch of iio.git - which will get pushed out as testing in a few days. Or just possibly tonight if the hotel network is working well and I can remember my password :) Jonathan > --- > drivers/staging/iio/iio_simple_dummy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/iio_simple_dummy.c > b/drivers/staging/iio/iio_simple_dummy.c > index dc9482c7..1629a8a 100644 > --- a/drivers/staging/iio/iio_simple_dummy.c > +++ b/drivers/staging/iio/iio_simple_dummy.c > @@ -30,7 +30,7 @@ > * dummy devices are registered. > */ > static unsigned instances = 1; > -module_param(instances, int, 0); > +module_param(instances, uint, 0); > > /* Pointer array used to fake bus elements */ > static struct iio_dev **iio_dummy_devs; > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 2/3] staging: iio_simple_dummy: fix return types
On 30/05/15 09:20, Vladimirs Ambrosovs wrote: > The functions iio_dummy_remove(), iio_simple_dummy_events_unregister() and > iio_dummy_evgen_release_irq() were changed to return void instead of int. > > Signed-off-by: Vladimirs Ambrosovs applied as per previous patch. > --- > drivers/staging/iio/iio_dummy_evgen.c | 4 +--- > drivers/staging/iio/iio_dummy_evgen.h | 2 +- > drivers/staging/iio/iio_simple_dummy.c| 10 ++ > drivers/staging/iio/iio_simple_dummy.h| 8 +++- > drivers/staging/iio/iio_simple_dummy_events.c | 4 +--- > 5 files changed, 8 insertions(+), 20 deletions(-) > > diff --git a/drivers/staging/iio/iio_dummy_evgen.c > b/drivers/staging/iio/iio_dummy_evgen.c > index 0c9c86d..c54d5b5 100644 > --- a/drivers/staging/iio/iio_dummy_evgen.c > +++ b/drivers/staging/iio/iio_dummy_evgen.c > @@ -128,13 +128,11 @@ EXPORT_SYMBOL_GPL(iio_dummy_evgen_get_irq); > * > * Used by client driver instances to give the irqs back when they disconnect > */ > -int iio_dummy_evgen_release_irq(int irq) > +void iio_dummy_evgen_release_irq(int irq) > { > mutex_lock(&iio_evgen->lock); > iio_evgen->inuse[irq - iio_evgen->base] = false; > mutex_unlock(&iio_evgen->lock); > - > - return 0; > } > EXPORT_SYMBOL_GPL(iio_dummy_evgen_release_irq); > > diff --git a/drivers/staging/iio/iio_dummy_evgen.h > b/drivers/staging/iio/iio_dummy_evgen.h > index 2ac293a..d044b94 100644 > --- a/drivers/staging/iio/iio_dummy_evgen.h > +++ b/drivers/staging/iio/iio_dummy_evgen.h > @@ -8,6 +8,6 @@ struct iio_dummy_regs { > > struct iio_dummy_regs *iio_dummy_evgen_get_regs(int irq); > int iio_dummy_evgen_get_irq(void); > -int iio_dummy_evgen_release_irq(int irq); > +void iio_dummy_evgen_release_irq(int irq); > > #endif /* _IIO_DUMMY_EVGEN_H_ */ > diff --git a/drivers/staging/iio/iio_simple_dummy.c > b/drivers/staging/iio/iio_simple_dummy.c > index d0a9963..dc9482c7 100644 > --- a/drivers/staging/iio/iio_simple_dummy.c > +++ b/drivers/staging/iio/iio_simple_dummy.c > @@ -665,9 +665,8 @@ error_ret: > * > * Parameters follow those of iio_dummy_probe for buses. > */ > -static int iio_dummy_remove(int index) > +static void iio_dummy_remove(int index) > { > - int ret; > /* >* Get a pointer to the device instance iio_dev structure >* from the bus subsystem. E.g. > @@ -685,15 +684,10 @@ static int iio_dummy_remove(int index) > /* Buffered capture related cleanup */ > iio_simple_dummy_unconfigure_buffer(indio_dev); > > - ret = iio_simple_dummy_events_unregister(indio_dev); > - if (ret) > - goto error_ret; > + iio_simple_dummy_events_unregister(indio_dev); > > /* Free all structures */ > iio_device_free(indio_dev); > - > -error_ret: > - return ret; > } > > /** > diff --git a/drivers/staging/iio/iio_simple_dummy.h > b/drivers/staging/iio/iio_simple_dummy.h > index d86ccb7..e877a99 100644 > --- a/drivers/staging/iio/iio_simple_dummy.h > +++ b/drivers/staging/iio/iio_simple_dummy.h > @@ -79,7 +79,7 @@ int iio_simple_dummy_write_event_value(struct iio_dev > *indio_dev, > int val2); > > int iio_simple_dummy_events_register(struct iio_dev *indio_dev); > -int iio_simple_dummy_events_unregister(struct iio_dev *indio_dev); > +void iio_simple_dummy_events_unregister(struct iio_dev *indio_dev); > > #else /* Stubs for when events are disabled at compile time */ > > @@ -89,11 +89,9 @@ iio_simple_dummy_events_register(struct iio_dev *indio_dev) > return 0; > }; > > -static inline int > +static inline void > iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) > -{ > - return 0; > -}; > +{ }; > > #endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS*/ > > diff --git a/drivers/staging/iio/iio_simple_dummy_events.c > b/drivers/staging/iio/iio_simple_dummy_events.c > index c32ef78..ecc563c 100644 > --- a/drivers/staging/iio/iio_simple_dummy_events.c > +++ b/drivers/staging/iio/iio_simple_dummy_events.c > @@ -257,13 +257,11 @@ error_ret: > * iio_simple_dummy_events_unregister() - tidy up interrupt handling on > remove > * @indio_dev: device instance data > */ > -int iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) > +void iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) > { > struct iio_dummy_state *st = iio_priv(indio_dev); > > free_irq(st->event_irq, indio_dev); > /* Not part of normal driver */ > iio_dummy_evgen_release_irq(st->event_irq); > - > - return 0; > } > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings
Fix the following sparse warnings: drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types) drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected restricted __le16 [usertype] frame_ctl drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid assignment: |= drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has type restricted __le16 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side has type int Signed-off-by: Gaston Gonzalez --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index d2e8b12..bda961c 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -660,8 +660,9 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be auth = (struct ieee80211_authentication *) skb_put(skb, sizeof(struct ieee80211_authentication)); - auth->header.frame_ctl = IEEE80211_STYPE_AUTH; - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP; + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH); + if (challengelen) + auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP); auth->header.duration_id = 0x013a; //FIXME -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'
On 06/01, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango The above line should not be here and it will appear as long as the email client is not configured correctly. Just take a step back and fix it as this is something that you do once and then it remains *correct* forever. The trick is to match the git user with the email user and you can test it by sending the patches to yourself before they are posted to the list. Thanks and hope this helps. - konrad > This patch deletes all references to 'flipbuf'.Memory is allocated and > freed but never used anywhere in the driver.Also deleted an ununsed > Macro defined in the header file. > > Signed-off-by: Hari Prasath Gujulan Elango > --- > drivers/staging/dgnc/dgnc_driver.c | 9 - > drivers/staging/dgnc/dgnc_driver.h | 1 - > 2 files changed, 10 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_driver.c > b/drivers/staging/dgnc/dgnc_driver.c > index 805dc61..7546aff 100644 > --- a/drivers/staging/dgnc/dgnc_driver.c > +++ b/drivers/staging/dgnc/dgnc_driver.c > @@ -355,7 +355,6 @@ static void dgnc_cleanup_board(struct dgnc_board *brd) > } > } > > - kfree(brd->flipbuf); > > dgnc_Board[brd->boardnum] = NULL; > > @@ -581,14 +580,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) > brd->msgbuf_head = NULL; > spin_unlock_irqrestore(&dgnc_global_lock, flags); > > - /* > - * allocate flip buffer for board. > - * > - * Okay to malloc with GFP_KERNEL, we are not at interrupt > - * context, and there are no locks held. > - */ > - brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL); > - > wake_up_interruptible(&brd->state_wait); > > return 0; > diff --git a/drivers/staging/dgnc/dgnc_driver.h > b/drivers/staging/dgnc/dgnc_driver.h > index f77fed5..de9e71c 100644 > --- a/drivers/staging/dgnc/dgnc_driver.h > +++ b/drivers/staging/dgnc/dgnc_driver.h > @@ -288,7 +288,6 @@ struct un_t { > #define CH_TX_FIFO_LWM 0x0800 /* TX Fifo is below Low Water > */ > #define CH_BREAK_SENDING 0x1000 /* Break is being sent > */ > #define CH_LOOPBACK 0x2000 /* Channel is in lookback mode */ > -#define CH_FLIPBUF_IN_USE 0x4000 /* Channel's flipbuf is in use */ > #define CH_BAUD0 0x08000 /* Used for checking B0 transitions */ > #define CH_FORCED_STOP 0x2 /* Output is forcibly stopped > */ > #define CH_FORCED_STOPI 0x4 /* Input is forcibly stopped > */ > -- > 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