All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] staging: ozwpan: Check for correct config number.
@ 2013-08-23 17:33 Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro Rupesh Gujare
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

Check for valid config number before completing set interface.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozhcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index ab93b74..83ed64c 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -909,7 +909,7 @@ static void oz_hcd_complete_set_interface(struct oz_port *port, struct urb *urb,
 	struct usb_hcd *hcd = port->ozhcd->hcd;
 	int rc = 0;
 
-	if (rcode == 0) {
+	if ((rcode == 0) && (port->config_num > 0)) {
 		struct usb_host_config *config;
 		struct usb_host_interface *intf;
 		oz_dbg(ON, "Set interface %d alt %d\n", if_num, alt);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro
  2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
@ 2013-08-23 17:33 ` Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 3/6] staging: ozwpan: Increase interrupt end point buffer size Rupesh Gujare
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

Use macro instead of hard coded value for readability.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozhcd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 83ed64c..89e498b 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -73,6 +73,7 @@ struct oz_urb_link {
 
 /* Holds state information about a USB endpoint.
  */
+#define OZ_EP_BUFFER_SIZE_ISOC  (1024 * 24)
 struct oz_endpoint {
 	struct list_head urb_list;	/* List of oz_urb_link items. */
 	struct list_head link;		/* For isoc ep, links in to isoc
@@ -1261,7 +1262,7 @@ static int oz_build_endpoints_for_interface(struct usb_hcd *hcd,
 			switch (hep->desc.bmAttributes &
 						USB_ENDPOINT_XFERTYPE_MASK) {
 			case USB_ENDPOINT_XFER_ISOC:
-				buffer_size = 24*1024;
+				buffer_size = OZ_EP_BUFFER_SIZE_ISOC;
 				break;
 			case USB_ENDPOINT_XFER_INT:
 				buffer_size = 128;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/6] staging: ozwpan: Increase interrupt end point buffer size
  2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro Rupesh Gujare
@ 2013-08-23 17:33 ` Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 4/6] staging: ozwpan: change variable type Rupesh Gujare
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

Increase interrupt end point buffer size & convert hard coded
value to macro for better readability.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozhcd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 89e498b..16fd60b 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -74,6 +74,7 @@ struct oz_urb_link {
 /* Holds state information about a USB endpoint.
  */
 #define OZ_EP_BUFFER_SIZE_ISOC  (1024 * 24)
+#define OZ_EP_BUFFER_SIZE_INT   512
 struct oz_endpoint {
 	struct list_head urb_list;	/* List of oz_urb_link items. */
 	struct list_head link;		/* For isoc ep, links in to isoc
@@ -1265,7 +1266,7 @@ static int oz_build_endpoints_for_interface(struct usb_hcd *hcd,
 				buffer_size = OZ_EP_BUFFER_SIZE_ISOC;
 				break;
 			case USB_ENDPOINT_XFER_INT:
-				buffer_size = 128;
+				buffer_size = OZ_EP_BUFFER_SIZE_INT;
 				break;
 			}
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/6] staging: ozwpan: change variable type.
  2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 3/6] staging: ozwpan: Increase interrupt end point buffer size Rupesh Gujare
@ 2013-08-23 17:33 ` Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 5/6] staging: ozwpan: Fix error checking while transmitting frame Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
  4 siblings, 0 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

We have icreased interrupt end point buffer size to 512 bytes,
Change variable data type to accomodate it.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozhcd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 16fd60b..3548860 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -441,9 +441,9 @@ static void oz_complete_buffered_urb(struct oz_port *port,
 			struct oz_endpoint *ep,
 			struct urb *urb)
 {
-	u8 data_len, available_space, copy_len;
+	int data_len, available_space, copy_len;
 
-	memcpy(&data_len, &ep->buffer[ep->out_ix], sizeof(u8));
+	data_len = ep->buffer[ep->out_ix];
 	if (data_len <= urb->transfer_buffer_length)
 		available_space = data_len;
 	else
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/6] staging: ozwpan: Fix error checking while transmitting frame.
  2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
                   ` (2 preceding siblings ...)
  2013-08-23 17:33 ` [PATCH 4/6] staging: ozwpan: change variable type Rupesh Gujare
@ 2013-08-23 17:33 ` Rupesh Gujare
  2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
  4 siblings, 0 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

Make sure that we return negative value if oz_build_frame()
returns NULL.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozpd.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index daaff2a..e1757aa 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -618,14 +618,14 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
 	pd->last_sent_frame = e;
 	skb = oz_build_frame(pd, f);
 	spin_unlock(&pd->tx_frame_lock);
+	if (!skb)
+		return -1;
 	if (more_data)
 		oz_set_more_bit(skb);
 	oz_dbg(TX_FRAMES, "TX frame PN=0x%x\n", f->hdr.pkt_num);
-	if (skb) {
-		if (dev_queue_xmit(skb) < 0)
-			return -1;
+	if (dev_queue_xmit(skb) < 0)
+		return -1;
 
-	}
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/6] staging: ozwpan: change max. TX frame size supported.
  2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
                   ` (3 preceding siblings ...)
  2013-08-23 17:33 ` [PATCH 5/6] staging: ozwpan: Fix error checking while transmitting frame Rupesh Gujare
@ 2013-08-23 17:33 ` Rupesh Gujare
  2013-08-30 12:52   ` Mark Einon
  2013-08-30 12:59   ` Mark Einon
  4 siblings, 2 replies; 8+ messages in thread
From: Rupesh Gujare @ 2013-08-23 17:33 UTC (permalink / raw)
  To: devel; +Cc: linux-usb, linux-kernel, gregkh

Max. TX frame size supported is changed to 760 bytes.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozproto.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozproto.h b/drivers/staging/ozwpan/ozproto.h
index e532347..0c49c8a 100644
--- a/drivers/staging/ozwpan/ozproto.h
+++ b/drivers/staging/ozwpan/ozproto.h
@@ -19,7 +19,7 @@
 #define OZ_PRESLEEP_TOUT	11
 
 /* Maximun sizes of tx frames. */
-#define OZ_MAX_TX_SIZE		1514
+#define OZ_MAX_TX_SIZE		760
 
 /* Maximum number of uncompleted isoc frames that can be pending in network. */
 #define OZ_MAX_SUBMITTED_ISOC	16
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 6/6] staging: ozwpan: change max. TX frame size supported.
  2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
@ 2013-08-30 12:52   ` Mark Einon
  2013-08-30 12:59   ` Mark Einon
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Einon @ 2013-08-30 12:52 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: devel, gregkh, linux-usb, linux-kernel

On Fri, Aug 23, 2013 at 06:33:33PM +0100, Rupesh Gujare wrote:
> Max. TX frame size supported is changed to 760 bytes.

Hi Rupesh,

>From the comment, this looks like an arbitrary change for no reason.
Why are you changing the TX frame size to 760 - and can we add the
reason to the changelog?

Cheers,

Mark


> 
> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
> ---
>  drivers/staging/ozwpan/ozproto.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/ozwpan/ozproto.h b/drivers/staging/ozwpan/ozproto.h
> index e532347..0c49c8a 100644
> --- a/drivers/staging/ozwpan/ozproto.h
> +++ b/drivers/staging/ozwpan/ozproto.h
> @@ -19,7 +19,7 @@
>  #define OZ_PRESLEEP_TOUT	11
>  
>  /* Maximun sizes of tx frames. */
> -#define OZ_MAX_TX_SIZE		1514
> +#define OZ_MAX_TX_SIZE		760
>  
>  /* Maximum number of uncompleted isoc frames that can be pending in network. */
>  #define OZ_MAX_SUBMITTED_ISOC	16
> -- 
> 1.7.9.5
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 6/6] staging: ozwpan: change max. TX frame size supported.
  2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
  2013-08-30 12:52   ` Mark Einon
@ 2013-08-30 12:59   ` Mark Einon
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Einon @ 2013-08-30 12:59 UTC (permalink / raw)
  To: Rupesh Gujare; +Cc: devel, gregkh, linux-usb, linux-kernel

On Fri, Aug 23, 2013 at 06:33:33PM +0100, Rupesh Gujare wrote:
> 
> diff --git a/drivers/staging/ozwpan/ozproto.h b/drivers/staging/ozwpan/ozproto.h
> index e532347..0c49c8a 100644
> --- a/drivers/staging/ozwpan/ozproto.h
> +++ b/drivers/staging/ozwpan/ozproto.h
> @@ -19,7 +19,7 @@
>  #define OZ_PRESLEEP_TOUT	11
>  
>  /* Maximun sizes of tx frames. */
      ^^^^^^^

If you are going to spin this patch again, you may as well fix this typo
too...

Cheers,

Mark

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-30 13:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
2013-08-23 17:33 ` [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro Rupesh Gujare
2013-08-23 17:33 ` [PATCH 3/6] staging: ozwpan: Increase interrupt end point buffer size Rupesh Gujare
2013-08-23 17:33 ` [PATCH 4/6] staging: ozwpan: change variable type Rupesh Gujare
2013-08-23 17:33 ` [PATCH 5/6] staging: ozwpan: Fix error checking while transmitting frame Rupesh Gujare
2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
2013-08-30 12:52   ` Mark Einon
2013-08-30 12:59   ` Mark Einon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.