lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [07/22] Cyclades PC300 driver: ioctl() fixes for mixed 64/32-bit systems
Date
From

> +struct pc300_net_stats {
> + u64 rx_packets;
...
> + u64 rx_compressed;
> + u64 tx_compressed;
> +};
> +
> typedef struct pc300stats {
> int hw_type;
> u32 line_on;
> u32 line_off;
> - struct net_device_stats gen_stats;
> + /* Use this instead of net_device_stats, since passing
> + * net_device_stats breaks 32-bit user processes on
> 64-bit kernels,
> + * and rtnetlink is unreasonably complicated just to get
> + * some statistics.
> + */
> + struct pc300_net_stats net_stats;
> falc_t te_stats;
> } pc300stats_t;

Since 'struct net_device_stats' looks like a common structure,
maybe the 64bit version should be added in the same place??

...
> +struct pc300hw_user {
> + int type; /* RSV, X21, etc. */
> + int bus; /* Bus (PCI, PMC, etc.) */
> + int nchan; /* number of channels */
> + int irq; /* interrupt request level */
> + u32 clock; /* Board clock */
> + u8 cpld_id; /* CPLD ID (TE only) */
> + u16 cpld_reg1; /* CPLD reg 1 (TE only) */

You should probably make all the fields fixed sized types and
ensure there is no implicit padding added between fields.

David




\
 
 \ /
  Last update: 2012-01-30 12:47    [W:0.031 / U:4.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site