Skip to contentSkip to conversation

pvusb: add missing definition to usbif.h

PATCH In review Juergen Gross 3 participants 9 messages May 5, 2016 – May 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvusb: add missing definition to usbif.h

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001
 	uint16_t buffer_length;
 	union {
 		uint8_t ctrl[8]; /* setup_packet (Ctrl) */
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 19 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
xen/include/public/io/usbif.h +0 -0
index 9ef0cdc..4053c24 100644

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 4 lines
xen/include/public/io/usbif.h +1 -0
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

Quoted 11 lines
xen/include/public/io/usbif.h +0 -0
 	uint16_t buffer_length;
 	union {
 		uint8_t ctrl[8]; /* setup_packet (Ctrl) */
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 6 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 6 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Wei.

Quoted 3 lines

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 51 lines · Wei Liu
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 4 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Quoted 6 lines
Quoted 2 lines

Thoughts?

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Sure. But I think it should be consistent at header file level. So in my opinion the question is: should I change all definitions in usbif.h to use the XEN_ prefix or should I add the new definition without prefix?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 56 lines
Quoted 1 line
Quoted 1 line · On 06.05.16 at 07:01, <[email protected]> wrote:
Quoted 54 lines · Wei Liu
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 6 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Quoted 8 lines
Quoted 3 lines

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Sure. But I think it should be consistent at header file level. So in my opinion the question is: should I change all definitions in usbif.h to use the XEN_ prefix or should I add the new definition without prefix?

Since changing them all is not even an option (breaking possible existing users, even if we don't know of any, is not allowed), I think leaving the XEN_ off of the new addition here is acceptable (as being more consistent inside the header, as you validly say). So since Wei already said he won't insist on the prefix, I think this can go in as is.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 66 lines
Quoted 57 lines
Quoted 2 lines · On 06.05.16 at 09:49, <[email protected]> wrote:
Quoted 1 line · On 06.05.16 at 07:01, <[email protected]> wrote:
Quoted 54 lines · Wei Liu
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 6 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Quoted 8 lines
Quoted 3 lines

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Sure. But I think it should be consistent at header file level. So in my opinion the question is: should I change all definitions in usbif.h to use the XEN_ prefix or should I add the new definition without prefix?

Quoted 6 lines

Since changing them all is not even an option (breaking possible existing users, even if we don't know of any, is not allowed), I think leaving the XEN_ off of the new addition here is acceptable (as being more consistent inside the header, as you validly say). So since Wei already said he won't insist on the prefix, I think this can go in as is.

Of course only if Wei would release-ack it...

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
In reply to Juergen Gross
Quoted 55 lines · Juergen Gross
Quoted 54 lines · Wei Liu
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 6 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Quoted 9 lines
Quoted 3 lines

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Sure. But I think it should be consistent at header file level. So in my opinion the question is: should I change all definitions in usbif.h to use the XEN_ prefix or should I add the new definition without prefix?

Yes we need to be consistent in usbif.h

Quoted 2 lines

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
In reply to Jan Beulich
Quoted 73 lines · Jan Beulich
Quoted 66 lines
Quoted 57 lines
Quoted 2 lines · On 06.05.16 at 09:49, <[email protected]> wrote:
Quoted 1 line · On 06.05.16 at 07:01, <[email protected]> wrote:
Quoted 54 lines · Wei Liu
Quoted 37 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Juergen Gross

The pvusb request structure contains the transfer_flags member which is missing definitions of it's semantics.

Add the definition of the USBIF_SHORT_NOT_OK flag.

---
Please consider taking this patch for 4.7 release. I believe this is the last bit missing for support of qemu based pvusb backend. The risk of the patch should be zero, as no Xen component is using this header.

---
 xen/include/public/io/usbif.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

xen/include/public/io/usbif.h struct usbif_urb_request { · line 190

Quoted 9 lines
xen/include/public/io/usbif.h +1 -0
index 9ef0cdc..4053c24 100644
@@ -187,6 +187,7 @@ struct usbif_urb_request {
 	/* basic urb parameter */
 	uint32_t pipe;
 	uint16_t transfer_flags;
+#define USBIF_SHORT_NOT_OK	0x0001

Where does this come from? Should it be surrounded by define guard?

I just wasn't defined up to now (to be precise: transfer_flags was just copied from the related URB struct member in the frontend, so the interface was based on some Linux kernel internals, and the qemu backend used a literal "1" for testing the flag).

Quoted 4 lines

#ifndef USBIF_SHORT_NOT_OK
#define USBIF_SHORT_NOT_OK 0x0001
#endif

Quoted 6 lines
Quoted 2 lines

Why does it need to be in our public header? If we end up taking this I think it should at least start with XEN_ prefix.

This is just a part of the pvusb interface. So it should be defined in the appropriate header file.

OK. I get it now.

Quoted 6 lines

Regarding prefix: I can do this, but in this case I'd prefer to add the prefix to all definitions in the header. As there are currently no in-tree users of this header, the risk would still be zero. :-)

Thoughts?

Quoted 8 lines
Quoted 3 lines

Actually not all public #define are prefixed by XEN_ (netif.h does, blkif.h doesn't) so I won't insists on this. But I still using XEN_ prefix is better.

Sure. But I think it should be consistent at header file level. So in my opinion the question is: should I change all definitions in usbif.h to use the XEN_ prefix or should I add the new definition without prefix?

Quoted 6 lines

Since changing them all is not even an option (breaking possible existing users, even if we don't know of any, is not allowed), I think leaving the XEN_ off of the new addition here is acceptable (as being more consistent inside the header, as you validly say). So since Wei already said he won't insist on the prefix, I think this can go in as is.

Quoted 4 lines

Of course only if Wei would release-ack it...

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel