All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Correct structures for AMP Assoc Read
@ 2011-12-15  9:48 Emeltchenko Andrei
  2011-12-15 16:27 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-12-15  9:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Make struct names similar to kernel and remove static array since
fragment length can be other size than HCI_MAX_NAME_LENGTH, which
is for totally different purpose.
---
 lib/hci.h |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/hci.h b/lib/hci.h
index 51184ee..48692fa 100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -1382,17 +1382,16 @@ typedef struct {
 #define OCF_READ_LOCAL_AMP_ASSOC	0x000A
 typedef struct {
 	uint8_t		handle;
-	uint16_t	length_so_far;
-	uint16_t	assoc_length;
+	uint16_t	len_so_far;
+	uint16_t	max_len;
 } __attribute__ ((packed)) read_local_amp_assoc_cp;
-#define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
+
 typedef struct {
 	uint8_t		status;
 	uint8_t		handle;
-	uint16_t	length;
-	uint8_t		fragment[HCI_MAX_NAME_LENGTH];
+	uint16_t	rem_len;
+	uint8_t		frag[0];
 } __attribute__ ((packed)) read_local_amp_assoc_rp;
-#define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
 
 #define OCF_WRITE_REMOTE_AMP_ASSOC	0x000B
 typedef struct {
-- 
1.7.4.1


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

* Re: [PATCH] Correct structures for AMP Assoc Read
  2011-12-15  9:48 [PATCH] Correct structures for AMP Assoc Read Emeltchenko Andrei
@ 2011-12-15 16:27 ` Marcel Holtmann
  2011-12-16  8:14   ` Emeltchenko Andrei
  2012-01-05  9:50   ` Emeltchenko Andrei
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel Holtmann @ 2011-12-15 16:27 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Make struct names similar to kernel and remove static array since
> fragment length can be other size than HCI_MAX_NAME_LENGTH, which
> is for totally different purpose.
> ---
>  lib/hci.h |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/hci.h b/lib/hci.h
> index 51184ee..48692fa 100644
> --- a/lib/hci.h
> +++ b/lib/hci.h
> @@ -1382,17 +1382,16 @@ typedef struct {
>  #define OCF_READ_LOCAL_AMP_ASSOC	0x000A
>  typedef struct {
>  	uint8_t		handle;
> -	uint16_t	length_so_far;
> -	uint16_t	assoc_length;
> +	uint16_t	len_so_far;
> +	uint16_t	max_len;
>  } __attribute__ ((packed)) read_local_amp_assoc_cp;
> -#define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
> +
>  typedef struct {
>  	uint8_t		status;
>  	uint8_t		handle;
> -	uint16_t	length;
> -	uint8_t		fragment[HCI_MAX_NAME_LENGTH];
> +	uint16_t	rem_len;
> +	uint8_t		frag[0];
>  } __attribute__ ((packed)) read_local_amp_assoc_rp;
> -#define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
>  
>  #define OCF_WRITE_REMOTE_AMP_ASSOC	0x000B
>  typedef struct {

I am fine with these changes.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



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

* Re: [PATCH] Correct structures for AMP Assoc Read
  2011-12-15 16:27 ` Marcel Holtmann
@ 2011-12-16  8:14   ` Emeltchenko Andrei
  2012-01-05  9:50   ` Emeltchenko Andrei
  1 sibling, 0 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-12-16  8:14 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Thu, Dec 15, 2011 at 05:27:59PM +0100, Marcel Holtmann wrote:
> Hi Andrei,
> 
> > Make struct names similar to kernel and remove static array since
> > fragment length can be other size than HCI_MAX_NAME_LENGTH, which
> > is for totally different purpose.
> > ---
> >  lib/hci.h |   11 +++++------
> >  1 files changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/hci.h b/lib/hci.h
> > index 51184ee..48692fa 100644
> > --- a/lib/hci.h
> > +++ b/lib/hci.h
> > @@ -1382,17 +1382,16 @@ typedef struct {
> >  #define OCF_READ_LOCAL_AMP_ASSOC	0x000A
> >  typedef struct {
> >  	uint8_t		handle;
> > -	uint16_t	length_so_far;
> > -	uint16_t	assoc_length;
> > +	uint16_t	len_so_far;
> > +	uint16_t	max_len;
> >  } __attribute__ ((packed)) read_local_amp_assoc_cp;
> > -#define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
> > +
> >  typedef struct {
> >  	uint8_t		status;
> >  	uint8_t		handle;
> > -	uint16_t	length;
> > -	uint8_t		fragment[HCI_MAX_NAME_LENGTH];
> > +	uint16_t	rem_len;
> > +	uint8_t		frag[0];
> >  } __attribute__ ((packed)) read_local_amp_assoc_rp;
> > -#define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
> >  
> >  #define OCF_WRITE_REMOTE_AMP_ASSOC	0x000B
> >  typedef struct {
> 
> I am fine with these changes.

BTW: What do you think about cleaning up those headers like copying all
structures from kernel header and removing unneeded size defines (we can
always use sizeof)?

Best regards 
Andrei Emeltchenko 

> 
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> 
> Regards
> 
> Marcel
> 
> 

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

* Re: [PATCH] Correct structures for AMP Assoc Read
  2011-12-15 16:27 ` Marcel Holtmann
  2011-12-16  8:14   ` Emeltchenko Andrei
@ 2012-01-05  9:50   ` Emeltchenko Andrei
  2012-01-05 10:40     ` Johan Hedberg
  1 sibling, 1 reply; 5+ messages in thread
From: Emeltchenko Andrei @ 2012-01-05  9:50 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi,

On Thu, Dec 15, 2011 at 05:27:59PM +0100, Marcel Holtmann wrote:
> Hi Andrei,
> 
> > Make struct names similar to kernel and remove static array since
> > fragment length can be other size than HCI_MAX_NAME_LENGTH, which
> > is for totally different purpose.
> > ---
> >  lib/hci.h |   11 +++++------
> >  1 files changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/hci.h b/lib/hci.h
> > index 51184ee..48692fa 100644
> > --- a/lib/hci.h
> > +++ b/lib/hci.h
> > @@ -1382,17 +1382,16 @@ typedef struct {
> >  #define OCF_READ_LOCAL_AMP_ASSOC	0x000A
> >  typedef struct {
> >  	uint8_t		handle;
> > -	uint16_t	length_so_far;
> > -	uint16_t	assoc_length;
> > +	uint16_t	len_so_far;
> > +	uint16_t	max_len;
> >  } __attribute__ ((packed)) read_local_amp_assoc_cp;
> > -#define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
> > +
> >  typedef struct {
> >  	uint8_t		status;
> >  	uint8_t		handle;
> > -	uint16_t	length;
> > -	uint8_t		fragment[HCI_MAX_NAME_LENGTH];
> > +	uint16_t	rem_len;
> > +	uint8_t		frag[0];
> >  } __attribute__ ((packed)) read_local_amp_assoc_rp;
> > -#define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
> >  
> >  #define OCF_WRITE_REMOTE_AMP_ASSOC	0x000B
> >  typedef struct {
> 
> I am fine with these changes.
> 
> Acked-by: Marcel Holtmann <marcel@holtmann.org>

Johan can this patch be applied?

Best regards 
Andrei Emeltchenko 


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

* Re: [PATCH] Correct structures for AMP Assoc Read
  2012-01-05  9:50   ` Emeltchenko Andrei
@ 2012-01-05 10:40     ` Johan Hedberg
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2012-01-05 10:40 UTC (permalink / raw)
  To: Emeltchenko Andrei, Marcel Holtmann, linux-bluetooth

Hi Andrei,

On Thu, Jan 05, 2012, Emeltchenko Andrei wrote:
> On Thu, Dec 15, 2011 at 05:27:59PM +0100, Marcel Holtmann wrote:
> > Hi Andrei,
> > 
> > > Make struct names similar to kernel and remove static array since
> > > fragment length can be other size than HCI_MAX_NAME_LENGTH, which
> > > is for totally different purpose.
> > > ---
> > >  lib/hci.h |   11 +++++------
> > >  1 files changed, 5 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/lib/hci.h b/lib/hci.h
> > > index 51184ee..48692fa 100644
> > > --- a/lib/hci.h
> > > +++ b/lib/hci.h
> > > @@ -1382,17 +1382,16 @@ typedef struct {
> > >  #define OCF_READ_LOCAL_AMP_ASSOC	0x000A
> > >  typedef struct {
> > >  	uint8_t		handle;
> > > -	uint16_t	length_so_far;
> > > -	uint16_t	assoc_length;
> > > +	uint16_t	len_so_far;
> > > +	uint16_t	max_len;
> > >  } __attribute__ ((packed)) read_local_amp_assoc_cp;
> > > -#define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
> > > +
> > >  typedef struct {
> > >  	uint8_t		status;
> > >  	uint8_t		handle;
> > > -	uint16_t	length;
> > > -	uint8_t		fragment[HCI_MAX_NAME_LENGTH];
> > > +	uint16_t	rem_len;
> > > +	uint8_t		frag[0];
> > >  } __attribute__ ((packed)) read_local_amp_assoc_rp;
> > > -#define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
> > >  
> > >  #define OCF_WRITE_REMOTE_AMP_ASSOC	0x000B
> > >  typedef struct {
> > 
> > I am fine with these changes.
> > 
> > Acked-by: Marcel Holtmann <marcel@holtmann.org>
> 
> Johan can this patch be applied?

Yes, I had marked the email as read by mistake. It has now been pushed
upstream.

Johan

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

end of thread, other threads:[~2012-01-05 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15  9:48 [PATCH] Correct structures for AMP Assoc Read Emeltchenko Andrei
2011-12-15 16:27 ` Marcel Holtmann
2011-12-16  8:14   ` Emeltchenko Andrei
2012-01-05  9:50   ` Emeltchenko Andrei
2012-01-05 10:40     ` Johan Hedberg

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.