Re: [PATCH] Staging:wilc1000 :Remove typedef from struct
On Fri, Jul 31, 2015 at 01:52:13PM -0700, Greg Kroah-Hartman wrote: On Fri, Jul 31, 2015 at 11:08:47AM +0530, Shraddha Barke wrote: This patch fixes the following checkpatch.pl warning: WARNING: do not add new typedefs Signed-off-by: Shraddha Barke shraddha.6...@gmail.com --- snip -typedef enum { +enum { CLASS1_FRAME_TYPE = 0x00, CLASS2_FRAME_TYPE = 0x01, CLASS3_FRAME_TYPE = 0x02, Did you test-build this change? This enum is not used anywhere. So did not affect the build. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
vme_ca91cx42 doesn't touch VMEbus on read with vme_user
Hello DriverDev, I recently installed the latest Debian with Kernel 3.16 including all the vme drivers (and vme_user in staging) on a GE VME7807RC. Using Martyn Welch’s example from 12 March 2013 on this list as a guide, I tried reading out 32 bytes from one of my boards, but I just got a bunch of 0xFF bytes. I monitored the bus with a diagnostics board, and didn’t see any activity at all (no addresses, no data) from power-up through booting and trying to read from the bus. Attempting the same reads with another VME7807 using the GE provided driver lit up the same diagnostics board like a christmas tree (well, the lower 16 bits). I hope I’m missing something basic, as I don’t see any error messages anywhere to guide my way. Thanks for your help, -Jonathan $ sudo modprobe vme_ca91cx42 $ sudo modprobe vme_user bus=0 $ dmesg | grep vme [ 632.942457] vme_ca91cx42 :01:0d.0: found PCI INT A - IRQ 14 [ 632.942523] vme_ca91cx42 :01:0d.0: Board is the VME system controller [ 632.942526] vme_ca91cx42 :01:0d.0: Slot ID is 0 [ 632.942529] vme_ca91cx42 :01:0d.0: CR/CSR Offset: 0 [ 632.942533] vme_ca91cx42 :01:0d.0: Slot number is unset, not configuring CR/CSR space [ 632.942537] vme_ca91cx42 :01:0d.0: CR/CSR configuration failed. [ 640.990642] vme_user: module is from the staging directory, the quality is unknown, you have been warned. [ 640.991404] vme_user: VME User Space Access Driver $ sudo ./vmetest Simple VME User Module Test WARNING: Only read 32 bytes : ff ff ff ff ff ff ff ff 0008: ff ff ff ff ff ff ff ff 0010: ff ff ff ff ff ff ff ff 0018: ff ff ff ff ff ff ff ff $ cat main.c /* * main.c * * Created on: Jul 29, 2015 * * Copied from: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-April/037460.html * */ #define _XOPEN_SOURCE 500 #include stdio.h #include stdlib.h #include sys/ioctl.h #include sys/types.h #include sys/stat.h #include fcntl.h #include unistd.h #include vme_user.h int main(int argc, char *argv[]) { int fd; int i; int retval; unsigned char data[512]; struct vme_master master; printf(Simple VME User Module Test\n); fd = open(/dev/bus/vme/m0, O_RDONLY); if (fd == -1) { perror(ERROR: Opening window device file); return 1; } //master.enable = 1; //master.vme_addr = 2*0x800; //master.size = 0x10; //master.aspace = 0x4; // VME_A32 //master.cycle = 0x2000 | 0x8000; // Unprivileged data access //master.dwidth = 0x4; // 32 bit word access master.enable = 1; master.vme_addr = 0xE000; master.size = 0x1000; master.aspace = 0x1; // VME_A16 master.cycle = 0x2000; // Unprivileged data access master.dwidth = 0x2; // 16 bit word access retval = ioctl(fd, VME_SET_MASTER, master); if (retval != 0) { printf(retval=%d\n, retval); perror(ERROR: Failed to configure window); return 1; } /* * Reading first 32 bytes */ for (i=0; i32; i++) { data[i] = 0; } retval = pread(fd, data, 32, 0); if (retval 512) { printf(WARNING: Only read %d bytes, retval); } for(i=0; iretval; i++) { if (i % 8 == 0) { printf(\n%4.4x: , i); } printf(%2.2x , data[i]); } printf(\n); close(fd); return 0; } Jonathan Eisch Research Associate Physics Astronomy Iowa State University ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 14/46] usb: gadget: fsl_qe_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/fsl_qe_udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index e0822f1..5fb6f8b 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -2417,6 +2417,17 @@ static int qe_ep_config(struct qe_udc *udc, unsigned char pipe_num) strcpy(ep-name, ep_name[pipe_num]); ep-ep.name = ep_name[pipe_num]; + if (pipe_num == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; + ep-ep.ops = qe_ep_ops; ep-stopped = 1; usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 12/46] usb: gadget: dummy-hcd: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/dummy_hcd.c | 95 -- 1 file changed, 80 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 181112c..1379ad4 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -127,23 +127,87 @@ static inline struct dummy_request *usb_request_to_dummy_request static const char ep0name[] = ep0; -static const char *const ep_name[] = { - ep0name,/* everyone has ep0 */ +static const struct { + const char *name; + const struct usb_ep_caps caps; +} ep_info[] = { +#define EP_INFO(_name, _caps) \ + { \ + .name = _name, \ + .caps = _caps, \ + } + /* everyone has ep0 */ + EP_INFO(ep0name, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)), /* act like a pxa250: fifteen fixed function endpoints */ - ep1in-bulk, ep2out-bulk, ep3in-iso, ep4out-iso, ep5in-int, - ep6in-bulk, ep7out-bulk, ep8in-iso, ep9out-iso, ep10in-int, - ep11in-bulk, ep12out-bulk, ep13in-iso, ep14out-iso, - ep15in-int, - + EP_INFO(ep1in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep2out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep3in-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep4out-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep5in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep6in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep7out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep8in-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep9out-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep10in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep11in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep12out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep13in-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep14out-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep15in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), /* or like sa1100: two fixed function endpoints */ - ep1out-bulk, ep2in-bulk, - + EP_INFO(ep1out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep2in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), /* and now some generic EPs so we have enough in multi config */ - ep3out, ep4in, ep5out, ep6out, ep7in, ep8out, ep9in, - ep10out, ep11out, ep12in, ep13out, ep14in, ep15out, + EP_INFO(ep3out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep4in, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep5out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep6out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep7in, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep8out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep9in, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep10out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep11out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep12in, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep13out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep14in, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep15out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_OUT)), + +#undef EP_INFO }; -#define DUMMY_ENDPOINTSARRAY_SIZE(ep_name) + +#define DUMMY_ENDPOINTSARRAY_SIZE(ep_info) /*-*/ @@ -938,9 +1002,10 @@ static void init_dummy_udc_hw(struct dummy *dum) for (i = 0; i DUMMY_ENDPOINTS; i++) { struct dummy_ep *ep = dum-ep[i]; - if
[PATCH v5 17/46] usb: gadget: goku_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/goku_udc.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index 9e8d842..46b8d14 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c @@ -1257,6 +1257,14 @@ static void udc_reinit (struct goku_udc *dev) INIT_LIST_HEAD (ep-queue); ep_reset(NULL, ep); + + if (i == 0) + ep-ep.caps.type_control = true; + else + ep-ep.caps.type_bulk = true; + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } dev-ep[0].reg_mode = NULL; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 10/46] usb: gadget: bcm63xx_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/bcm63xx_udc.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 9db968b..8cbb003 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -44,9 +44,29 @@ #define DRV_MODULE_NAMEbcm63xx_udc static const char bcm63xx_ep0name[] = ep0; -static const char *const bcm63xx_ep_name[] = { - bcm63xx_ep0name, - ep1in-bulk, ep2out-bulk, ep3in-int, ep4out-int, + +static const struct { + const char *name; + const struct usb_ep_caps caps; +} bcm63xx_ep_info[] = { +#define EP_INFO(_name, _caps) \ + { \ + .name = _name, \ + .caps = _caps, \ + } + + EP_INFO(bcm63xx_ep0name, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep1in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep2out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep3in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep4out-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_OUT)), + +#undef EP_INFO }; static bool use_fullspeed; @@ -943,7 +963,8 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc) for (i = 0; i BCM63XX_NUM_EP; i++) { struct bcm63xx_ep *bep = udc-bep[i]; - bep-ep.name = bcm63xx_ep_name[i]; + bep-ep.name = bcm63xx_ep_info[i].name; + bep-ep.caps = bcm63xx_ep_info[i].caps; bep-ep_num = i; bep-ep.ops = bcm63xx_udc_ep_ops; list_add_tail(bep-ep.ep_list, udc-gadget.ep_list); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 13/46] usb: gadget: fotg210-udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/fotg210-udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c index a99ed6d..6ba122c 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -1143,6 +1143,17 @@ static int fotg210_udc_probe(struct platform_device *pdev) ep-ep.name = fotg210_ep_name[i]; ep-ep.ops = fotg210_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0); + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } usb_ep_set_maxpacket_limit(fotg210-ep[0]-ep, 0x40); fotg210-gadget.ep0 = fotg210-ep[0]-ep; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 15/46] usb: gadget: fsl_udc_core: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/fsl_udc_core.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index c60022b..aab5221 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2313,6 +2313,19 @@ static int struct_ep_setup(struct fsl_udc *udc, unsigned char index, ep-ep.ops = fsl_ep_ops; ep-stopped = 0; + if (index == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + if (index 1) + ep-ep.caps.dir_in = true; + else + ep-ep.caps.dir_out = true; + /* for ep0: maxP defined in desc * for other eps, maxP is set by epautoconfig() called by gadget layer */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 16/46] usb: gadget: fusb300_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/fusb300_udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c index 3970f45..948845c 100644 --- a/drivers/usb/gadget/udc/fusb300_udc.c +++ b/drivers/usb/gadget/udc/fusb300_udc.c @@ -1450,6 +1450,17 @@ static int fusb300_probe(struct platform_device *pdev) ep-ep.name = fusb300_ep_name[i]; ep-ep.ops = fusb300_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, HS_BULK_MAX_PACKET_SIZE); + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } usb_ep_set_maxpacket_limit(fusb300-ep[0]-ep, HS_CTL_MAX_PACKET_SIZE); fusb300-ep[0]-epnum = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: panel: fix block comment usage
On Fri, Jul 31, 2015 at 03:12:23AM -0600, Alex Wilson wrote: Fixed two coding style warnings concerning multiline comments. Signed-off-by: Alex Wilson alex.david.wil...@gmail.com --- drivers/staging/panel/panel.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index bda208d..16a7adc 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -782,13 +782,15 @@ static void long_sleep(int ms) } /* send a serial byte to the LCD panel. The caller is responsible for locking - if needed. */ + * if needed. + */ static void lcd_send_serial(int byte) { int bit; /* the data bit is set on D0, and the clock on STROBE. - * LCD reads D0 on STROBE's rising edge. */ + * LCD reads D0 on STROBE's rising edge. + */ But this is also not the correct multiline comment style. Should be: /* * the data bit is set on D0, and the clock on STROBE. * LCD reads D0 on STROBE's rising edge. */ regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 02/46] usb: gadget: add endpoint capabilities flags
Introduce struct usb_ep_caps which contains information about capabilities of usb endpoints - supported transfer types and directions. This structure should be filled by UDC driver for each of its endpoints, and will be used in epautoconf in new ep matching mechanism which will replace ugly guessing of endpoint capabilities basing on its name. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- include/linux/usb/gadget.h | 21 + 1 file changed, 21 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 68fb5e8..a9a4959 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -141,10 +141,29 @@ struct usb_ep_ops { }; /** + * struct usb_ep_caps - endpoint capabilities description + * @type_control:Endpoint supports control type (reserved for ep0). + * @type_iso:Endpoint supports isochronous transfers. + * @type_bulk:Endpoint supports bulk transfers. + * @type_int:Endpoint supports interrupt transfers. + * @dir_in:Endpoint supports IN direction. + * @dir_out:Endpoint supports OUT direction. + */ +struct usb_ep_caps { + unsigned type_control:1; + unsigned type_iso:1; + unsigned type_bulk:1; + unsigned type_int:1; + unsigned dir_in:1; + unsigned dir_out:1; +}; + +/** * struct usb_ep - device side representation of USB endpoint * @name:identifier for the endpoint, such as ep-a or ep9in-bulk * @ops: Function pointers used to access hardware-specific operations. * @ep_list:the gadget's ep_list holds all of its endpoints + * @caps:The structure describing types and directions supported by endoint. * @maxpacket:The maximum packet size used on this endpoint. The initial * value can sometimes be reduced (hardware allowing), according to * the endpoint descriptor used to configure the endpoint. @@ -167,12 +186,14 @@ struct usb_ep_ops { * gadget-ep_list. the control endpoint (gadget-ep0) is not in that list, * and is accessed only in response to a driver setup() callback. */ + struct usb_ep { void*driver_data; const char *name; const struct usb_ep_ops *ops; struct list_headep_list; + struct usb_ep_caps caps; boolclaimed; unsignedmaxpacket:16; unsignedmaxpacket_limit:16; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 00/46] usb: gadget: rework ep matching and claiming mechanism
Hello, This patch series reworks endpoint matching and claiming mechanism in epautoconf. From v2 there are couple of new patches adding 'ep_match' to usb_gadget_ops and removing chip-specific quirk handling from generic code of autoconfig. I'm not sure if this patch set isn't too long, as it has 46 patches, but I decided to send it as single series to avoid problems with patch applying order. The aim of whole patchset is to rework epautoconf code to get rid of things like name-based endpoint matching and UDC name-based quirks in generic code. These needed to do some modifications in framework like adding 'endpoint capabilities flags' feature or adding 'match_ep'. Following paragraphs contain brief description of what modifications are done by particular parts of this patch set: Patch (1) introduces new safer endpoint claiming method, basing on new 'claimed' flag. It was discussed here [1]. I proposed this solution over year ago and it was accepted, but I apparently forgot to send the final version of my patch. Patches (2-3) add the 'capabilities flags' structure and helper macros. This solution is inspired by the 'feature flags' originally proposed by Felipe Balbi in 2013 [2], but unfortunately implementation of this feature has never been completed. Patches (4-36) add' capabilites flags' support to all UDC drivers present in the kernel tree. It's needed to be done before replacing old endpoint matching mechanism, otherwise UDC drivers which doesn't set 'capabilities flags' won't work with new matching function. Patch (37) finally replaces old endpoint matching method with the new one basing on capabilities flags. These changes aims to get rid of code, which guesses endpoint capabilities basing on it's name, and introduce new better replacement. In result we have better way to describe types and directions supported by each endpoint. For example the old name-based method didn't allow to have endpoint supporing two types of transfers - there were only ability to support one or all of endpoint types. The 'capabilities flags' feature supply precise, flexible and extensible mechanism of description of endpoint hardware limitations, which is desired for proper endpoint matching. Patch (38) removes chip-specific quirk from ep_matches() function. Patches (39-40) remove code modifying endpoint and descriptor structures from ep_matches() function and cleans it up to make it simpler and more readable. Patch (41) add 'match_ep' callback to usb_gadget_ops and make use of it in epautoconf. This callback allows UDC drivers to supply non-standard endpoint matching algorithms. Patches (42-43) move ep_matches() and find_ep() functions outside epautoconf and rename them to usb_gadget_ep_match_desc() and gadget_find_ep_by_name(). It's because they may be useful in 'match_ep' callbacks in UDC drivers to avoid writing repetitive code. Patches (44-46) move chip-specific enpoint matching algorithms from generic code of usb_ep_autoconfig_ss() function to UDC controller drivers using 'match_ep' callback. In the result we have epautoconf source free of chip-specific code, plus two new mechanisms allowing to handle non-standard hardware limitations. [1] https://lkml.org/lkml/2014/6/16/94 [2] http://www.spinics.net/lists/linux-usb/msg99662.html Best regards, Robert Baldyga Changelog: v5: - made code more grepable according to Felipe's suggestion v4: https://lkml.org/lkml/2015/7/27/181 - addressed comments from Krzysztof Opasiak and Felipe Balbi v3: https://lkml.org/lkml/2015/7/15/68 - addressed comments from Sergei Shtylyov v2: https://lkml.org/lkml/2015/7/14/172 - remove PXA quirk from ep_matches() function without behaviour change using ep capabilities flags - separate ep and desc configuration code from ep_match() function - add 'ep_match' to usb_gadget_ops and move chip-specific endpoint matching algorithms from generic code to UDC controller drivers v1: https://lkml.org/lkml/2015/7/8/436 Robert Baldyga (46): usb: gadget: encapsulate endpoint claiming mechanism usb: gadget: add endpoint capabilities flags usb: gadget: add endpoint capabilities helper macros staging: emxx_udc: add ep capabilities support usb: chipidea: udc: add ep capabilities support usb: dwc2: gadget: add ep capabilities support usb: dwc3: gadget: add ep capabilities support usb: gadget: amd5536udc: add ep capabilities support usb: gadget: at91_udc: add ep capabilities support usb: gadget: bcm63xx_udc: add ep capabilities support usb: gadget: bdc: add ep capabilities support usb: gadget: dummy-hcd: add ep capabilities support usb: gadget: fotg210-udc: add ep capabilities support usb: gadget: fsl_qe_udc: add ep capabilities support usb: gadget: fsl_udc_core: add ep capabilities support usb: gadget: fusb300_udc: add ep capabilities support usb: gadget: goku_udc: add ep capabilities support usb: gadget: gr_udc: add ep capabilities support usb: gadget: lpc32xx_udc: add ep capabilities support usb:
[PATCH v5 07/46] usb: dwc3: gadget: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/dwc3/gadget.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2feed9e..bd4c3db 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1715,6 +1715,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, return ret; } + if (epnum == 0 || epnum == 1) { + dep-endpoint.caps.type_control = true; + } else { + dep-endpoint.caps.type_iso = true; + dep-endpoint.caps.type_bulk = true; + dep-endpoint.caps.type_int = true; + } + + if (direction) + dep-endpoint.caps.dir_in = true; + else + dep-endpoint.caps.dir_out = true; + INIT_LIST_HEAD(dep-request_list); INIT_LIST_HEAD(dep-req_queued); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 41/46] usb: gadget: add 'ep_match' callback to usb_gadget_ops
Add callback that is called by epautoconf to allow UDC driver match the best endpoint for specific descriptor. It's intended to supply mechanism which allows to get rid of chip-specific endpoint matching code from epautoconf. If gadget has set 'ep_match' callback we prefer to call it first, and if it fails to find matching endpoint, then we try to use default matching algorithm. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 6 ++ include/linux/usb/gadget.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 4fa6f5d..1b1fee0 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -165,6 +165,12 @@ struct usb_ep *usb_ep_autoconfig_ss( type = desc-bmAttributes USB_ENDPOINT_XFERTYPE_MASK; + if (gadget-ops-match_ep) { + ep = gadget-ops-match_ep(gadget, desc, ep_comp); + if (ep) + goto found_ep; + } + /* First, apply chip-specific best usage knowledge. * This might make a good usb_gadget_ops hook ... */ diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 82b5bcb..303214b 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -534,6 +534,9 @@ struct usb_gadget_ops { int (*udc_start)(struct usb_gadget *, struct usb_gadget_driver *); int (*udc_stop)(struct usb_gadget *); + struct usb_ep *(*match_ep)(struct usb_gadget *, + struct usb_endpoint_descriptor *, + struct usb_ss_ep_comp_descriptor *); }; /** -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 43/46] usb: gadget: move find_ep() from epautoconf to gadget.h
Move find_ep() function to gadget.h, rename it to gadget_find_ep_by_name() and make it static inline. It can be used in UDC drivers, especially in 'match_ep' callback after moving chip-specific endpoint matching logic from epautoconf to UDC drivers. Replace all calls of find_ep() function with gadget_find_ep_by_name(). Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 30 +- include/linux/usb/gadget.h | 18 ++ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 3f0a380..cc0b084 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -22,18 +22,6 @@ #include gadget_chips.h -static struct usb_ep * -find_ep (struct usb_gadget *gadget, const char *name) -{ - struct usb_ep *ep; - - list_for_each_entry (ep, gadget-ep_list, ep_list) { - if (0 == strcmp (ep-name, name)) - return ep; - } - return NULL; -} - /** * usb_ep_autoconfig_ss() - choose an endpoint matching the ep * descriptor and ep companion descriptor @@ -103,11 +91,11 @@ struct usb_ep *usb_ep_autoconfig_ss( if (type == USB_ENDPOINT_XFER_INT) { /* ep-e, ep-f are PIO with only 64 byte fifos */ - ep = find_ep(gadget, ep-e); + ep = gadget_find_ep_by_name(gadget, ep-e); if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; - ep = find_ep(gadget, ep-f); + ep = gadget_find_ep_by_name(gadget, ep-f); if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; @@ -116,20 +104,20 @@ struct usb_ep *usb_ep_autoconfig_ss( /* USB3380: use same address for usb and hardware endpoints */ snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc), usb_endpoint_dir_in(desc) ? in : out); - ep = find_ep(gadget, name); + ep = gadget_find_ep_by_name(gadget, name); if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; } else if (gadget_is_goku (gadget)) { if (USB_ENDPOINT_XFER_INT == type) { /* single buffering is enough */ - ep = find_ep(gadget, ep3-bulk); + ep = gadget_find_ep_by_name(gadget, ep3-bulk); if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; } else if (USB_ENDPOINT_XFER_BULK == type (USB_DIR_IN desc-bEndpointAddress)) { /* DMA may be available */ - ep = find_ep(gadget, ep2-bulk); + ep = gadget_find_ep_by_name(gadget, ep2-bulk); if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; @@ -140,14 +128,14 @@ struct usb_ep *usb_ep_autoconfig_ss( if ((USB_ENDPOINT_XFER_BULK == type) || (USB_ENDPOINT_XFER_ISOC == type)) { if (USB_DIR_IN desc-bEndpointAddress) - ep = find_ep (gadget, ep5in); + ep = gadget_find_ep_by_name(gadget, ep5in); else - ep = find_ep (gadget, ep6out); + ep = gadget_find_ep_by_name(gadget, ep6out); } else if (USB_ENDPOINT_XFER_INT == type) { if (USB_DIR_IN desc-bEndpointAddress) - ep = find_ep(gadget, ep1in); + ep = gadget_find_ep_by_name(gadget, ep1in); else - ep = find_ep(gadget, ep2out); + ep = gadget_find_ep_by_name(gadget, ep2out); } else ep = NULL; if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index e04fd63..6a413ab 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -639,6 +639,24 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) #define gadget_for_each_ep(tmp, gadget) \ list_for_each_entry(tmp, (gadget)-ep_list, ep_list) +/** + * gadget_find_ep_by_name - returns ep whose name is the same as sting passed + * in second parameter or NULL if
[PATCH v5 45/46] usb: gadget: goku_udc: add goku_match_ep() function
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching process. Function does the same that was done by chip-specific code inside of epautoconf. Now this code can be removed from there to separate generic code from platform specific logic. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 20 ++-- drivers/usb/gadget/udc/goku_udc.c | 25 + 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index d41fd82..da45371 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -86,24 +86,8 @@ struct usb_ep *usb_ep_autoconfig_ss( /* First, apply chip-specific best usage knowledge. * This might make a good usb_gadget_ops hook ... */ - if (gadget_is_goku (gadget)) { - if (USB_ENDPOINT_XFER_INT == type) { - /* single buffering is enough */ - ep = gadget_find_ep_by_name(gadget, ep3-bulk); - if (ep usb_gadget_ep_match_desc(gadget, - ep, desc, ep_comp)) - goto found_ep; - } else if (USB_ENDPOINT_XFER_BULK == type -(USB_DIR_IN desc-bEndpointAddress)) { - /* DMA may be available */ - ep = gadget_find_ep_by_name(gadget, ep2-bulk); - if (ep usb_gadget_ep_match_desc(gadget, - ep, desc, ep_comp)) - goto found_ep; - } - #ifdef CONFIG_BLACKFIN - } else if (gadget_is_musbhdrc(gadget)) { + if (gadget_is_musbhdrc(gadget)) { if ((USB_ENDPOINT_XFER_BULK == type) || (USB_ENDPOINT_XFER_ISOC == type)) { if (USB_DIR_IN desc-bEndpointAddress) @@ -119,8 +103,8 @@ struct usb_ep *usb_ep_autoconfig_ss( ep = NULL; if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; -#endif } +#endif /* Second, look at endpoints until an unclaimed one looks usable */ list_for_each_entry (ep, gadget-ep_list, ep_list) { diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index 46b8d14..d5a93ea 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c @@ -990,6 +990,30 @@ static int goku_get_frame(struct usb_gadget *_gadget) return -EOPNOTSUPP; } +static struct usb_ep *goku_match_ep(struct usb_gadget *g, + struct usb_endpoint_descriptor *desc, + struct usb_ss_ep_comp_descriptor *ep_comp) +{ + struct goku_udc *dev = to_goku_udc(g); + struct usb_ep *ep; + u8 type = usb_endpoint_type(desc); + + if (type == USB_ENDPOINT_XFER_INT) { + /* single buffering is enough */ + ep = dev-ep[3].ep; + if (ep usb_gadget_ep_match_desc(g, ep, desc, ep_comp)) + return ep; + } else if (type == USB_ENDPOINT_XFER_BULK +usb_endpoint_dir_in(desc)) { + /* DMA may be available */ + ep = dev-ep[2].ep; + if (ep usb_gadget_ep_match_desc(g, ep, desc, ep_comp)) + return ep; + } + + return NULL; +} + static int goku_udc_start(struct usb_gadget *g, struct usb_gadget_driver *driver); static int goku_udc_stop(struct usb_gadget *g); @@ -998,6 +1022,7 @@ static const struct usb_gadget_ops goku_ops = { .get_frame = goku_get_frame, .udc_start = goku_udc_start, .udc_stop = goku_udc_stop, + .match_ep = goku_match_ep, // no remote wakeup // not selfpowered }; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 46/46] usb: musb: gadget: add musb_match_ep() function
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching process. Function does the same that was done by chip-specific code inside of epautoconf. Now this code can be removed from there to separate generic code from platform specific logic. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 23 --- drivers/usb/musb/musb_gadget.c | 34 ++ 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index da45371..254ece7 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -83,29 +83,6 @@ struct usb_ep *usb_ep_autoconfig_ss( goto found_ep; } - /* First, apply chip-specific best usage knowledge. -* This might make a good usb_gadget_ops hook ... -*/ -#ifdef CONFIG_BLACKFIN - if (gadget_is_musbhdrc(gadget)) { - if ((USB_ENDPOINT_XFER_BULK == type) || - (USB_ENDPOINT_XFER_ISOC == type)) { - if (USB_DIR_IN desc-bEndpointAddress) - ep = gadget_find_ep_by_name(gadget, ep5in); - else - ep = gadget_find_ep_by_name(gadget, ep6out); - } else if (USB_ENDPOINT_XFER_INT == type) { - if (USB_DIR_IN desc-bEndpointAddress) - ep = gadget_find_ep_by_name(gadget, ep1in); - else - ep = gadget_find_ep_by_name(gadget, ep2out); - } else - ep = NULL; - if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) - goto found_ep; - } -#endif - /* Second, look at endpoints until an unclaimed one looks usable */ list_for_each_entry (ep, gadget-ep_list, ep_list) { if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 4150baf..02c3f8a 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1684,6 +1684,39 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) return 0; } +#ifdef CONFIG_BLACKFIN +static struct usb_ep *musb_match_ep(struct usb_gadget *g, + struct usb_endpoint_descriptor *desc, + struct usb_ss_ep_comp_descriptor *ep_comp) +{ + struct usb_ep *ep = NULL; + u8 type = usb_endpoint_type(desc); + + switch(type) { + case USB_ENDPOINT_XFER_ISOC: + case USB_ENDPOINT_XFER_BULK: + if (usb_endpoint_dir_in(desc)) + ep = gadget_find_ep_by_name(g, ep5in); + else + ep = gadget_find_ep_by_name(g, ep6out); + break; + case USB_ENDPOINT_XFER_INT: + if (usb_endpoint_dir_in(desc)) + ep = gadget_find_ep_by_name(g, ep1in); + else + ep = gadget_find_ep_by_name(g, ep2out); + default: + } + + if (ep usb_gadget_ep_match_desc(g, ep, desc, ep_comp)) + return ep; + + return NULL; +} +#else +#define musb_match_ep NULL +#endif + static int musb_gadget_start(struct usb_gadget *g, struct usb_gadget_driver *driver); static int musb_gadget_stop(struct usb_gadget *g); @@ -1697,6 +1730,7 @@ static const struct usb_gadget_ops musb_gadget_operations = { .pullup = musb_gadget_pullup, .udc_start = musb_gadget_start, .udc_stop = musb_gadget_stop, + .match_ep = musb_match_ep, }; /* --- */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 42/46] usb: gadget: move ep_matches() from epautoconf to udc-core
Move ep_matches() function to udc-core and rename it to usb_gadget_ep_match_desc(). This function can be used by UDC drivers in 'match_ep' callback to avoid writing lots of repetitive code. Replace all calls of ep_matches() with usb_gadget_ep_match_desc(). Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 95 +-- drivers/usb/gadget/udc/udc-core.c | 69 include/linux/usb/gadget.h| 8 3 files changed, 88 insertions(+), 84 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 1b1fee0..3f0a380 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -22,82 +22,6 @@ #include gadget_chips.h -static int -ep_matches ( - struct usb_gadget *gadget, - struct usb_ep *ep, - struct usb_endpoint_descriptor *desc, - struct usb_ss_ep_comp_descriptor *ep_comp -) -{ - u8 type; - u16 max; - int num_req_streams = 0; - - /* endpoint already claimed? */ - if (ep-claimed) - return 0; - - type = usb_endpoint_type(desc); - max = 0x7ff usb_endpoint_maxp(desc); - - if (usb_endpoint_dir_in(desc) !ep-caps.dir_in) - return 0; - else if (!ep-caps.dir_out) - return 0; - - if (max ep-maxpacket_limit) - return 0; - - /* high bandwidth works only at high speed */ - if (!gadget_is_dualspeed(gadget) usb_endpoint_maxp(desc) (311)) - return 0; - - switch (type) { - case USB_ENDPOINT_XFER_CONTROL: - /* only support ep0 for portable CONTROL traffic */ - return 0; - case USB_ENDPOINT_XFER_ISOC: - if (!ep-caps.type_iso) - return 0; - /* ISO: limit 1023 bytes full speed, -* 1024 high/super speed -*/ - if (!gadget_is_dualspeed(gadget) max 1023) - return 0; - break; - case USB_ENDPOINT_XFER_BULK: - if (!ep-caps.type_bulk) - return 0; - if (ep_comp gadget_is_superspeed(gadget)) { - /* Get the number of required streams from the -* EP companion descriptor and see if the EP -* matches it -*/ - num_req_streams = ep_comp-bmAttributes 0x1f; - if (num_req_streams ep-max_streams) - return 0; - } - break; - case USB_ENDPOINT_XFER_INT: - /* Bulk endpoints handle interrupt transfers, -* except the toggle-quirky iso-synch kind -*/ - if (!ep-caps.type_int !ep-caps.type_bulk) - return 0; - /* INT: limit 64 bytes full speed, -* 1024 high/super speed -*/ - if (!gadget_is_dualspeed(gadget) max 64) - return 0; - break; - } - - /* MATCH!! */ - - return 1; -} - static struct usb_ep * find_ep (struct usb_gadget *gadget, const char *name) { @@ -180,10 +104,12 @@ struct usb_ep *usb_ep_autoconfig_ss( if (type == USB_ENDPOINT_XFER_INT) { /* ep-e, ep-f are PIO with only 64 byte fifos */ ep = find_ep(gadget, ep-e); - if (ep ep_matches(gadget, ep, desc, ep_comp)) + if (ep usb_gadget_ep_match_desc(gadget, + ep, desc, ep_comp)) goto found_ep; ep = find_ep(gadget, ep-f); - if (ep ep_matches(gadget, ep, desc, ep_comp)) + if (ep usb_gadget_ep_match_desc(gadget, + ep, desc, ep_comp)) goto found_ep; } @@ -191,20 +117,21 @@ struct usb_ep *usb_ep_autoconfig_ss( snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc), usb_endpoint_dir_in(desc) ? in : out); ep = find_ep(gadget, name); - if (ep ep_matches(gadget, ep, desc, ep_comp)) + if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) goto found_ep; } else if (gadget_is_goku (gadget)) { if (USB_ENDPOINT_XFER_INT == type) { /* single buffering is enough */ ep = find_ep(gadget, ep3-bulk); - if (ep ep_matches(gadget, ep, desc, ep_comp)) + if (ep usb_gadget_ep_match_desc(gadget, +
[PATCH v5 44/46] usb: gadget: net2280: add net2280_match_ep() function
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching process. Function does the same that was done by chip-specific code inside of epautoconf. Now this code can be removed from there to separate generic code from platform specific logic. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 23 +-- drivers/usb/gadget/udc/net2280.c | 31 +++ 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index cc0b084..d41fd82 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -86,28 +86,7 @@ struct usb_ep *usb_ep_autoconfig_ss( /* First, apply chip-specific best usage knowledge. * This might make a good usb_gadget_ops hook ... */ - if (gadget_is_net2280(gadget)) { - char name[8]; - - if (type == USB_ENDPOINT_XFER_INT) { - /* ep-e, ep-f are PIO with only 64 byte fifos */ - ep = gadget_find_ep_by_name(gadget, ep-e); - if (ep usb_gadget_ep_match_desc(gadget, - ep, desc, ep_comp)) - goto found_ep; - ep = gadget_find_ep_by_name(gadget, ep-f); - if (ep usb_gadget_ep_match_desc(gadget, - ep, desc, ep_comp)) - goto found_ep; - } - - /* USB3380: use same address for usb and hardware endpoints */ - snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc), - usb_endpoint_dir_in(desc) ? in : out); - ep = gadget_find_ep_by_name(gadget, name); - if (ep usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp)) - goto found_ep; - } else if (gadget_is_goku (gadget)) { + if (gadget_is_goku (gadget)) { if (USB_ENDPOINT_XFER_INT == type) { /* single buffering is enough */ ep = gadget_find_ep_by_name(gadget, ep3-bulk); diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 872ca25..9d7eac1 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -1550,6 +1550,36 @@ static int net2280_pullup(struct usb_gadget *_gadget, int is_on) return 0; } +static struct usb_ep *net2280_match_ep(struct usb_gadget *_gadget, + struct usb_endpoint_descriptor *desc, + struct usb_ss_ep_comp_descriptor *ep_comp) +{ + char name[8]; + struct usb_ep *ep; + u8 type; + + type = usb_endpoint_type(desc); + + if (type == USB_ENDPOINT_XFER_INT) { + /* ep-e, ep-f are PIO with only 64 byte fifos */ + ep = gadget_find_ep_by_name(_gadget, ep-e); + if (ep usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp)) + return ep; + ep = gadget_find_ep_by_name(_gadget, ep-f); + if (ep usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp)) + return ep; + } + + /* USB3380: use same address for usb and hardware endpoints */ + snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc), + usb_endpoint_dir_in(desc) ? in : out); + ep = gadget_find_ep_by_name(_gadget, name); + if (ep usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp)) + return ep; + + return NULL; +} + static int net2280_start(struct usb_gadget *_gadget, struct usb_gadget_driver *driver); static int net2280_stop(struct usb_gadget *_gadget); @@ -1561,6 +1591,7 @@ static const struct usb_gadget_ops net2280_ops = { .pullup = net2280_pullup, .udc_start = net2280_start, .udc_stop = net2280_stop, + .match_ep = net2280_match_ep, }; /*-*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 38/46] usb: gadget: epautoconf: remove pxa quirk from ep_matches()
The same effect can be achieved by using capabilities flags, so now we can get rid of handling of hardware specific limitations in generic code. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 5 - drivers/usb/gadget/udc/pxa25x_udc.c | 9 +++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index af4b10a..4f66e9d73 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -58,11 +58,6 @@ ep_matches ( */ if (!ep-caps.type_int !ep-caps.type_bulk) return 0; - /* for now, avoid PXA interrupt-in; -* it's documented as never using DATA1. -*/ - if (gadget_is_pxa(gadget) ep-caps.type_int) - return 0; break; } diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c index b4d25dc..b82cb14 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.c +++ b/drivers/usb/gadget/udc/pxa25x_udc.c @@ -1899,8 +1899,7 @@ static struct pxa25x_udc memory = { .name = ep5in-int, .ops= pxa25x_ep_ops, .maxpacket = INT_FIFO_SIZE, - .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, - USB_EP_CAPS_DIR_IN), + .caps = USB_EP_CAPS(0, 0), }, .dev= memory, .fifo_size = INT_FIFO_SIZE, @@ -1978,8 +1977,7 @@ static struct pxa25x_udc memory = { .name = ep10in-int, .ops= pxa25x_ep_ops, .maxpacket = INT_FIFO_SIZE, - .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, - USB_EP_CAPS_DIR_IN), + .caps = USB_EP_CAPS(0, 0), }, .dev= memory, .fifo_size = INT_FIFO_SIZE, @@ -2057,8 +2055,7 @@ static struct pxa25x_udc memory = { .name = ep15in-int, .ops= pxa25x_ep_ops, .maxpacket = INT_FIFO_SIZE, - .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, - USB_EP_CAPS_DIR_IN), + .caps = USB_EP_CAPS(0, 0), }, .dev= memory, .fifo_size = INT_FIFO_SIZE, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 37/46] usb: gadget: epautoconf: add endpoint capabilities flags verification
Introduce endpoint matching mechanism basing on endpoint capabilities flags. We check if endpoint supports transfer type and direction requested in ep descriptor. Since we have this new endpoint matching mechanism there is no need to have old code guessing endpoint capabilities basing on its name, so we are getting rid of it. Remove also the obsolete comment. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 96 + 1 file changed, 30 insertions(+), 66 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 8e00ca7..af4b10a 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -22,22 +22,6 @@ #include gadget_chips.h -/* - * This should work with endpoints from controller drivers sharing the - * same endpoint naming convention. By example: - * - * - ep1, ep2, ... address is fixed, not direction or type - * - ep1in, ep2out, ... address and direction are fixed, not type - * - ep1-bulk, ep2-bulk, ... address and type are fixed, not direction - * - ep1in-bulk, ep2out-iso, ... all three are fixed - * - ep-* ... no functionality restrictions - * - * Type suffixes are -bulk, -iso, or -int. Numbers are decimal. - * Less common restrictions are implied by gadget_is_*(). - * - * NOTE: each endpoint is unidirectional, as specified by its USB - * descriptor; and isn't specific to a configuration or altsetting. - */ static int ep_matches ( struct usb_gadget *gadget, @@ -47,7 +31,6 @@ ep_matches ( ) { u8 type; - const char *tmp; u16 max; int num_req_streams = 0; @@ -56,58 +39,39 @@ ep_matches ( if (ep-claimed) return 0; - /* only support ep0 for portable CONTROL traffic */ type = usb_endpoint_type(desc); - if (USB_ENDPOINT_XFER_CONTROL == type) - return 0; - - /* some other naming convention */ - if ('e' != ep-name[0]) + switch (type) { + case USB_ENDPOINT_XFER_CONTROL: + /* only support ep0 for portable CONTROL traffic */ return 0; + case USB_ENDPOINT_XFER_ISOC: + if (!ep-caps.type_iso) + return 0; + break; + case USB_ENDPOINT_XFER_BULK: + if (!ep-caps.type_bulk) + return 0; + break; + case USB_ENDPOINT_XFER_INT: + /* bulk endpoints handle interrupt transfers, +* except the toggle-quirky iso-synch kind +*/ + if (!ep-caps.type_int !ep-caps.type_bulk) + return 0; + /* for now, avoid PXA interrupt-in; +* it's documented as never using DATA1. +*/ + if (gadget_is_pxa(gadget) ep-caps.type_int) + return 0; + break; + } - /* type-restriction: -iso, -bulk, or -int. -* direction-restriction: in, out. -*/ - if ('-' != ep-name[2]) { - tmp = strrchr (ep-name, '-'); - if (tmp) { - switch (type) { - case USB_ENDPOINT_XFER_INT: - /* bulk endpoints handle interrupt transfers, -* except the toggle-quirky iso-synch kind -*/ - if ('s' == tmp[2]) // == -iso - return 0; - /* for now, avoid PXA interrupt-in; -* it's documented as never using DATA1. -*/ - if (gadget_is_pxa (gadget) -'i' == tmp [1]) - return 0; - break; - case USB_ENDPOINT_XFER_BULK: - if ('b' != tmp[1]) // != -bulk - return 0; - break; - case USB_ENDPOINT_XFER_ISOC: - if ('s' != tmp[2]) // != -iso - return 0; - } - } else { - tmp = ep-name + strlen (ep-name); - } - - /* direction-restriction: ..in-.., out-.. */ - tmp--; - if (!isdigit (*tmp)) { - if (desc-bEndpointAddress USB_DIR_IN) { - if ('n' != *tmp) - return 0; - } else { - if ('t' != *tmp) - return 0; -
[PATCH v5 39/46] usb: gadget: epautoconf: remove ep and desc configuration from ep_matches()
As function ep_matches() is used to match endpoint with usb descriptor it's highly unintuitive that it modifies endpoint and descriptor structures fields. This patch moves code configuring ep and desc from ep_matches() to usb_ep_autoconfig_ss(), so now function ep_matches() does nothing more than its name suggests. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 66 + 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 4f66e9d73..7bb28f1 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -82,13 +82,6 @@ ep_matches ( } - /* -* If the protocol driver hasn't yet decided on wMaxPacketSize -* and wants to know the maximum possible, provide the info. -*/ - if (desc-wMaxPacketSize == 0) - desc-wMaxPacketSize = cpu_to_le16(ep-maxpacket_limit); - /* endpoint maxpacket size is an input parameter, except for bulk * where it's an output parameter representing the full speed limit. * the usb spec fixes high speed bulk maxpacket at 512 bytes. @@ -119,31 +112,6 @@ ep_matches ( /* MATCH!! */ - /* report address */ - desc-bEndpointAddress = USB_DIR_IN; - if (isdigit (ep-name [2])) { - u8 num = simple_strtoul (ep-name [2], NULL, 10); - desc-bEndpointAddress |= num; - } else if (desc-bEndpointAddress USB_DIR_IN) { - if (++gadget-in_epnum 15) - return 0; - desc-bEndpointAddress = USB_DIR_IN | gadget-in_epnum; - } else { - if (++gadget-out_epnum 15) - return 0; - desc-bEndpointAddress |= gadget-out_epnum; - } - - /* report (variable) full speed bulk maxpacket */ - if ((USB_ENDPOINT_XFER_BULK == type) !ep_comp) { - int size = ep-maxpacket_limit; - - /* min() doesn't work on bitfields with gcc-3.5 */ - if (size 64) - size = 64; - desc-wMaxPacketSize = cpu_to_le16(size); - } - ep-address = desc-bEndpointAddress; return 1; } @@ -280,6 +248,40 @@ struct usb_ep *usb_ep_autoconfig_ss( /* Fail */ return NULL; found_ep: + + /* +* If the protocol driver hasn't yet decided on wMaxPacketSize +* and wants to know the maximum possible, provide the info. +*/ + if (desc-wMaxPacketSize == 0) + desc-wMaxPacketSize = cpu_to_le16(ep-maxpacket_limit); + + /* report address */ + desc-bEndpointAddress = USB_DIR_IN; + if (isdigit(ep-name[2])) { + u8 num = simple_strtoul(ep-name[2], NULL, 10); + desc-bEndpointAddress |= num; + } else if (desc-bEndpointAddress USB_DIR_IN) { + if (++gadget-in_epnum 15) + return 0; + desc-bEndpointAddress = USB_DIR_IN | gadget-in_epnum; + } else { + if (++gadget-out_epnum 15) + return 0; + desc-bEndpointAddress |= gadget-out_epnum; + } + + /* report (variable) full speed bulk maxpacket */ + if ((type == USB_ENDPOINT_XFER_BULK) !ep_comp) { + int size = ep-maxpacket_limit; + + /* min() doesn't work on bitfields with gcc-3.5 */ + if (size 64) + size = 64; + desc-wMaxPacketSize = cpu_to_le16(size); + } + + ep-address = desc-bEndpointAddress; ep-desc = NULL; ep-comp_desc = NULL; ep-claimed = true; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 40/46] usb: gadget: epautoconf: rework ep_matches() function
Rework ep_matches() function to make it shorter and more readable. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 87 + 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 7bb28f1..4fa6f5d 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -30,16 +30,29 @@ ep_matches ( struct usb_ss_ep_comp_descriptor *ep_comp ) { - u8 type; - u16 max; - - int num_req_streams = 0; + u8 type; + u16 max; + int num_req_streams = 0; /* endpoint already claimed? */ if (ep-claimed) return 0; type = usb_endpoint_type(desc); + max = 0x7ff usb_endpoint_maxp(desc); + + if (usb_endpoint_dir_in(desc) !ep-caps.dir_in) + return 0; + else if (!ep-caps.dir_out) + return 0; + + if (max ep-maxpacket_limit) + return 0; + + /* high bandwidth works only at high speed */ + if (!gadget_is_dualspeed(gadget) usb_endpoint_maxp(desc) (311)) + return 0; + switch (type) { case USB_ENDPOINT_XFER_CONTROL: /* only support ep0 for portable CONTROL traffic */ @@ -47,66 +60,36 @@ ep_matches ( case USB_ENDPOINT_XFER_ISOC: if (!ep-caps.type_iso) return 0; + /* ISO: limit 1023 bytes full speed, +* 1024 high/super speed +*/ + if (!gadget_is_dualspeed(gadget) max 1023) + return 0; break; case USB_ENDPOINT_XFER_BULK: if (!ep-caps.type_bulk) return 0; + if (ep_comp gadget_is_superspeed(gadget)) { + /* Get the number of required streams from the +* EP companion descriptor and see if the EP +* matches it +*/ + num_req_streams = ep_comp-bmAttributes 0x1f; + if (num_req_streams ep-max_streams) + return 0; + } break; case USB_ENDPOINT_XFER_INT: - /* bulk endpoints handle interrupt transfers, + /* Bulk endpoints handle interrupt transfers, * except the toggle-quirky iso-synch kind */ if (!ep-caps.type_int !ep-caps.type_bulk) return 0; - break; - } - - if (usb_endpoint_dir_in(desc)) { - if (!ep-caps.dir_in) - return 0; - } else { - if (!ep-caps.dir_out) - return 0; - } - - /* -* Get the number of required streams from the EP companion -* descriptor and see if the EP matches it -*/ - if (usb_endpoint_xfer_bulk(desc)) { - if (ep_comp gadget-max_speed = USB_SPEED_SUPER) { - num_req_streams = ep_comp-bmAttributes 0x1f; - if (num_req_streams ep-max_streams) - return 0; - } - - } - - /* endpoint maxpacket size is an input parameter, except for bulk -* where it's an output parameter representing the full speed limit. -* the usb spec fixes high speed bulk maxpacket at 512 bytes. -*/ - max = 0x7ff usb_endpoint_maxp(desc); - switch (type) { - case USB_ENDPOINT_XFER_INT: - /* INT: limit 64 bytes full speed, 1024 high/super speed */ + /* INT: limit 64 bytes full speed, +* 1024 high/super speed +*/ if (!gadget_is_dualspeed(gadget) max 64) return 0; - /* FALLTHROUGH */ - - case USB_ENDPOINT_XFER_ISOC: - /* ISO: limit 1023 bytes full speed, 1024 high/super speed */ - if (ep-maxpacket_limit max) - return 0; - if (!gadget_is_dualspeed(gadget) max 1023) - return 0; - - /* BOTH: high bandwidth works only at high speed */ - if ((desc-wMaxPacketSize cpu_to_le16(311))) { - if (!gadget_is_dualspeed(gadget)) - return 0; - /* configure your hardware with enough buffering!! */ - } break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 34/46] usb: musb: gadget: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/musb/musb_gadget.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 9e18178..4150baf 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1729,6 +1729,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) INIT_LIST_HEAD(ep-end_point.ep_list); if (!epnum) { usb_ep_set_maxpacket_limit(ep-end_point, 64); + ep-end_point.caps.type_control = true; ep-end_point.ops = musb_g_ep0_ops; musb-g.ep0 = ep-end_point; } else { @@ -1736,9 +1737,20 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) usb_ep_set_maxpacket_limit(ep-end_point, hw_ep-max_packet_sz_tx); else usb_ep_set_maxpacket_limit(ep-end_point, hw_ep-max_packet_sz_rx); + ep-end_point.caps.type_iso = true; + ep-end_point.caps.type_bulk = true; + ep-end_point.caps.type_int = true; ep-end_point.ops = musb_ep_ops; list_add_tail(ep-end_point.ep_list, musb-g.ep_list); } + + if (!epnum || hw_ep-is_shared_fifo) { + ep-end_point.caps.dir_in = true; + ep-end_point.caps.dir_out = true; + } else if (is_in) + ep-end_point.caps.dir_in = true; + else + ep-end_point.caps.dir_out = true; } /* -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 36/46] usb: gadget: atmel_usba_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/atmel_usba_udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 37d414e..267d84f 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2067,6 +2067,17 @@ static struct usba_ep * usba_udc_pdata(struct platform_device *pdev, ep-can_dma = pdata-ep[i].can_dma; ep-can_isoc = pdata-ep[i].can_isoc; + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = ep-can_isoc; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; + if (i) list_add_tail(ep-ep.ep_list, udc-gadget.ep_list); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 35/46] usb: renesas: gadget: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/renesas_usbhs/mod_gadget.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 494dfe0..de4f97d 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -1103,12 +1103,18 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) if (usbhsg_is_dcp(uep)) { gpriv-gadget.ep0 = uep-ep; usb_ep_set_maxpacket_limit(uep-ep, 64); + uep-ep.caps.type_control = true; } /* init normal pipe */ else { usb_ep_set_maxpacket_limit(uep-ep, 512); + uep-ep.caps.type_iso = true; + uep-ep.caps.type_bulk = true; + uep-ep.caps.type_int = true; list_add_tail(uep-ep.ep_list, gpriv-gadget.ep_list); } + uep-ep.caps.dir_in = true; + uep-ep.caps.dir_out = true; } ret = usb_add_gadget_udc(dev, gpriv-gadget); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 25/46] usb: gadget: omap_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/omap_udc.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index e2fcdb8..9b7d394 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -2579,6 +2579,28 @@ omap_ep_setup(char *name, u8 addr, u8 type, ep-double_buf = dbuf; ep-udc = udc; + switch (type) { + case USB_ENDPOINT_XFER_CONTROL: + ep-ep.caps.type_control = true; + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; + break; + case USB_ENDPOINT_XFER_ISOC: + ep-ep.caps.type_iso = true; + break; + case USB_ENDPOINT_XFER_BULK: + ep-ep.caps.type_bulk = true; + break; + case USB_ENDPOINT_XFER_INT: + ep-ep.caps.type_int = true; + break; + }; + + if (addr USB_DIR_IN) + ep-ep.caps.dir_in = true; + else + ep-ep.caps.dir_out = true; + ep-ep.name = ep-name; ep-ep.ops = omap_ep_ops; ep-maxpacket = maxp; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 23/46] usb: gadget: net2272: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/net2272.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index c2ed5da..18f5ebd 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -1404,6 +1404,17 @@ net2272_usb_reinit(struct net2272 *dev) else ep-fifo_size = 64; net2272_ep_reset(ep); + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } usb_ep_set_maxpacket_limit(dev-ep[0].ep, 64); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 20/46] usb: gadget: m66592-udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/m66592-udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 9704053..b1cfa96 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1644,6 +1644,17 @@ static int m66592_probe(struct platform_device *pdev) ep-ep.name = m66592_ep_name[i]; ep-ep.ops = m66592_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, 512); + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } usb_ep_set_maxpacket_limit(m66592-ep[0].ep, 64); m66592-ep[0].pipenum = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 22/46] usb: gadget: mv_udc_core: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/mv_udc_core.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c index 5da37c9..339af51 100644 --- a/drivers/usb/gadget/udc/mv_udc_core.c +++ b/drivers/usb/gadget/udc/mv_udc_core.c @@ -1257,6 +1257,9 @@ static int eps_init(struct mv_udc *udc) ep-wedge = 0; ep-stopped = 0; usb_ep_set_maxpacket_limit(ep-ep, EP0_MAX_PKT_SIZE); + ep-ep.caps.type_control = true; + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; ep-ep_num = 0; ep-ep.desc = mv_ep0_desc; INIT_LIST_HEAD(ep-queue); @@ -1269,14 +1272,20 @@ static int eps_init(struct mv_udc *udc) if (i % 2) { snprintf(name, sizeof(name), ep%din, i / 2); ep-direction = EP_DIR_IN; + ep-ep.caps.dir_in = true; } else { snprintf(name, sizeof(name), ep%dout, i / 2); ep-direction = EP_DIR_OUT; + ep-ep.caps.dir_out = true; } ep-udc = udc; strncpy(ep-name, name, sizeof(ep-name)); ep-ep.name = ep-name; + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + ep-ep.ops = mv_ep_ops; ep-stopped = 0; usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 21/46] usb: gadget: mv_u3d_core: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/mv_u3d_core.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c index ea35a24..4c48969 100644 --- a/drivers/usb/gadget/udc/mv_u3d_core.c +++ b/drivers/usb/gadget/udc/mv_u3d_core.c @@ -1324,6 +1324,9 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d) ep-ep.ops = mv_u3d_ep_ops; ep-wedge = 0; usb_ep_set_maxpacket_limit(ep-ep, MV_U3D_EP0_MAX_PKT_SIZE); + ep-ep.caps.type_control = true; + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; ep-ep_num = 0; ep-ep.desc = mv_u3d_ep0_desc; INIT_LIST_HEAD(ep-queue); @@ -1339,14 +1342,20 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d) if (i 1) { snprintf(name, sizeof(name), ep%din, i 1); ep-direction = MV_U3D_EP_DIR_IN; + ep-ep.caps.dir_in = true; } else { snprintf(name, sizeof(name), ep%dout, i 1); ep-direction = MV_U3D_EP_DIR_OUT; + ep-ep.caps.dir_out = true; } ep-u3d = u3d; strncpy(ep-name, name, sizeof(ep-name)); ep-ep.name = ep-name; + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + ep-ep.ops = mv_u3d_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0); ep-ep_num = i / 2; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 26/46] usb: gadget: pch_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/pch_udc.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index dcf5def..fa9eb3c 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -2895,11 +2895,21 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev) ep-in = ~i 1; ep-ep.name = ep_string[i]; ep-ep.ops = pch_udc_ep_ops; - if (ep-in) + if (ep-in) { ep-offset_addr = ep-num * UDC_EP_REG_SHIFT; - else + ep-ep.caps.dir_in = true; + } else { ep-offset_addr = (UDC_EPINT_OUT_SHIFT + ep-num) * UDC_EP_REG_SHIFT; + ep-ep.caps.dir_out = true; + } + if (i == UDC_EP0IN_IDX || i == UDC_EP0OUT_IDX) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } /* need to set ep-ep.maxpacket and set Default Configuration?*/ usb_ep_set_maxpacket_limit(ep-ep, UDC_BULK_MAX_PKT_SIZE); list_add_tail(ep-ep.ep_list, dev-gadget.ep_list); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 27/46] usb: gadget: pxa25x_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/pxa25x_udc.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c index 27f9442..b4d25dc 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.c +++ b/drivers/usb/gadget/udc/pxa25x_udc.c @@ -1822,6 +1822,8 @@ static struct pxa25x_udc memory = { .name = ep0name, .ops= pxa25x_ep_ops, .maxpacket = EP0_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, .reg_udccs = UDCCS0, @@ -1834,6 +1836,8 @@ static struct pxa25x_udc memory = { .name = ep1in-bulk, .ops= pxa25x_ep_ops, .maxpacket = BULK_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_IN), }, .dev= memory, .fifo_size = BULK_FIFO_SIZE, @@ -1847,6 +1851,8 @@ static struct pxa25x_udc memory = { .name = ep2out-bulk, .ops= pxa25x_ep_ops, .maxpacket = BULK_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_OUT), }, .dev= memory, .fifo_size = BULK_FIFO_SIZE, @@ -1862,6 +1868,8 @@ static struct pxa25x_udc memory = { .name = ep3in-iso, .ops= pxa25x_ep_ops, .maxpacket = ISO_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, + USB_EP_CAPS_DIR_IN), }, .dev= memory, .fifo_size = ISO_FIFO_SIZE, @@ -1875,6 +1883,8 @@ static struct pxa25x_udc memory = { .name = ep4out-iso, .ops= pxa25x_ep_ops, .maxpacket = ISO_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, + USB_EP_CAPS_DIR_OUT), }, .dev= memory, .fifo_size = ISO_FIFO_SIZE, @@ -1889,6 +1899,8 @@ static struct pxa25x_udc memory = { .name = ep5in-int, .ops= pxa25x_ep_ops, .maxpacket = INT_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, + USB_EP_CAPS_DIR_IN), }, .dev= memory, .fifo_size = INT_FIFO_SIZE, @@ -1904,6 +1916,8 @@ static struct pxa25x_udc memory = { .name = ep6in-bulk, .ops= pxa25x_ep_ops, .maxpacket = BULK_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_IN), }, .dev= memory, .fifo_size = BULK_FIFO_SIZE, @@ -1917,6 +1931,8 @@ static struct pxa25x_udc memory = { .name = ep7out-bulk, .ops= pxa25x_ep_ops, .maxpacket = BULK_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_OUT), }, .dev= memory, .fifo_size = BULK_FIFO_SIZE, @@ -1931,6 +1947,8 @@ static struct pxa25x_udc memory = { .name = ep8in-iso, .ops= pxa25x_ep_ops, .maxpacket = ISO_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, + USB_EP_CAPS_DIR_IN), }, .dev= memory, .fifo_size = ISO_FIFO_SIZE, @@ -1944,6 +1962,8 @@ static struct pxa25x_udc memory = { .name = ep9out-iso, .ops= pxa25x_ep_ops, .maxpacket = ISO_FIFO_SIZE, +
[PATCH v5 30/46] usb: gadget: s3c-hsudc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/s3c-hsudc.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c b/drivers/usb/gadget/udc/s3c-hsudc.c index 85a712a..e9def42 100644 --- a/drivers/usb/gadget/udc/s3c-hsudc.c +++ b/drivers/usb/gadget/udc/s3c-hsudc.c @@ -1005,6 +1005,21 @@ static void s3c_hsudc_initep(struct s3c_hsudc *hsudc, hsep-stopped = 0; hsep-wedge = 0; + if (epnum == 0) { + hsep-ep.caps.type_control = true; + hsep-ep.caps.dir_in = true; + hsep-ep.caps.dir_out = true; + } else { + hsep-ep.caps.type_iso = true; + hsep-ep.caps.type_bulk = true; + hsep-ep.caps.type_int = true; + } + + if (epnum 1) + hsep-ep.caps.dir_in = true; + else + hsep-ep.caps.dir_out = true; + set_index(hsudc, epnum); writel(hsep-ep.maxpacket, hsudc-regs + S3C_MPR); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 28/46] usb: gadget: pxa27x_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/pxa27x_udc.h | 40 +++-- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.h b/drivers/usb/gadget/udc/pxa27x_udc.h index 11e1423..cea2cb7 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.h +++ b/drivers/usb/gadget/udc/pxa27x_udc.h @@ -234,25 +234,35 @@ /* * Endpoint definition helpers */ -#define USB_EP_DEF(addr, bname, dir, type, maxpkt) \ -{ .usb_ep = { .name = bname, .ops = pxa_ep_ops, .maxpacket = maxpkt, }, \ +#define USB_EP_DEF(addr, bname, dir, type, maxpkt, ctype, cdir) \ +{ .usb_ep = { .name = bname, .ops = pxa_ep_ops, .maxpacket = maxpkt, \ + .caps = USB_EP_CAPS(ctype, cdir), }, \ .desc = {.bEndpointAddress = addr | (dir ? USB_DIR_IN : 0), \ - .bmAttributes = type, \ + .bmAttributes = USB_ENDPOINT_XFER_ ## type, \ .wMaxPacketSize = maxpkt, }, \ .dev = memory \ } -#define USB_EP_BULK(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_BULK, BULK_FIFO_SIZE) -#define USB_EP_ISO(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_ISOC, ISO_FIFO_SIZE) -#define USB_EP_INT(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_INT, INT_FIFO_SIZE) -#define USB_EP_IN_BULK(n) USB_EP_BULK(n, ep #n in-bulk, 1) -#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, ep #n out-bulk, 0) -#define USB_EP_IN_ISO(n) USB_EP_ISO(n, ep #n in-iso, 1) -#define USB_EP_OUT_ISO(n) USB_EP_ISO(n, ep #n out-iso, 0) -#define USB_EP_IN_INT(n) USB_EP_INT(n, ep #n in-int, 1) -#define USB_EP_CTRLUSB_EP_DEF(0, ep0, 0, 0, EP0_FIFO_SIZE) +#define USB_EP_BULK(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, BULK, BULK_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_BULK, cdir) +#define USB_EP_ISO(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, ISOC, ISO_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_ISO, cdir) +#define USB_EP_INT(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, INT, INT_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_INT, cdir) +#define USB_EP_IN_BULK(n) USB_EP_BULK(n, ep #n in-bulk, 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, ep #n out-bulk, 0, \ + USB_EP_CAPS_DIR_OUT) +#define USB_EP_IN_ISO(n) USB_EP_ISO(n, ep #n in-iso, 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_OUT_ISO(n) USB_EP_ISO(n, ep #n out-iso, 0, \ + USB_EP_CAPS_DIR_OUT) +#define USB_EP_IN_INT(n) USB_EP_INT(n, ep #n in-int, 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_CTRLUSB_EP_DEF(0, ep0, 0, CONTROL, EP0_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL) #define PXA_EP_DEF(_idx, _addr, dir, _type, maxpkt, _config, iface, altset) \ { \ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 33/46] usb: isp1760: udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/isp1760/isp1760-udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c index 3699962..1c3d0fd 100644 --- a/drivers/usb/isp1760/isp1760-udc.c +++ b/drivers/usb/isp1760/isp1760-udc.c @@ -1383,13 +1383,24 @@ static void isp1760_udc_init_eps(struct isp1760_udc *udc) */ if (ep_num == 0) { usb_ep_set_maxpacket_limit(ep-ep, 64); + ep-ep.caps.type_control = true; + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; ep-maxpacket = 64; udc-gadget.ep0 = ep-ep; } else { usb_ep_set_maxpacket_limit(ep-ep, 512); + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; ep-maxpacket = 0; list_add_tail(ep-ep.ep_list, udc-gadget.ep_list); } + + if (is_in) + ep-ep.caps.dir_in = true; + else + ep-ep.caps.dir_out = true; } } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 29/46] usb: gadget: r8a66597-udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/r8a66597-udc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index 0293f71..baa0609 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c @@ -1935,6 +1935,16 @@ static int r8a66597_probe(struct platform_device *pdev) ep-ep.name = r8a66597_ep_name[i]; ep-ep.ops = r8a66597_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, 512); + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; } usb_ep_set_maxpacket_limit(r8a66597-ep[0].ep, 64); r8a66597-ep[0].pipenum = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 31/46] usb: gadget: s3c2410_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/s3c2410_udc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index 5d9aa81..eb3571e 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -1691,6 +1691,8 @@ static struct s3c2410_udc memory = { .name = ep0name, .ops= s3c2410_ep_ops, .maxpacket = EP0_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, }, @@ -1702,6 +1704,8 @@ static struct s3c2410_udc memory = { .name = ep1-bulk, .ops= s3c2410_ep_ops, .maxpacket = EP_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, .fifo_size = EP_FIFO_SIZE, @@ -1714,6 +1718,8 @@ static struct s3c2410_udc memory = { .name = ep2-bulk, .ops= s3c2410_ep_ops, .maxpacket = EP_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, .fifo_size = EP_FIFO_SIZE, @@ -1726,6 +1732,8 @@ static struct s3c2410_udc memory = { .name = ep3-bulk, .ops= s3c2410_ep_ops, .maxpacket = EP_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, .fifo_size = EP_FIFO_SIZE, @@ -1738,6 +1746,8 @@ static struct s3c2410_udc memory = { .name = ep4-bulk, .ops= s3c2410_ep_ops, .maxpacket = EP_FIFO_SIZE, + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, + USB_EP_CAPS_DIR_ALL), }, .dev= memory, .fifo_size = EP_FIFO_SIZE, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 09/46] usb: gadget: at91_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/at91_udc.c | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index 32f50a7..d0d1894 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -59,15 +59,34 @@ #defineDRIVER_VERSION 3 May 2006 static const char driver_name [] = at91_udc; -static const char * const ep_names[] = { - ep0, - ep1, - ep2, - ep3-int, - ep4, - ep5, + +static const struct { + const char *name; + const struct usb_ep_caps caps; +} ep_info[] = { +#define EP_INFO(_name, _caps) \ + { \ + .name = _name, \ + .caps = _caps, \ + } + + EP_INFO(ep0, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep1, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep2, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep3-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep4, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep5, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)), + +#undef EP_INFO }; -#define ep0nameep_names[0] + +#define ep0nameep_info[0].name #define VBUS_POLL_TIMEOUT msecs_to_jiffies(1000) @@ -1831,7 +1850,8 @@ static int at91udc_probe(struct platform_device *pdev) for (i = 0; i NUM_ENDPOINTS; i++) { ep = udc-ep[i]; - ep-ep.name = ep_names[i]; + ep-ep.name = ep_info[i].name; + ep-ep.caps = ep_info[i].caps; ep-ep.ops = at91_ep_ops; ep-udc = udc; ep-int_mask = BIT(i); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 05/46] usb: chipidea: udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/chipidea/udc.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index b7cca3e..4aaa476 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1624,6 +1624,20 @@ static int init_eps(struct ci_hdrc *ci) hwep-ep.name = hwep-name; hwep-ep.ops = usb_ep_ops; + + if (i == 0) { + hwep-ep.caps.type_control = true; + } else { + hwep-ep.caps.type_iso = true; + hwep-ep.caps.type_bulk = true; + hwep-ep.caps.type_int = true; + } + + if (j == TX) + hwep-ep.caps.dir_in = true; + else + hwep-ep.caps.dir_out = true; + /* * for ep0: maxP defined in desc, for other * eps, maxP is set by epautoconfig() called -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 08/46] usb: gadget: amd5536udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/amd5536udc.c | 88 - 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index de7e5e2..fdacddb 100644 --- a/drivers/usb/gadget/udc/amd5536udc.c +++ b/drivers/usb/gadget/udc/amd5536udc.c @@ -138,15 +138,82 @@ static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, /* endpoint names used for print */ static const char ep0_string[] = ep0in; -static const char *const ep_string[] = { - ep0_string, - ep1in-int, ep2in-bulk, ep3in-bulk, ep4in-bulk, ep5in-bulk, - ep6in-bulk, ep7in-bulk, ep8in-bulk, ep9in-bulk, ep10in-bulk, - ep11in-bulk, ep12in-bulk, ep13in-bulk, ep14in-bulk, - ep15in-bulk, ep0out, ep1out-bulk, ep2out-bulk, ep3out-bulk, - ep4out-bulk, ep5out-bulk, ep6out-bulk, ep7out-bulk, - ep8out-bulk, ep9out-bulk, ep10out-bulk, ep11out-bulk, - ep12out-bulk, ep13out-bulk, ep14out-bulk, ep15out-bulk +static const struct { + const char *name; + const struct usb_ep_caps caps; +} ep_info[] = { +#define EP_INFO(_name, _caps) \ + { \ + .name = _name, \ + .caps = _caps, \ + } + + EP_INFO(ep0_string, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep1in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep2in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep3in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep4in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep5in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep6in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep7in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep8in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep9in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep10in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep11in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep12in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep13in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep14in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep15in-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep0out, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep1out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep2out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep3out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep4out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep5out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep6out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep7out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep8out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep9out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep10out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep11out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep12out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep13out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep14out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + EP_INFO(ep15out-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)), + +#undef EP_INFO }; /* DMA usage flag */ @@ -1517,7 +1584,8 @@ static void udc_setup_endpoints(struct udc *dev) for (tmp = 0; tmp UDC_EP_NUM; tmp++) { ep = dev-ep[tmp]; ep-dev = dev; - ep-ep.name = ep_string[tmp]; + ep-ep.name = ep_info[tmp].name; + ep-ep.caps =
[PATCH v5 04/46] staging: emxx_udc: add ep capabilities support
Convert endpoint configuration to new capabilities model. Fixed typo in epc-nulk to epc-bulk. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/staging/emxx_udc/emxx_udc.c | 73 + 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 3b7aa36..b6b76ff 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -3153,36 +3153,46 @@ static const struct usb_gadget_ops nbu2ss_gadget_ops = { .ioctl = nbu2ss_gad_ioctl, }; -static const char g_ep0_name[] = ep0; -static const char g_ep1_name[] = ep1-bulk; -static const char g_ep2_name[] = ep2-bulk; -static const char g_ep3_name[] = ep3in-int; -static const char g_ep4_name[] = ep4-iso; -static const char g_ep5_name[] = ep5-iso; -static const char g_ep6_name[] = ep6-bulk; -static const char g_ep7_name[] = ep7-bulk; -static const char g_ep8_name[] = ep8in-int; -static const char g_ep9_name[] = ep9-iso; -static const char g_epa_name[] = epa-iso; -static const char g_epb_name[] = epb-bulk; -static const char g_epc_name[] = epc-nulk; -static const char g_epd_name[] = epdin-int; - -static const char *gp_ep_name[NUM_ENDPOINTS] = { - g_ep0_name, - g_ep1_name, - g_ep2_name, - g_ep3_name, - g_ep4_name, - g_ep5_name, - g_ep6_name, - g_ep7_name, - g_ep8_name, - g_ep9_name, - g_epa_name, - g_epb_name, - g_epc_name, - g_epd_name, +static const struct { + const char *name; + const struct usb_ep_caps caps; +} ep_info[NUM_ENDPOINTS] = { +#define EP_INFO(_name, _caps) \ + { \ + .name = _name, \ + .caps = _caps, \ + } + + EP_INFO(ep0, + USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep1-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep2-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep3in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep4-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep5-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep6-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep7-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(ep8in-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + EP_INFO(ep9-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_ALL)), + EP_INFO(epa-iso, + USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO, USB_EP_CAPS_DIR_ALL)), + EP_INFO(epb-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(epc-bulk, + USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_ALL)), + EP_INFO(epdin-int, + USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)), + +#undef EP_INFO }; /*-*/ @@ -3200,7 +3210,8 @@ static void __init nbu2ss_drv_ep_init(struct nbu2ss_udc *udc) ep-desc = NULL; ep-ep.driver_data = NULL; - ep-ep.name = gp_ep_name[i]; + ep-ep.name = ep_info[i].name; + ep-ep.caps = ep_info[i].caps; ep-ep.ops = nbu2ss_ep_ops; usb_ep_set_maxpacket_limit(ep-ep, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 03/46] usb: gadget: add endpoint capabilities helper macros
Add macros useful while initializing array of endpoint capabilities structures. These macros makes structure initialization more compact to decrease number of code lines and increase readability of code. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- include/linux/usb/gadget.h | 20 1 file changed, 20 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index a9a4959..82b5bcb 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -158,6 +158,26 @@ struct usb_ep_caps { unsigned dir_out:1; }; +#define USB_EP_CAPS_TYPE_CONTROL 0x01 +#define USB_EP_CAPS_TYPE_ISO 0x02 +#define USB_EP_CAPS_TYPE_BULK0x04 +#define USB_EP_CAPS_TYPE_INT 0x08 +#define USB_EP_CAPS_TYPE_ALL \ + (USB_EP_CAPS_TYPE_ISO | USB_EP_CAPS_TYPE_BULK | USB_EP_CAPS_TYPE_INT) +#define USB_EP_CAPS_DIR_IN 0x01 +#define USB_EP_CAPS_DIR_OUT 0x02 +#define USB_EP_CAPS_DIR_ALL (USB_EP_CAPS_DIR_IN | USB_EP_CAPS_DIR_OUT) + +#define USB_EP_CAPS(_type, _dir) \ + { \ + .type_control = !!(_type USB_EP_CAPS_TYPE_CONTROL), \ + .type_iso = !!(_type USB_EP_CAPS_TYPE_ISO), \ + .type_bulk = !!(_type USB_EP_CAPS_TYPE_BULK), \ + .type_int = !!(_type USB_EP_CAPS_TYPE_INT), \ + .dir_in = !!(_dir USB_EP_CAPS_DIR_IN), \ + .dir_out = !!(_dir USB_EP_CAPS_DIR_OUT), \ + } + /** * struct usb_ep - device side representation of USB endpoint * @name:identifier for the endpoint, such as ep-a or ep9in-bulk -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 06/46] usb: dwc2: gadget: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/dwc2/gadget.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 731b13d..3ee5b4c 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3289,6 +3289,19 @@ static void s3c_hsotg_initep(struct dwc2_hsotg *hsotg, usb_ep_set_maxpacket_limit(hs_ep-ep, epnum ? 1024 : EP0_MPS_LIMIT); hs_ep-ep.ops = s3c_hsotg_ep_ops; + if (epnum == 0) { + hs_ep-ep.caps.type_control = true; + } else { + hs_ep-ep.caps.type_iso = true; + hs_ep-ep.caps.type_bulk = true; + hs_ep-ep.caps.type_int = true; + } + + if (dir_in) + hs_ep-ep.caps.dir_in = true; + else + hs_ep-ep.caps.dir_out = true; + /* * if we're using dma, we need to set the next-endpoint pointer * to be something valid. -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: unisys: Add s-Par visorhba
Hi Greg, I was wondering if you'd had a chance to take a look at this patch, and if you had any additional comments? It should have all of your previous comments addressed. :) -- Ben ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v5 02/46] usb: gadget: add endpoint capabilities flags
From: Robert Baldyga Sent: 31 July 2015 15:00 Introduce struct usb_ep_caps which contains information about capabilities of usb endpoints - supported transfer types and directions. This structure should be filled by UDC driver for each of its endpoints, and will be used in epautoconf in new ep matching mechanism which will replace ugly guessing of endpoint capabilities basing on its name. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- include/linux/usb/gadget.h | 21 + 1 file changed, 21 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 68fb5e8..a9a4959 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -141,10 +141,29 @@ struct usb_ep_ops { }; ... +struct usb_ep_caps { + unsigned type_control:1; + unsigned type_iso:1; + unsigned type_bulk:1; + unsigned type_int:1; + unsigned dir_in:1; + unsigned dir_out:1; +}; With the way this is used (eg below from 13/46) + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; I think it would be more obvious if you used a u8 and explicit bitmasks. The initialisation (as above) would the be explicitly assigning 'not supported' to the other fields. The compiler will also generate much better code... David ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 02/46] usb: gadget: add endpoint capabilities flags
Hi, On Fri, Jul 31, 2015 at 03:51:52PM +, David Laight wrote: From: Robert Baldyga Sent: 31 July 2015 15:00 Introduce struct usb_ep_caps which contains information about capabilities of usb endpoints - supported transfer types and directions. This structure should be filled by UDC driver for each of its endpoints, and will be used in epautoconf in new ep matching mechanism which will replace ugly guessing of endpoint capabilities basing on its name. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- include/linux/usb/gadget.h | 21 + 1 file changed, 21 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 68fb5e8..a9a4959 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -141,10 +141,29 @@ struct usb_ep_ops { }; ... +struct usb_ep_caps { + unsigned type_control:1; + unsigned type_iso:1; + unsigned type_bulk:1; + unsigned type_int:1; + unsigned dir_in:1; + unsigned dir_out:1; +}; With the way this is used (eg below from 13/46) + + if (i == 0) { + ep-ep.caps.type_control = true; + } else { + ep-ep.caps.type_iso = true; + ep-ep.caps.type_bulk = true; + ep-ep.caps.type_int = true; + } + + ep-ep.caps.dir_in = true; + ep-ep.caps.dir_out = true; I think it would be more obvious if you used a u8 and explicit bitmasks. The initialisation (as above) would the be explicitly assigning 'not supported' to the other fields. The compiler will also generate much better code... compiler should convert single bit flags into u32 just fine. It's all static data anyway. Besides, single bit flags allow us to have as many as we need without ending up with stuff like: u32 flags; u32 flags1; u32 flags2; etc. Just let the compiler do those conversions for us. -- balbi signature.asc Description: Digital signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/28] removing the compile warnings for 64-bit
On Fri, Jul 31, 2015 at 04:38:08PM +0900, Tony Cho wrote: Hi Greg, This patch focuses on removing the compile warnings for 64bit incompatability. Most warnings are due to senseless type castings from driver handler to u32 and also to void pointers. They are removed by using the same handler with this series of patch. All warnings disappear. At the end of the series it has no warnings on my 64bit system. But some of the patch in the series increased the number of warnings. Before this series I had 77 warnings. patch 1/28 increased that to 82. patch 4/28 increased the number of warnings to 133. But after that it started gradually decreasing. And at the end 0. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/6] staging: unisys: visornic - prevent lock recursion after IO recovery
From: Tim Sell timothy.s...@unisys.com In the patch which changed the serverdown logic to by synchronous, we were mistakenly holding on to devdata-priv_lock in the call to visornic_serverdown_complete(), which ultimately ended up recursively attempting to grab the same lock via the path: -- dev_close -- visornic_close() -- visornic_disable_with_timeout() Evidence: BUG: spinlock recursion on CPU#0, kworker/u2:0/1567 lock: 0x88002d7e4c90, .magic: dead4ead, .owner: kworker/ .owner_cpu: 0 CPU: 0 PID: 1567 Comm: kworker/u2:0 Tainted: GWC 4.2.0-rc3-ARCH+ #60 Hardware name: Dell Inc. PowerEdge T110/ , BIOS 1.23 12/15/2009 Workqueue: visorchipset_controlvm controlvm_periodic_work [visorbus] 8800216a9380 88002d167878 81476874 061f 88002d7e4c90 88002d167898 8109e2bc 88002d7e4c90 81763d7c 88002d1678b8 8109e330 88002d7e4c90 Call Trace: [81476874] dump_stack+0x4f/0x73 [8109e2bc] spin_dump+0x7c/0xc0 [8109e330] spin_bug+0x30/0x40 [8109e547] do_raw_spin_lock+0x127/0x140 [8147bf8b] _raw_spin_lock_irqsave+0x4b/0x60 [a0168a5c] ? visornic_disable_with_timeout.clone.2+0x3c/ [visornic] [8147c639] ? _raw_spin_unlock_bh+0x39/0x40 [a0168a5c] visornic_disable_with_timeout.clone.2+0x3c/ [visornic] [a0168c6e] visornic_close+0xe/0x20 [visornic] [813ae8d2] __dev_close_many+0x92/0xe0 [813ae9ea] dev_close_many+0x7a/0x110 [81097556] ? down+0x16/0x50 [813af01f] dev_close+0x3f/0x50 [a0166b61] visornic_serverdown+0x91/0x1a0 [visornic] [a0155760] ? device_changestate_responder.clone. [visorbus] [a0166c85] visornic_pause+0x15/0x20 [visornic] [a015101f] initiate_chipset_device_pause_resume+0x9f/0xe0 [visorbus] [a0151093] chipset_device_pause+0x13/0x20 [visorbus] [a0153cbb] device_epilog+0x12b/0x1a0 [visorbus] [a015506b] handle_command+0x72b/0x970 [visorbus] [a015214e] ? visorchannel_signalremove+0x6e/0x80 [visorbus] [a0155521] controlvm_periodic_work+0x271/0x420 [visorbus] [8106cb52] process_one_work+0x1d2/0x540 [8106cab9] ? process_one_work+0x139/0x540 [814771b7] ? __schedule+0x807/0xc30 [8106cf57] worker_thread+0x57/0x4c0 [8106cf00] ? process_scheduled_works+0x40/0x40 [8106cf00] ? process_scheduled_works+0x40/0x40 [81073b19] kthread+0xe9/0x110 [81073a30] ? __init_kthread_worker+0x70/0x70 [8147cddf] ret_from_fork+0x3f/0x70 [81073a30] ? __init_kthread_worker+0x70/0x70 BUG: spinlock lockup suspected on CPU#0, kworker/u2:0/1567 Fixes: f2b70efaf48f (staging: unisys: Make serverdown synchronous) Signed-off-by: Tim Sell timothy.s...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- v2: add missing spin_unlock() --- drivers/staging/unisys/visornic/visornic_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 18b0465..92996fc 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -417,14 +417,15 @@ visornic_serverdown(struct visornic_devdata *devdata, } devdata-server_change_state = true; devdata-server_down_complete_func = complete_func; + spin_unlock_irqrestore(devdata-priv_lock, flags); visornic_serverdown_complete(devdata); } else if (devdata-server_change_state) { dev_dbg(devdata-dev-device, %s changing state\n, __func__); spin_unlock_irqrestore(devdata-priv_lock, flags); return -EINVAL; - } - spin_unlock_irqrestore(devdata-priv_lock, flags); + } else + spin_unlock_irqrestore(devdata-priv_lock, flags); return 0; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/28] staging: wilc1000: change type of driver handler in host interface msg
On Fri, Jul 31, 2015 at 04:38:09PM +0900, Tony Cho wrote: From: glen lee glen@atmel.com This patch changes void pointer type of drvHandler with WILC_WFIDrvHandle type variable since the structure member drvHandler in tstrHostIFmsg is explicitly used to pass driver pointer as handler. The void pointer as argument is ambiguous for the functions to handle correctly. After this patch, ATWILC_WFIDrvHandle type will be used as handler type to interface with other functions which does not need to know all about wifi driver structre tstrATWILC_WFIDrv. As a consequence of this patch, several patches will be followed up to change type of parameter which take drvHandler as argument. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 02aaf39..fb4194a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -467,7 +467,7 @@ typedef union _tuniHostIFmsgBody { typedef struct _tstrHostIFmsg { u16 u16MsgId; /*! Message ID */ tuniHostIFmsgBody uniHostIFmsgBody; /*! Message body */ - void *drvHandler; + WILC_WFIDrvHandle drvHandler; } tstrHostIFmsg; #ifdef CONNECT_DIRECT This patch adds build warnings to the tree, which isn't ok. Change the variable type and then fix up the places it is used in the same patch. Right now you have a bunch more warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] added, which isn't ok. Each patch in a series should do one logical thing, and never add more build warnings to the build. Please rework this series to do this correctly. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 24/28] staging: wilc1000: fix cast from pointer to integer warning
On Fri, Jul 31, 2015 at 04:38:32PM +0900, Tony Cho wrote: From: glen lee glen@atmel.com To use a pointer as as integer in arithmetic operation, cast type to uintptr_t as the data type. This patch changes casting (unsigned int) with (uintptr_t) to do arithmetic operation Here is build warning. drivers/staging/wilc1000/linux_wlan.c:2385:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] skb_reserve(skb, (unsigned int)skb-data 0x3); Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 5dcb30c..ec80849 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -2382,7 +2382,7 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset) return; } - skb_reserve(skb, (unsigned int)skb-data 0x3); + skb_reserve(skb, (uintptr_t)skb-data 0x3); Why is a cast needed at all here? And again, don't use uintptr_t, it is not a kernel type. I've stopped reviewing here, sorry, please fix up the series and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: wilc1000 :Insert blank line after declaration
On Fri, Jul 31, 2015 at 10:55:40AM +0530, Shraddha Barke wrote: This patch fixes the following checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: Shraddha Barke shraddha.6...@gmail.com Please add a blank line and resend. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/28] staging: wilc1000: change void type of argument with WILC_WFIDrvHandle
On Fri, Jul 31, 2015 at 04:38:10PM +0900, Tony Cho wrote: From: glen lee glen@atmel.com This should probably be Glen Lee, right? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] linux-next: drivers: staging: most: Fix return value
* Fix sparse warning Using plain integer as NULL pointer Signed-off-by: Michael Hornung mhornung.li...@gmail.com --- drivers/staging/most/aim-network/networking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c index 4639c49..c8ab239 100644 --- a/drivers/staging/most/aim-network/networking.c +++ b/drivers/staging/most/aim-network/networking.c @@ -311,7 +311,7 @@ static struct net_dev_context *get_net_dev_context( } } spin_unlock(list_lock); - return 0; + return NULL; } static int aim_probe_channel(struct most_interface *iface, int channel_idx, -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 28/28] staging: wilc1000: change data type of variable
On Fri, Jul 31, 2015 at 04:38:36PM +0900, Tony Cho wrote: From: glen lee glen@atmel.com drvHandler of u32 type is used to handle integer type pointer operation which cause build warnings. To use integer type varialbe as pointer, drvHandler data type need to be changed with uintptr_t type. drivers/staging/wilc1000/host_interface.c: In function ‘NetworkInfoReceived’: drivers/staging/wilc1000/host_interface.c:6767:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; ^ drivers/staging/wilc1000/host_interface.c: In function ‘GnrlAsyncInfoReceived’: drivers/staging/wilc1000/host_interface.c:6819:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; ^ drivers/staging/wilc1000/host_interface.c: In function ‘host_int_ScanCompleteReceived’: drivers/staging/wilc1000/host_interface.c:6878:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b36f98c..668e47e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6760,7 +6760,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - u32 drvHandler; + uintptr_t drvHandler; This isn't a valid kernel type, use unsigned int * if that is what you mean. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging:wilc1000 :Remove typedef from struct
On Fri, Jul 31, 2015 at 11:08:47AM +0530, Shraddha Barke wrote: This patch fixes the following checkpatch.pl warning: WARNING: do not add new typedefs Signed-off-by: Shraddha Barke shraddha.6...@gmail.com --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 54eb8a1..d6ef6e1 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -88,7 +88,7 @@ typedef enum { } tenuFrmSubtype; /* Basic Frame Classes */ -typedef enum { +enum { CLASS1_FRAME_TYPE = 0x00, CLASS2_FRAME_TYPE = 0x01, CLASS3_FRAME_TYPE = 0x02, Did you test-build this change? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 25/28] staging: wilc1000: change cast type from pointer to uintptr_t
On Fri, Jul 31, 2015 at 04:38:33PM +0900, Tony Cho wrote: From: glen lee glen@atmel.com To use drvHandler as integer operation, cast type to uintptr_t. Here is the build warning. drivers/staging/wilc1000/wilc_wlan.c:1871:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] int driver_handler = (u32)drvHandler; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index ec80849..14c2071 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1056,7 +1056,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n goto _fail_; } - *(int *)c_val = (u32)pstrWFIDrv; + *(int *)c_val = (uintptr_t)pstrWFIDrv; Why is the cast needed at all? if (!g_linux_wlan-oup.wlan_cfg_set(1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0)) goto _fail_; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f5075b26..2cc23d5 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1868,7 +1868,7 @@ static int wilc_wlan_cfg_commit(int type, WILC_WFIDrvHandle drvHandler) wilc_cfg_frame_t *cfg = p-cfg_frame; int total_len = p-cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE; int seq_no = p-cfg_seq_no % 256; - int driver_handler = (u32)drvHandler; + int driver_handler = (uintptr_t)drvHandler; You can't cast a pointer to an integer, it does not work on all systems, which is what the compiler warnings is telling you. If this really is a pointer, use a pointer, otherwise, use an integer, but don't cast between the two. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: panel: fix block comment usage
Fixed two coding style warnings concerning multiline comments. Signed-off-by: Alex Wilson alex.david.wil...@gmail.com --- drivers/staging/panel/panel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index bda208d..3e9ee7e 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -781,14 +781,18 @@ static void long_sleep(int ms) schedule_timeout_interruptible(msecs_to_jiffies(ms)); } -/* send a serial byte to the LCD panel. The caller is responsible for locking - if needed. */ +/* + * send a serial byte to the LCD panel. The caller is responsible for locking + * if needed. + */ static void lcd_send_serial(int byte) { int bit; - /* the data bit is set on D0, and the clock on STROBE. -* LCD reads D0 on STROBE's rising edge. */ + /* +* the data bit is set on D0, and the clock on STROBE. +* LCD reads D0 on STROBE's rising edge. +*/ for (bit = 0; bit 8; bit++) { bits.cl = BIT_CLR; /* CLK low */ panel_set_bits(); -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging : wilc1000 :Remove typedef from struct
On Fri, 2015-07-31 at 11:02 +0530, Shraddha Barke wrote: This patch fixes the following checkpatch.pl warning: WARNING: do not add new typedefs Signed-off-by: Shraddha Barke shraddha.6...@gmail.com --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 0f31d63..54eb8a1 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -140,7 +140,7 @@ typedef enum { } tenuInfoElemID; -typedef struct { +struct { char *pcRespBuffer; s32 s32MaxRespBuffLen; s32 s32BytesRead; You haven't compiled this. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/28] staging: wilc1000: change type of argument 5 in SendConfigPkt
From: glen lee glen@atmel.com This patch changes drvHandler of u32 type with WILC_WFIDrvHandle type since SendConfigPkt function gets WILC_WFIDrvHandle type driver Handler pointer as argument which makes compile warning. As the type of parameter changed, associate code will be changed in the next patches. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 342a336..e1928cc 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -1986,7 +1986,7 @@ extern wilc_wlan_oup_t *gpstrWlanOps; * @version 1.0 */ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs, - u32 u32WIDsCount, bool bRespRequired, u32 drvHandler) + u32 u32WIDsCount, bool bRespRequired, WILC_WFIDrvHandle drvHandler) { s32 counter = 0, ret = 0; if (gpstrWlanOps == NULL) { diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 56ff2ba..98b5c49 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -167,7 +167,7 @@ extern s32 CoreConfiguratorInit(void); extern s32 CoreConfiguratorDeInit(void); extern s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs, -u32 u32WIDsCount, bool bRespRequired, u32 drvHandler); +u32 u32WIDsCount, bool bRespRequired, WILC_WFIDrvHandle drvHandler); extern s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo); extern s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/28] staging: wilc1000: remove unnecessary type cast
From: glen lee glen@atmel.com This patch removes unnecessary type cast since the u32 type of argument 5 in SendConfigPkt was changed with WILC_WFIDrvHandle. Therefore, No need to cast u32. Type cast (u32) cause build warning like below. drivers/staging/wilc1000/host_interface.c:622:54: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 100 +++--- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 68762d2..265ff68 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -617,7 +617,7 @@ static s32 Handle_SetChannel(WILC_WFIDrvHandle drvHandler, tstrHostIFSetChan *ps PRINT_D(HOSTINF_DBG, Setting channel\n); /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); if (s32Error) { PRINT_ER(Failed to set channel\n); WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE); @@ -654,7 +654,7 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); if ((pstrHostIfSetDrvHandler-u32Address) == (u32)NULL) @@ -699,7 +699,7 @@ static s32 Handle_SetOperationMode(WILC_WFIDrvHandle drvHandler, tstrHostIfSetOp /*Sending Cfg*/ PRINT_INFO(HOSTINF_DBG, pstrWFIDrv= %p\n, pstrWFIDrv); - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL) @@ -748,7 +748,7 @@ s32 Handle_set_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) strWID.ps8WidVal = (u8 *)pu8IPAddr; strWID.s32ValueSize = IP_ALEN; - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); @@ -792,7 +792,7 @@ s32 Handle_get_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) strWID.ps8WidVal = (u8 *)WILC_MALLOC(IP_ALEN); strWID.s32ValueSize = IP_ALEN; - s32Error = SendConfigPkt(GET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(GET_CFG, strWID, 1, true, pstrWFIDrv); PRINT_INFO(HOSTINF_DBG, %pI4\n, strWID.ps8WidVal); @@ -853,7 +853,7 @@ static s32 Handle_SetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfSetMacAd strWID.s32ValueSize = ETH_ALEN; PRINT_D(GENERIC_DBG, mac addr = :%x:%x:%x:%x:%x:%x\n, strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]); /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); if (s32Error) { PRINT_ER(Failed to set mac address\n); WILC_ERRORREPORT(s32Error, WILC_FAIL); @@ -891,7 +891,7 @@ static s32 Handle_GetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfGetMacAd strWID.s32ValueSize = ETH_ALEN; /*Sending Cfg*/ - s32Error = SendConfigPkt(GET_CFG, strWID, 1, false, (u32)drvHandler); + s32Error = SendConfigPkt(GET_CFG, strWID, 1, false, drvHandler); if (s32Error) { PRINT_ER(Failed to get mac address\n); WILC_ERRORREPORT(s32Error, WILC_FAIL); @@ -1199,7 +1199,7 @@ static s32 Handle_CfgParam(WILC_WFIDrvHandle drvHandler, tstrHostIFCfgParamAttr } u8WidCnt++; } - s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, false, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, false, pstrWFIDrv); if (s32Error) PRINT_ER(Error in setting CFG params\n); @@ -1357,7 +1357,7 @@ static s32 Handle_Scan(WILC_WFIDrvHandle drvHandler, tstrHostIFscanAttr *pstrHos gbScanWhileConnected = false; } - s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, (u32)pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, pstrWFIDrv); if (s32Error) { PRINT_ER(Failed to send scan paramters config packet\n); @@ -1434,7 +1434,7 @@ static s32 Handle_ScanDone(WILC_WFIDrvHandle drvHandler, tenuScanEvent enuEvent) strWID.s32ValueSize = sizeof(char); /*Sending
[PATCH 02/28] staging: wilc1000: change void type of argument with WILC_WFIDrvHandle
From: glen lee glen@atmel.com This patch changes void pointer type of parameter with WILC_WFIDrvHandle type in all functions which take drvHandler in tstrHostIFmsg as a function argument since the type of drvHandler in tstrHostIFmsg was changed with WILC_WFIDrvHandle. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 74 +++ drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index fb4194a..68762d2 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -602,7 +602,7 @@ extern int linux_wlan_get_num_conn_ifcs(void); * @date * @version 1.0 */ -static s32 Handle_SetChannel(void *drvHandler, tstrHostIFSetChan *pstrHostIFSetChan) +static s32 Handle_SetChannel(WILC_WFIDrvHandle drvHandler, tstrHostIFSetChan *pstrHostIFSetChan) { s32 s32Error = WILC_SUCCESS; @@ -682,7 +682,7 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand * @date * @version 1.0 */ -static s32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperationMode *pstrHostIfSetOperationMode) +static s32 Handle_SetOperationMode(WILC_WFIDrvHandle drvHandler, tstrHostIfSetOperationMode *pstrHostIfSetOperationMode) { s32 s32Error = WILC_SUCCESS; @@ -727,7 +727,7 @@ static s32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperationMode * @date * @version 1.0 */ -s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) +s32 Handle_set_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) { s32 s32Error = WILC_SUCCESS; @@ -779,7 +779,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) * @date * @version 1.0 */ -s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) +s32 Handle_get_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) { s32 s32Error = WILC_SUCCESS; @@ -832,7 +832,7 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) * @date November 2013 * @version 7.0 */ -static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrHostIfSetMacAddress) +static s32 Handle_SetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfSetMacAddress *pstrHostIfSetMacAddress) { s32 s32Error = WILC_SUCCESS; @@ -878,7 +878,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH * @date JAN 2013 * @version 8.0 */ -static s32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddress *pstrHostIfGetMacAddress) +static s32 Handle_GetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfGetMacAddress *pstrHostIfGetMacAddress) { s32 s32Error = WILC_SUCCESS; @@ -915,7 +915,7 @@ static s32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddress *pstrH * @date * @version 1.0 */ -static s32 Handle_CfgParam(void *drvHandler, tstrHostIFCfgParamAttr *strHostIFCfgParamAttr) +static s32 Handle_CfgParam(WILC_WFIDrvHandle drvHandler, tstrHostIFCfgParamAttr *strHostIFCfgParamAttr) { s32 s32Error = WILC_SUCCESS; tstrWID strWIDList[32]; @@ -1239,7 +1239,7 @@ static s32 Handle_wait_msg_q_empty(void) * @date * @version 1.0 */ -static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr) +static s32 Handle_Scan(WILC_WFIDrvHandle drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr) { s32 s32Error = WILC_SUCCESS; tstrWID strWIDList[5]; @@ -1410,7 +1410,7 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr) * @date * @version 1.0 */ -static s32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent) +static s32 Handle_ScanDone(WILC_WFIDrvHandle drvHandler, tenuScanEvent enuEvent) { s32 s32Error = WILC_SUCCESS; @@ -1470,7 +1470,7 @@ static s32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent) * @version 1.0 */ u8 u8ConnectedSSID[6] = {0}; -static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFconnectAttr) +static s32 Handle_Connect(WILC_WFIDrvHandle drvHandler, tstrHostIFconnectAttr *pstrHostIFconnectAttr) { tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler; s32 s32Error = WILC_SUCCESS; @@ -2039,7 +2039,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon * @version 8.0 */ -static s32 Handle_FlushConnect(void *drvHandler) +static s32 Handle_FlushConnect(WILC_WFIDrvHandle drvHandler) { s32 s32Error = WILC_SUCCESS; tstrWID strWIDList[5]; @@ -2106,7 +2106,7 @@ static s32 Handle_FlushConnect(void *drvHandler) * @date * @version 1.0 */ -static s32 Handle_ConnectTimeout(void
[PATCH 00/28] removing the compile warnings for 64-bit
Hi Greg, This patch focuses on removing the compile warnings for 64bit incompatability. Most warnings are due to senseless type castings from driver handler to u32 and also to void pointers. They are removed by using the same handler with this series of patch. All warnings disappear. This patch is the first step to resolve many issues which the driver contains. Please review and advise me. Thanks, Tony. glen lee (28): staging: wilc1000: change type of driver handler in host interface msg staging: wilc1000: change void type of argument with WILC_WFIDrvHandle staging: wilc1000: move structure WILC_WFIDrvHandle into wilc_wlan_if.h staging: wilc1000: change type of argument 5 in SendConfigPkt staging: wilc1000: remove unnecessary type cast staging: wilc1000: chage driver handler variable in SendConfigPkt staging: wilc1000: remove unused variables staging: wilc1000: change drvHandler type in wlan_cfg_get staging: wilc1000: change drvHandler type in wlan_cfg_set staging: wilc1000: change driver handle variable staging: wilc1000: fix incompatible type in assignment warning staging: wilc1000: change type of driver handler in tstrInterfaceInfo staging: wilc1000: change type of argument in host_int_set_wfi_drv_handler staging: wilc1000: remove unnecessary type cast in host_int_set_wfi_drv_handler staging: wilc1000: fix cast from pointer to integer warning staging: wilc1000: change type of variable staging: wilc1000: fix comparison between different type warning staging: wilc1000: change pstrWFIDrv with drvHandler staging: wilc1000: change type of variable in tstrHostIfSetDrvHandler staging: wilc1000: remove unnecessary type case staging: wilc1000: remove unwanted type cast staging: wilc1000: fix passing argument from incompatible type warning staging: wilc1000: change type of parameter in wilc_wlan_cfg_commit staging: wilc1000: fix cast from pointer to integer warning staging: wilc1000: change cast type from pointer to uintptr_t staging: wilc1000: remove unused variable staging: wilc1000: fix casting build warning staging: wilc1000: change data type of variable drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 232 ++ drivers/staging/wilc1000/host_interface.h | 9 +- drivers/staging/wilc1000/linux_wlan.c | 8 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 8 +- drivers/staging/wilc1000/wilc_wlan_if.h | 8 +- 9 files changed, 130 insertions(+), 145 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/28] staging: wilc1000: change type of driver handler in host interface msg
From: glen lee glen@atmel.com This patch changes void pointer type of drvHandler with WILC_WFIDrvHandle type variable since the structure member drvHandler in tstrHostIFmsg is explicitly used to pass driver pointer as handler. The void pointer as argument is ambiguous for the functions to handle correctly. After this patch, ATWILC_WFIDrvHandle type will be used as handler type to interface with other functions which does not need to know all about wifi driver structre tstrATWILC_WFIDrv. As a consequence of this patch, several patches will be followed up to change type of parameter which take drvHandler as argument. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 02aaf39..fb4194a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -467,7 +467,7 @@ typedef union _tuniHostIFmsgBody { typedef struct _tstrHostIFmsg { u16 u16MsgId; /*! Message ID */ tuniHostIFmsgBody uniHostIFmsgBody; /*! Message body */ - void *drvHandler; + WILC_WFIDrvHandle drvHandler; } tstrHostIFmsg; #ifdef CONNECT_DIRECT -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/28] staging: wilc1000: move structure WILC_WFIDrvHandle into wilc_wlan_if.h
From: glen lee glen@atmel.com This patch moves the structure WILC_WFIDrvHandle into wilc_wlan_if.h As all the functions which take drive handler as argument will use WILC_WFIDrvHandle type instead of u32 type that makes compile warning due to type difference, move it into wilc_wlan_if which is common wilc header file. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.h | 3 --- drivers/staging/wilc1000/wilc_wlan_if.h | 4 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 7699650..617f105 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -212,9 +212,6 @@ typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback f #endif /* typedef u32 WILC_WFIDrvHandle; */ -typedef struct { - s32 s32Dummy; -} *WILC_WFIDrvHandle; /*! * @struct tstrRcvdNetworkInfo diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 8735a6a..ba22d30 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -63,6 +63,10 @@ / typedef struct { + s32 s32Dummy; +} *WILC_WFIDrvHandle; + +typedef struct { uint32_t read_write: 1; uint32_t function: 3; uint32_t raw: 1; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/28] staging: wilc1000: chage driver handler variable in SendConfigPkt
From: glen lee glen@atmel.com This patch changes pstrWFIDrv with WILC_WFIDrvHandle type variable as a argument of SendConfigPkt in all associate code because the type of argument 5 in SendConfigPkt was changed with WILC_WFIDrvHandle type. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 92 +++ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 265ff68..c8ebf51 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -617,7 +617,7 @@ static s32 Handle_SetChannel(WILC_WFIDrvHandle drvHandler, tstrHostIFSetChan *ps PRINT_D(HOSTINF_DBG, Setting channel\n); /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); if (s32Error) { PRINT_ER(Failed to set channel\n); WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE); @@ -699,7 +699,7 @@ static s32 Handle_SetOperationMode(WILC_WFIDrvHandle drvHandler, tstrHostIfSetOp /*Sending Cfg*/ PRINT_INFO(HOSTINF_DBG, pstrWFIDrv= %p\n, pstrWFIDrv); - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL) @@ -748,7 +748,7 @@ s32 Handle_set_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) strWID.ps8WidVal = (u8 *)pu8IPAddr; strWID.s32ValueSize = IP_ALEN; - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); @@ -792,7 +792,7 @@ s32 Handle_get_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) strWID.ps8WidVal = (u8 *)WILC_MALLOC(IP_ALEN); strWID.s32ValueSize = IP_ALEN; - s32Error = SendConfigPkt(GET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(GET_CFG, strWID, 1, true, drvHandler); PRINT_INFO(HOSTINF_DBG, %pI4\n, strWID.ps8WidVal); @@ -853,7 +853,7 @@ static s32 Handle_SetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfSetMacAd strWID.s32ValueSize = ETH_ALEN; PRINT_D(GENERIC_DBG, mac addr = :%x:%x:%x:%x:%x:%x\n, strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]); /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); if (s32Error) { PRINT_ER(Failed to set mac address\n); WILC_ERRORREPORT(s32Error, WILC_FAIL); @@ -1199,7 +1199,7 @@ static s32 Handle_CfgParam(WILC_WFIDrvHandle drvHandler, tstrHostIFCfgParamAttr } u8WidCnt++; } - s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, false, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, false, drvHandler); if (s32Error) PRINT_ER(Error in setting CFG params\n); @@ -1357,7 +1357,7 @@ static s32 Handle_Scan(WILC_WFIDrvHandle drvHandler, tstrHostIFscanAttr *pstrHos gbScanWhileConnected = false; } - s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, drvHandler); if (s32Error) { PRINT_ER(Failed to send scan paramters config packet\n); @@ -1434,7 +1434,7 @@ static s32 Handle_ScanDone(WILC_WFIDrvHandle drvHandler, tenuScanEvent enuEvent) strWID.s32ValueSize = sizeof(char); /*Sending Cfg*/ - s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); if (s32Error != WILC_SUCCESS) { PRINT_ER(Failed to set abort running scan\n); WILC_ERRORREPORT(s32Error, WILC_FAIL); @@ -1631,7 +1631,7 @@ static s32 Handle_Connect(WILC_WFIDrvHandle drvHandler, tstrHostIFconnectAttr *p gu32WidConnRstHack = 0; /* // */ - s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, pstrWFIDrv); + s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, drvHandler); if (s32Error) { PRINT_ER(Handle_Connect()] failed to send config packet\n); WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE); @@ -1954,7 +1954,7 @@ static s32 Handle_Connect(WILC_WFIDrvHandle drvHandler, tstrHostIFconnectAttr *p
[PATCH 15/28] staging: wilc1000: fix cast from pointer to integer warning
From: glen lee glen@atmel.com This patch removes unnecessary type cast because drvHandler type was change with WILC_WFIDrvHandle. drivers/staging/wilc1000/linux_wlan.c:2014:51: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] g_linux_wlan-strInterfaceInfo[i].drvHandler = (u32)priv-hWILCWFIDrv; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index a808722..5dcb30c 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -2011,7 +2011,7 @@ int mac_open(struct net_device *ndev) for (i = 0; i g_linux_wlan-u8NoIfcs; i++) { if (ndev == g_linux_wlan-strInterfaceInfo[i].wilc_netdev) { memcpy(g_linux_wlan-strInterfaceInfo[i].aSrcAddress, mac_add, ETH_ALEN); - g_linux_wlan-strInterfaceInfo[i].drvHandler = (u32)priv-hWILCWFIDrv; + g_linux_wlan-strInterfaceInfo[i].drvHandler = priv-hWILCWFIDrv; break; } } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/28] staging: wilc1000: change drvHandler type in wlan_cfg_set
From: glen lee glen@atmel.com This patch changes drvHandler of uint32_t type with WILC_WFIDrvHandle type in wlan_cfg_set and wilc_wlan_cfg_set. The type of drvHandler which wlan_cfg_set take as argument was changed to WILC_WFIDrvHandle. So the type needs to be changed to match parameter type. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/wilc_wlan.c| 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 273073f..d5fc54b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1899,7 +1899,7 @@ static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler) return 0; } -static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t buffer_size, int commit, uint32_t drvHandler) +static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t buffer_size, int commit, WILC_WFIDrvHandle drvHandler) { wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)g_wlan; uint32_t offset; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 6d2d588..d9d592aa 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -197,7 +197,7 @@ typedef struct { void (*wlan_handle_rx_que)(void); void (*wlan_handle_rx_isr)(void); void (*wlan_cleanup)(void); - int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t); + int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, WILC_WFIDrvHandle); int (*wlan_cfg_get)(int, uint32_t, int, WILC_WFIDrvHandle); int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); /*Bug3959: transmitting mgmt frames received from host*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/28] staging: wilc1000: fix incompatible type in assignment warning
From: glen lee glen@atmel.com Cast type to WILC_WFIDrvHandle before assignment from incompatible pointer type to fix the following warning. drivers/staging/wilc1000/host_interface.c:6916:27: warning: assignment from incompatible pointer type [enabled by default] strHostIFmsg.drvHandler = pstrWFIDrv; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 66565f6..e9cd77d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3981,7 +3981,7 @@ static void ListenTimerCB(void *pvArg) /* prepare the Timer Callback message */ WILC_memset(strHostIFmsg, 0, sizeof(tstrHostIFmsg)); strHostIFmsg.u16MsgId = HOST_IF_MSG_LISTEN_TIMER_FIRED; - strHostIFmsg.drvHandler = pstrWFIDrv; + strHostIFmsg.drvHandler = (WILC_WFIDrvHandle)pstrWFIDrv; strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan.u32ListenSessionID = pstrWFIDrv-strHostIfRemainOnChan.u32ListenSessionID; /* send the message */ @@ -6425,7 +6425,7 @@ void GetPeriodicRSSI(void *pvArg) WILC_memset(strHostIFmsg, 0, sizeof(tstrHostIFmsg)); strHostIFmsg.u16MsgId = HOST_IF_MSG_GET_RSSI; - strHostIFmsg.drvHandler = pstrWFIDrv; + strHostIFmsg.drvHandler = (WILC_WFIDrvHandle)pstrWFIDrv; /* send the message */ s32Error = WILC_MsgQueueSend(gMsgQHostIF, strHostIFmsg, sizeof(tstrHostIFmsg), NULL); @@ -6779,7 +6779,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length) WILC_memset(strHostIFmsg, 0, sizeof(tstrHostIFmsg)); strHostIFmsg.u16MsgId = HOST_IF_MSG_RCVD_NTWRK_INFO; - strHostIFmsg.drvHandler = pstrWFIDrv; + strHostIFmsg.drvHandler = (WILC_WFIDrvHandle)pstrWFIDrv; strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.u32Length = u32Length; strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.pu8Buffer = (u8 *)WILC_MALLOC(u32Length); /* will be deallocated by the receiving thread */ @@ -6841,7 +6841,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length) strHostIFmsg.u16MsgId = HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO; - strHostIFmsg.drvHandler = pstrWFIDrv; + strHostIFmsg.drvHandler = (WILC_WFIDrvHandle)pstrWFIDrv; strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.u32Length = u32Length; @@ -6890,7 +6890,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length) WILC_memset(strHostIFmsg, 0, sizeof(tstrHostIFmsg)); strHostIFmsg.u16MsgId = HOST_IF_MSG_RCVD_SCAN_COMPLETE; - strHostIFmsg.drvHandler = pstrWFIDrv; + strHostIFmsg.drvHandler = (WILC_WFIDrvHandle)pstrWFIDrv; /* will be deallocated by the receiving thread */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/28] staging: wilc1000: change type of variable
From: glen lee glen@atmel.com This patch changes gu8FlushedJoinReqDrvHandler of u32 type with WILC_WFIDrvHandle type. gu8FlushedJoinReqDrvHandler is used to hold driver handler for comparison but the type mismatches with it. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 38d047d..d5bd23d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -579,7 +579,7 @@ u8 gu8Flushed11iMode; u8 gu8FlushedAuthType; u32 gu32FlushedJoinReqSize; u32 gu32FlushedInfoElemAsocSize; -u32 gu8FlushedJoinReqDrvHandler; +WILC_WFIDrvHandle gu8FlushedJoinReqDrvHandler; #define REAL_JOIN_REQ 0 #define FLUSHED_JOIN_REQ 1 #define FLUSHED_BYTE_POS 79 /* Position the byte indicating flushing in the flushed request */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/28] staging: wilc1000: change driver handle variable
From: glen lee glen@atmel.com This patch change (u32)pstrWFIDrv with priv-hWILCWFIDrv as a argument of wlan_cfg_set since the parameter drvHandler of uint32_t type in wlan_cfg_set was changed with WILC_WFIDrvHandle. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 3e55a8a..a808722 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1295,7 +1295,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n goto _fail_; c_val[0] = 1; /* Enable N with immediate block ack. */ - if (!g_linux_wlan-oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, (u32)pstrWFIDrv)) + if (!g_linux_wlan-oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, priv-hWILCWFIDrv)) goto _fail_; return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/28] staging: wilc1000: change type of driver handler in tstrInterfaceInfo
From: glen lee glen@atmel.com This patch changes drvHandler of uint32_t type with WILC_WFIDrvHandle type since drvHandler is used to pass WILC_WFIDrvHandle type to other functions. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 0dfe108..e581b09 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -176,7 +176,7 @@ typedef struct { typedef struct { uint8_t aSrcAddress[ETH_ALEN]; uint8_t aBSSID[ETH_ALEN]; - uint32_t drvHandler; + WILC_WFIDrvHandle drvHandler; struct net_device *wilc_netdev; } tstrInterfaceInfo; typedef struct { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/28] staging: wilc1000: remove unnecessary type cast in host_int_set_wfi_drv_handler
From: glen lee glen@atmel.com This patch removes unnecessary type cast since the u32 type parameter in host_int_set_wfi_drv_handler was changed with WILC_WFIDrvHandle. Therefore, No need to cast u32. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index c2ef46f..d077aed 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -736,7 +736,7 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *r priv-u32RcvdChCount = 0; - host_int_set_wfi_drv_handler((u32)priv-hWILCWFIDrv); + host_int_set_wfi_drv_handler(priv-hWILCWFIDrv); reset_shadow_found(priv); @@ -831,7 +831,7 @@ static int WILC_WFI_CfgConnect(struct wiphy *wiphy, struct net_device *dev, priv = wiphy_priv(wiphy); pstrWFIDrv = (tstrWILC_WFIDrv *)(priv-hWILCWFIDrv); - host_int_set_wfi_drv_handler((u32)priv-hWILCWFIDrv); + host_int_set_wfi_drv_handler(priv-hWILCWFIDrv); PRINT_D(CFG80211_DBG, Connecting to SSID [%s] on netdev [%p] host if [%p]\n, sme-ssid, dev, priv-hWILCWFIDrv); #ifdef WILC_P2P -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/28] staging: wilc1000: change type of argument in host_int_set_wfi_drv_handler
From: glen lee glen@atmel.com The parameter of u32 type is incompatible with the argument of WILC_WFIDrvHandle type which host_int_set_wfi_drv_handler takes always as input. Therefore, this patch changes parameter of u32 type with WILC_WFIDrvHandle type in the function host_int_set_wfi_drv_handler. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e9cd77d..38d047d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -5792,7 +5792,7 @@ s32 host_int_wait_msg_queue_idle(void) } -s32 host_int_set_wfi_drv_handler(u32 u32address) +s32 host_int_set_wfi_drv_handler(WILC_WFIDrvHandle u32address) { s32 s32Error = WILC_SUCCESS; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 617f105..2ced05f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -1256,7 +1256,7 @@ s32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, u16 u16FrameType, bool bR * @date * @version 1.0 */ -s32 host_int_set_wfi_drv_handler(u32 u32address); +s32 host_int_set_wfi_drv_handler(WILC_WFIDrvHandle u32address); s32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, u32 u32mode); static s32 Handle_ScanDone(WILC_WFIDrvHandle drvHandler, tenuScanEvent enuEvent); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/28] staging: wilc1000: change drvHandler type in wlan_cfg_get
From: glen lee glen@atmel.com This patch changes drvHandler of uint32_t type with WILC_WFIDrvHandle type in wlan_cfg_get and wilc_wlan_cfg_get. The type of drvHandler which wlan_cfg_get take as argument was changed to WILC_WFIDrvHandle. So the type needs to be changed to match parameter type. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/wilc_wlan.c| 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index def72fd..273073f 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1938,7 +1938,7 @@ static int wilc_wlan_cfg_set(int start, uint32_t wid, uint8_t *buffer, uint32_t return ret_size; } -static int wilc_wlan_cfg_get(int start, uint32_t wid, int commit, uint32_t drvHandler) +static int wilc_wlan_cfg_get(int start, uint32_t wid, int commit, WILC_WFIDrvHandle drvHandler) { wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)g_wlan; uint32_t offset; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index ba22d30..6d2d588 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -198,7 +198,7 @@ typedef struct { void (*wlan_handle_rx_isr)(void); void (*wlan_cleanup)(void); int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t); - int (*wlan_cfg_get)(int, uint32_t, int, uint32_t); + int (*wlan_cfg_get)(int, uint32_t, int, WILC_WFIDrvHandle); int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); /*Bug3959: transmitting mgmt frames received from host*/ #if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/28] staging: wilc1000: remove unused variables
From: glen lee glen@atmel.com This patch removes unused variable pstrWFIDrv. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c8ebf51..66565f6 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -607,7 +607,6 @@ static s32 Handle_SetChannel(WILC_WFIDrvHandle drvHandler, tstrHostIFSetChan *ps s32 s32Error = WILC_SUCCESS; tstrWID strWID; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; /*prepare configuration packet*/ strWID.u16WIDid = (u16)WID_CURRENT_CHANNEL; @@ -733,7 +732,6 @@ s32 Handle_set_IPAddress(WILC_WFIDrvHandle drvHandler, u8 *pu8IPAddr, u8 idx) s32 s32Error = WILC_SUCCESS; tstrWID strWID; char firmwareIPAddress[4] = {0}; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; if (pu8IPAddr[0] 192) pu8IPAddr[0] = 0; @@ -837,7 +835,6 @@ static s32 Handle_SetMacAddress(WILC_WFIDrvHandle drvHandler, tstrHostIfSetMacAd s32 s32Error = WILC_SUCCESS; tstrWID strWID; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; u8 *mac_buf = (u8 *)WILC_MALLOC(ETH_ALEN); if (mac_buf == NULL) { @@ -3161,7 +3158,6 @@ static s32 Switch_Log_Terminal(WILC_WFIDrvHandle drvHandler) s32 s32Error = WILC_SUCCESS; tstrWID strWID; static char dummy = 9; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; strWID.u16WIDid = (u16)WID_LOGTerminal_Switch; strWID.enuWIDtype = WID_CHAR; @@ -3438,7 +3434,6 @@ static void Handle_AddBeacon(WILC_WFIDrvHandle drvHandler, tstrHostIFSetBeacon * s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; PRINT_D(HOSTINF_DBG, Adding BEACON\n); @@ -3510,7 +3505,6 @@ static void Handle_DelBeacon(WILC_WFIDrvHandle drvHandler, tstrHostIFDelBeacon * s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; strWID.u16WIDid = (u16)WID_DEL_BEACON; strWID.enuWIDtype = WID_CHAR; @@ -3607,7 +3601,6 @@ static void Handle_AddStation(WILC_WFIDrvHandle drvHandler, tstrWILC_AddStaParam s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; PRINT_D(HOSTINF_DBG, Handling add station\n); strWID.u16WIDid = (u16)WID_ADD_STA; @@ -3651,7 +3644,6 @@ static void Handle_DelAllSta(WILC_WFIDrvHandle drvHandler, tstrHostIFDelAllSta * tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; u8 i; u8 au8Zero_Buff[6] = {0}; @@ -3709,7 +3701,6 @@ static void Handle_DelStation(WILC_WFIDrvHandle drvHandler, tstrHostIFDelSta *ps s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; strWID.u16WIDid = (u16)WID_REMOVE_STA; strWID.enuWIDtype = WID_BIN; @@ -3754,7 +3745,6 @@ static void Handle_EditStation(WILC_WFIDrvHandle drvHandler, tstrWILC_AddStaPara s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; strWID.u16WIDid = (u16)WID_EDIT_STA; strWID.enuWIDtype = WID_BIN; @@ -3878,7 +3868,6 @@ static int Handle_RegisterFrame(WILC_WFIDrvHandle drvHandler, tstrHostIfRegister s32 s32Error = WILC_SUCCESS; tstrWID strWID; u8 *pu8CurrByte; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; PRINT_D(HOSTINF_DBG, Handling frame register Flag : %d FrameType: %d\n, pstrHostIfRegisterFrame-bReg, pstrHostIfRegisterFrame-u16FrameType); @@ -4021,7 +4010,6 @@ static void Handle_PowerManagement(WILC_WFIDrvHandle drvHandler, tstrHostIfPower s32 s32Error = WILC_SUCCESS; tstrWID strWID; s8 s8PowerMode; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; strWID.u16WIDid = (u16)WID_POWER_MANAGEMENT; @@ -4118,7 +4106,6 @@ static s32 Handle_AddBASession(WILC_WFIDrvHandle drvHandler, tstrHostIfBASession tstrWID strWID; int AddbaTimeout = 100; char *ptr = NULL; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; PRINT_D(HOSTINF_DBG, Opening Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\nBufferSize == %d\nSessionTimeOut = %d\n, strHostIfBASessionInfo-au8Bssid[0], @@ -4205,7 +4192,6 @@ static
[PATCH 20/28] staging: wilc1000: remove unnecessary type case
From: glen lee glen@atmel.com This patch removes (u32) type cast which makes build warning since the u32Address of u32 type was changed with WILC_WFIDrvHandle. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index fae7fd5..bc9195f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -656,7 +656,7 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, pstrWFIDrv); - if ((pstrHostIfSetDrvHandler-u32Address) == (u32)NULL) + if ((pstrHostIfSetDrvHandler-u32Address) == NULL) up(hSemDeinitDrvHandle); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/28] staging: wilc1000: change type of variable in tstrHostIfSetDrvHandler
From: glen lee glen@atmel.com This patch changes u32Address of u32 type with WILC_WFIDrvHandle type in the structure tstrHostIfSetDrvHandler because u32Address is used to hold driver handler. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 2ced05f..fffbcca 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -269,7 +269,7 @@ typedef struct { } tstrWILC_UsrConnReq; typedef struct { - u32 u32Address; + WILC_WFIDrvHandle u32Address; } tstrHostIfSetDrvHandler; typedef struct { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/28] staging: wilc1000: remove unused variable
From: glen lee glen@atmel.com This patch removes unused variable pstrWFIDrv. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 953df71..c5db385 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -642,7 +642,6 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand s32 s32Error = WILC_SUCCESS; tstrWID strWID; - tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)((pstrHostIfSetDrvHandler-u32Address)); /*prepare configuration packet*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/28] staging: wilc1000: fix cast from pointer to integer warning
From: glen lee glen@atmel.com To use a pointer as as integer in arithmetic operation, cast type to uintptr_t as the data type. This patch changes casting (unsigned int) with (uintptr_t) to do arithmetic operation Here is build warning. drivers/staging/wilc1000/linux_wlan.c:2385:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] skb_reserve(skb, (unsigned int)skb-data 0x3); Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 5dcb30c..ec80849 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -2382,7 +2382,7 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset) return; } - skb_reserve(skb, (unsigned int)skb-data 0x3); + skb_reserve(skb, (uintptr_t)skb-data 0x3); if (g_linux_wlan == NULL || wilc_netdev == NULL) PRINT_ER(wilc_netdev in g_linux_wlan is NULL); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/28] staging: wilc1000: change pstrWFIDrv with drvHandler
From: glen lee glen@atmel.com As type of gu8FlushedJoinReqDrvHandler was changed with WILC_WFIDrvHandle, change right value with drvHandler to match type. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7962f06..fae7fd5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1939,7 +1939,7 @@ static s32 Handle_Connect(WILC_WFIDrvHandle drvHandler, tstrHostIFconnectAttr *p /*BugID_5137*/ if (WILC_memcmp(DIRECT-, pstrHostIFconnectAttr-pu8ssid, 7)) { memcpy(gu8FlushedJoinReq, pu8CurrByte, gu32FlushedJoinReqSize); - gu8FlushedJoinReqDrvHandler = (u32)pstrWFIDrv; + gu8FlushedJoinReqDrvHandler = drvHandler; } PRINT_D(GENERIC_DBG, send HOST_IF_WAITING_CONN_RESP\n); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/28] staging: wilc1000: fix comparison between different type warning
From: glen lee glen@atmel.com This patch removes casting (u32) which makes compile warnings. The type of gu8FlushedJoinReqDrvHandler was changed with WILC_WFIDrvHandle same as drvHandler. drivers/staging/wilc1000/host_interface.c:2197:68: warning: comparison between pointer and integer [enabled by default] if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d5bd23d..7962f06 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -2190,11 +2190,11 @@ static s32 Handle_ConnectTimeout(WILC_WFIDrvHandle drvHandler) WILC_memset(u8ConnectedSSID, 0, ETH_ALEN); /*BugID_5213*/ /*Freeing flushed join request params on connect timeout*/ - if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedJoinReq); gu8FlushedJoinReq = NULL; } - if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedInfoElemAsoc); gu8FlushedInfoElemAsoc = NULL; } @@ -2615,11 +2615,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(WILC_WFIDrvHandle drvHandler, tstrRcvdGnrlAs /*BugID_5213*/ /*Freeing flushed join request params on receiving*/ /*MAC_DISCONNECTED while connected*/ - if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedJoinReq); gu8FlushedJoinReq = NULL; } - if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedInfoElemAsoc); gu8FlushedInfoElemAsoc = NULL; } @@ -3116,11 +3116,11 @@ static void Handle_Disconnect(WILC_WFIDrvHandle drvHandler) /*BugID_5137*/ - if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedJoinReq != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedJoinReq); gu8FlushedJoinReq = NULL; } - if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == (u32)drvHandler) { + if (gu8FlushedInfoElemAsoc != NULL gu8FlushedJoinReqDrvHandler == drvHandler) { WILC_FREE(gu8FlushedInfoElemAsoc); gu8FlushedInfoElemAsoc = NULL; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/28] staging: wilc1000: remove unwanted type cast
From: glen lee glen@atmel.com This patch removes (u32) type cast which makes build warning because the parameter of u32 type in the function host_int_set_wfi_drv_handler was changed with WILC_WFIDrvHandle. Not necessary to cast type. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bc9195f..ab2e082 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6687,7 +6687,7 @@ s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv) WILC_TimerDestroy((pstrWFIDrv-hRemainOnChannel), NULL); #endif - host_int_set_wfi_drv_handler((u32)NULL); + host_int_set_wfi_drv_handler(NULL); down(hSemDeinitDrvHandle); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/28] staging: wilc1000: change cast type from pointer to uintptr_t
From: glen lee glen@atmel.com To use drvHandler as integer operation, cast type to uintptr_t. Here is the build warning. drivers/staging/wilc1000/wilc_wlan.c:1871:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] int driver_handler = (u32)drvHandler; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index ec80849..14c2071 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1056,7 +1056,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, linux_wlan_t *p_n goto _fail_; } - *(int *)c_val = (u32)pstrWFIDrv; + *(int *)c_val = (uintptr_t)pstrWFIDrv; if (!g_linux_wlan-oup.wlan_cfg_set(1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0)) goto _fail_; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f5075b26..2cc23d5 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1868,7 +1868,7 @@ static int wilc_wlan_cfg_commit(int type, WILC_WFIDrvHandle drvHandler) wilc_cfg_frame_t *cfg = p-cfg_frame; int total_len = p-cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE; int seq_no = p-cfg_seq_no % 256; - int driver_handler = (u32)drvHandler; + int driver_handler = (uintptr_t)drvHandler; /** -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/28] staging: wilc1000: change type of parameter in wilc_wlan_cfg_commit
From: glen lee glen@atmel.com This patch changes drvHandler of uinit32_t type with WILC_WFIDrvHandle type to match driver handle type since wilc_wlan_cfg_commit gets drvHandler of WILC_WFIDrvHandle type as argument now. Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d5fc54b..f5075b26 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1862,7 +1862,7 @@ static void wilc_wlan_cleanup(void) } -static int wilc_wlan_cfg_commit(int type, uint32_t drvHandler) +static int wilc_wlan_cfg_commit(int type, WILC_WFIDrvHandle drvHandler) { wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)g_wlan; wilc_cfg_frame_t *cfg = p-cfg_frame; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
re: Staging: most: add MOST driver's core module
Hello Christian Gromm, The patch 57562a72414c: Staging: most: add MOST driver's core module from Jul 24, 2015, leads to the following static checker warning: drivers/staging/most/mostcore/core.c:1277 arm_mbo_chain() warn: integer overflows 'coherent_buf_size' drivers/staging/most/mostcore/core.c 1258 int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct mbo *)) 1259 { 1260 unsigned int i; 1261 int retval; 1262 struct mbo *mbo; 1263 u16 coherent_buf_size = c-cfg.buffer_size + c-cfg.extra_len; ^ We could have an integer overflow here. 1264 1265 atomic_set(c-mbo_nq_level, 0); 1266 1267 for (i = 0; i c-cfg.num_buffers; i++) { 1268 mbo = kzalloc(sizeof(*mbo), GFP_KERNEL); 1269 if (!mbo) { 1270 pr_info(WARN: Allocation of MBO failed.\n); 1271 retval = i; 1272 goto _exit; 1273 } 1274 mbo-context = c; 1275 mbo-ifp = c-iface; 1276 mbo-hdm_channel_id = c-channel_id; 1277 mbo-virt_address = dma_alloc_coherent(NULL, 1278 coherent_buf_size, ^ Leading to a smaller than expect size here. I assume this is root only but the USHRT_MAX is quite small so I could imagine someone hitting this limit by mistake. 1279 mbo-bus_address, 1280 GFP_KERNEL); 1281 if (!mbo-virt_address) { 1282 pr_info(WARN: No DMA coherent buffer.\n); 1283 retval = i; 1284 goto _error1; 1285 } regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/28] staging: wilc1000: change data type of variable
From: glen lee glen@atmel.com drvHandler of u32 type is used to handle integer type pointer operation which cause build warnings. To use integer type varialbe as pointer, drvHandler data type need to be changed with uintptr_t type. drivers/staging/wilc1000/host_interface.c: In function ‘NetworkInfoReceived’: drivers/staging/wilc1000/host_interface.c:6767:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; ^ drivers/staging/wilc1000/host_interface.c: In function ‘GnrlAsyncInfoReceived’: drivers/staging/wilc1000/host_interface.c:6819:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; ^ drivers/staging/wilc1000/host_interface.c: In function ‘host_int_ScanCompleteReceived’: drivers/staging/wilc1000/host_interface.c:6878:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler; Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b36f98c..668e47e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6760,7 +6760,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - u32 drvHandler; + uintptr_t drvHandler; tstrWILC_WFIDrv *pstrWFIDrv = NULL; drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] 8) | (pu8Buffer[u32Length - 2] 16) | (pu8Buffer[u32Length - 1] 24)); @@ -6809,7 +6809,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - u32 drvHandler; + uintptr_t drvHandler; tstrWILC_WFIDrv *pstrWFIDrv = NULL; /*BugID_5348*/ @@ -6871,7 +6871,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length) { s32 s32Error = WILC_SUCCESS; tstrHostIFmsg strHostIFmsg; - u32 drvHandler; + uintptr_t drvHandler; tstrWILC_WFIDrv *pstrWFIDrv = NULL; drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] 8) | (pu8Buffer[u32Length - 2] 16) | (pu8Buffer[u32Length - 1] 24)); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/28] staging: wilc1000: fix casting build warning
From: glen lee glen@atmel.com u32Mode type is u32 and it indicates integer type operation mode. So change (32)NULL with 0. drivers/staging/wilc1000/host_interface.c:704:47: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL) Signed-off-by: glen lee glen@atmel.com Signed-off-by: Tony Cho tony@atmel.com --- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c5db385..b36f98c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -700,7 +700,7 @@ static s32 Handle_SetOperationMode(WILC_WFIDrvHandle drvHandler, tstrHostIfSetOp s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, drvHandler); - if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL) + if ((pstrHostIfSetOperationMode-u32Mode) == 0) up(hSemDeinitDrvHandle); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: most: replace pr_*() functions by dev_*()
On Thu, Jul 30, 2015 at 06:19:41PM +0200, Christian Gromm wrote: This patch replaces pr_*() functions with dev_*(). Reported-by: Greg Kroah-Hartman gre...@linuxfoundation.org Signed-off-by: Christian Gromm christian.gr...@microchip.com --- snip + dev_notice(dev, +Channel %d - rouding buffer size to %d bytes, +channel config says %d bytes\n, user visible strings should not be splitted. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: unisys: visornic: Convert to using napi
On Fri, Jul 31, 2015 at 06:56:33PM -0400, Benjamin Romer wrote: From: Neil Horman nhor...@redhat.com Switch the visornic over to use napi. Currently there is a kernel thread that sits and waits on a wait queue to get notified of incoming virtual interrupts. It would be nice if we could handle frame reception using the standard napi processing instead. This patch creates our napi instance and has the rx thread schedule it Given that the unisys hypervisor currently requires that queue servicing be done by a polling loop that wakes up every 2ms, lets instead also convert that to a timer, which is simpler, and allows us to remove all the thread starting and stopping code. Signed-off-by: Neil Horman nhor...@tuxdriver.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com I assume you just didn't copy me on patch 1/2? I don't see it anywhere. Neil ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: unisys: visornic: Convert to using napi
From: Neil Horman nhor...@redhat.com Switch the visornic over to use napi. Currently there is a kernel thread that sits and waits on a wait queue to get notified of incoming virtual interrupts. It would be nice if we could handle frame reception using the standard napi processing instead. This patch creates our napi instance and has the rx thread schedule it Given that the unisys hypervisor currently requires that queue servicing be done by a polling loop that wakes up every 2ms, lets instead also convert that to a timer, which is simpler, and allows us to remove all the thread starting and stopping code. Signed-off-by: Neil Horman nhor...@tuxdriver.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/visornic/visornic_main.c | 209 ++-- 1 file changed, 84 insertions(+), 125 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 3db4b61..c73f070 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -91,11 +91,6 @@ static struct visor_driver visornic_driver = { .channel_interrupt = NULL, }; -struct visor_thread_info { - struct task_struct *task; - int id; -}; - struct chanstat { unsigned long got_rcv; unsigned long got_enbdisack; @@ -112,7 +107,6 @@ struct chanstat { struct visornic_devdata { int devnum; - int thread_wait_ms; unsigned short enabled; /* 0 disabled 1 enabled to receive */ unsigned short enab_dis_acked; /* NET_RCV_ENABLE/DISABLE acked by * IOPART @@ -163,7 +157,6 @@ struct visornic_devdata { bool server_change_state;/* Processing SERVER_CHANGESTATE msg */ bool going_away; /* device is being torn down */ struct dentry *eth_debugfs_dir; - struct visor_thread_info threadinfo; u64 interrupts_rcvd; u64 interrupts_notme; u64 interrupts_disabled; @@ -195,6 +188,9 @@ struct visornic_devdata { int queuefullmsg_logged; struct chanstat chstat; + struct timer_list irq_poll_timer; + struct napi_struct napi; + struct uiscmdrsp cmdrsp[SIZEOF_CMDRSP]; }; @@ -203,6 +199,8 @@ struct visornic_devdata { */ static LIST_HEAD(list_all_devices); static DEFINE_SPINLOCK(lock_all_devices); +static int visornic_poll(struct napi_struct *napi, int budget); +static void poll_for_irq(unsigned long v); /** * visor_copy_fragsinfo_from_skb( @@ -302,49 +300,6 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, return count; } -/** - * visort_thread_start - starts thread for the device - * @thrinfo: The thread to start - * @threadfn: Function the thread starts - * @thrcontext: Context to pass to the thread, i.e. devdata - * @name: string describing name of thread - * - * Starts a thread for the device, currently only thread is - * process_incoming_rsps - * Returns 0 on success; - */ -static int visor_thread_start(struct visor_thread_info *thrinfo, - int (*threadfn)(void *), - void *thrcontext, char *name) -{ - /* used to stop the thread */ - thrinfo-task = kthread_run(threadfn, thrcontext, %s, name); - if (IS_ERR(thrinfo-task)) { - pr_debug(%s failed (%ld)\n, -__func__, PTR_ERR(thrinfo-task)); - thrinfo-id = 0; - return -EINVAL; - } - thrinfo-id = thrinfo-task-pid; - return 0; -} - -/** - * visor_thread_stop - stop a thread for the device - * @thrinfo: The thread to stop - * - * Stop the thread and wait for completion for a minute - * Returns void. - */ -static void visor_thread_stop(struct visor_thread_info *thrinfo) -{ - if (!thrinfo-id) - return; /* thread not running */ - - BUG_ON(kthread_stop(thrinfo-task)); - thrinfo-id = 0; -} - static ssize_t enable_ints_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) @@ -374,8 +329,8 @@ visornic_serverdown_complete(struct visornic_devdata *devdata) netdev = devdata-netdev; - /* Stop using datachan */ - visor_thread_stop(devdata-threadinfo); + /* Stop polling for interrupts */ + del_timer_sync(devdata-irq_poll_timer); rtnl_lock(); dev_close(netdev); @@ -539,9 +494,6 @@ visornic_disable_with_timeout(struct net_device *netdev, const int timeout) unsigned long flags; int wait = 0; - /* stop the transmit queue so nothing more can be transmitted */ - netif_stop_queue(netdev); - /* send a msg telling the other end we are stopping incoming pkts */
[PATCH 1/2] staging: unisys: visorchannel: Add peek function
From: Neil Horman nhor...@redhat.com According to unisys, the s_par hypervisor has a bug in which it never triggers an interrupt. That makes the visornic effectively a 2ms poll loop. In order to just have the rx thread shceduling a napi poll every 2ms, lets instead give it the chance to check the response queue for data before we schedule. This helper provides that functionality Signed-off-by: Neil Horman nhor...@redhat.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/include/visorbus.h | 2 ++ drivers/staging/unisys/visorbus/visorchannel.c | 21 + 2 files changed, 23 insertions(+) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index a0144c6..9235536 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -201,6 +201,8 @@ bool visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg); bool visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg); +bool visorchannel_signalempty(struct visorchannel *channel, u32 queue); + int visorchannel_signalqueue_slots_avail(struct visorchannel *channel, u32 queue); int visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue); diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 2422464..6da7e49 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -430,6 +430,27 @@ visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg) } EXPORT_SYMBOL_GPL(visorchannel_signalremove); +bool +visorchannel_signalempty(struct visorchannel *channel, u32 queue) +{ + unsigned long flags = 0; + struct signal_queue_header sig_hdr; + bool rc = false; + + if (channel-needs_lock) + spin_lock_irqsave(channel-remove_lock, flags); + + if (!sig_read_header(channel, queue, sig_hdr)) + rc = true; + if (sig_hdr.head == sig_hdr.tail) + rc = true; + if (channel-needs_lock) + spin_unlock_irqrestore(channel-remove_lock, flags); + + return rc; +} +EXPORT_SYMBOL_GPL(visorchannel_signalempty); + static bool signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: unisys: convert visornic to NAPI
This patchset upgrades the visornic code so that it uses NAPI. The first patch is a preparatory patch, then the second does the conversion. It was tested on s-Par and works. Neil Horman (2): staging: unisys: visorchannel: Add peek function staging: unisys: visornic: Convert to using napi drivers/staging/unisys/include/visorbus.h | 2 + drivers/staging/unisys/visorbus/visorchannel.c | 21 +++ drivers/staging/unisys/visornic/visornic_main.c | 209 ++-- 3 files changed, 107 insertions(+), 125 deletions(-) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/13] staging/lustre: Drop SEEK_* definition checks
On Thu, Jul 30, 2015 at 06:27:57PM -0400, gr...@linuxhacker.ru wrote: From: Oleg Drokin gr...@linuxhacker.ru SEEK_DATA and SEEK_HOLE are always defined in the kernel, drop the definition checks Signed-off-by: Oleg Drokin oleg.dro...@intel.com --- .../lustre/lustre/include/linux/lustre_compat25.h | 38 -- 1 file changed, 38 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index d0e8f3c..7d90999 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h @@ -69,37 +69,6 @@ # define inode_dio_read(i) atomic_inc((i)-i_dio_count) /* inode_dio_done(i) use as-is for read unlock */ -static inline int -ll_quota_on(struct super_block *sb, int off, int ver, char *name, int remount) -{ - int rc; - - if (sb-s_qcop-quota_on) { - struct path path; - - rc = kern_path(name, LOOKUP_FOLLOW, path); - if (!rc) - return rc; - rc = sb-s_qcop-quota_on(sb, off, ver - , path -); - path_put(path); - return rc; - } else - return -ENOSYS; -} - -static inline int ll_quota_off(struct super_block *sb, int off, int remount) -{ - if (sb-s_qcop-quota_off) { - return sb-s_qcop-quota_off(sb, off - ); - } else - return -ENOSYS; -} - - - This code removal doesn't match up with the changelog text, so I can't take this :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/13] Removal of lustre compat macros
On Thu, Jul 30, 2015 at 06:27:51PM -0400, gr...@linuxhacker.ru wrote: From: Oleg Drokin gr...@linuxhacker.ru This patchset is a stroll through lustre/include/linux/lustre_compat25.h that houses a bunch of our compatibility with old/new kernels code and gettign rid of everything that we know for granted is available because we are part of the tree. These are the low hanging fruit, the rest are somewhat more tricky and would need some more research. I applied some of these, please fix up the changelog entry (or break it up into 2 patches) for that one patch, and resend that and the remaining ones. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/6] drivers, staging, unisys Add visorbus module autoloading code
On Fri, Jul 24, 2015 at 12:06:54PM -0400, Benjamin Romer wrote: From: Prarit Bhargava pra...@redhat.com This patch adds an module alias and a MODULE_DEVICE_TABLE to autoload the visorhba driver when an appropriate device is created by the visorbus. Signed-off-by: Prarit Bhargava pra...@redhat.com --- drivers/staging/unisys/visorhba/visorhba_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 031c6fa..50ecdf2 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -80,6 +80,8 @@ static struct visor_driver visorhba_driver = { .resume = visorhba_resume, .channel_interrupt = NULL, }; +MODULE_DEVICE_TABLE(visorbus, visorhba_channel_types); +MODULE_ALIAS(visorbus: SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR); You shouldn't have to write MODULE_ALIAS lines by hand, they should be generated for you automagically from the MODULE_DEVICE_TABLE() define, if you do it right. You all didn't do it right :) Please fix up. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging/lustre: remove unused ll_quota_on and ll_quota_off
From: Oleg Drokin gr...@linuxhacker.ru They are not used anywhere, so safe to drop. Signed-off-by: Oleg Drokin oleg.dro...@intel.com --- .../lustre/lustre/include/linux/lustre_compat25.h | 31 -- 1 file changed, 31 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index 502c7cc..9739611 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h @@ -69,37 +69,6 @@ # define inode_dio_read(i) atomic_inc((i)-i_dio_count) /* inode_dio_done(i) use as-is for read unlock */ -static inline int -ll_quota_on(struct super_block *sb, int off, int ver, char *name, int remount) -{ - int rc; - - if (sb-s_qcop-quota_on) { - struct path path; - - rc = kern_path(name, LOOKUP_FOLLOW, path); - if (!rc) - return rc; - rc = sb-s_qcop-quota_on(sb, off, ver - , path - ); - path_put(path); - return rc; - } else - return -ENOSYS; -} - -static inline int ll_quota_off(struct super_block *sb, int off, int remount) -{ - if (sb-s_qcop-quota_off) { - return sb-s_qcop-quota_off(sb, off - ); - } else - return -ENOSYS; -} - - - #define ll_d_hlist_node hlist_node #define ll_d_hlist_empty(list) hlist_empty(list) #define ll_d_hlist_entry(ptr, type, name) hlist_entry(ptr.first, type, name) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: unisys: Add s-Par visorhba
On Fri, Jul 31, 2015 at 12:18:12PM -0400, Ben Romer wrote: Hi Greg, I was wondering if you'd had a chance to take a look at this patch, and if you had any additional comments? It should have all of your previous comments addressed. :) Nope, no time to do that yet, sorry, it takes a lot to review a driver like that... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] staging: unisys: module autoload support
On Fri, Jul 24, 2015 at 12:06:50PM -0400, Benjamin Romer wrote: This patch series adds support for automatically loading the unisys drivers from modules. first 3 patches applied only. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/13] staging/lustre: Drop SEEK_* definition checks
On Jul 31, 2015, at 7:00 PM, Greg Kroah-Hartman wrote: On Thu, Jul 30, 2015 at 06:27:57PM -0400, gr...@linuxhacker.ru wrote: From: Oleg Drokin gr...@linuxhacker.ru SEEK_DATA and SEEK_HOLE are always defined in the kernel, drop the definition checks This code removal doesn't match up with the changelog text, so I can't take this :( Whoops. A fallover from a mistaken rebase, I guess. I'll resubmit in a moment. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel