fore2000 - fix misannotations
authorAl Viro <viro@ftp.linux.org.uk>
Sun, 16 Mar 2008 22:23:04 +0000 (22:23 +0000)
committerJeff Garzik <jeff@garzik.org>
Mon, 17 Mar 2008 11:56:31 +0000 (07:56 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/atm/fore200e.c
drivers/atm/fore200e.h

index 9427a61..432181e 100644 (file)
@@ -1988,19 +1988,19 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg)
     if (fore200e_getstats(fore200e) < 0)
        return -EIO;
 
-    tmp.section_bip = cpu_to_be32(fore200e->stats->oc3.section_bip8_errors);
-    tmp.line_bip    = cpu_to_be32(fore200e->stats->oc3.line_bip24_errors);
-    tmp.path_bip    = cpu_to_be32(fore200e->stats->oc3.path_bip8_errors);
-    tmp.line_febe   = cpu_to_be32(fore200e->stats->oc3.line_febe_errors);
-    tmp.path_febe   = cpu_to_be32(fore200e->stats->oc3.path_febe_errors);
-    tmp.corr_hcs    = cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors);
-    tmp.uncorr_hcs  = cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors);
-    tmp.tx_cells    = cpu_to_be32(fore200e->stats->aal0.cells_transmitted)  +
-                     cpu_to_be32(fore200e->stats->aal34.cells_transmitted) +
-                     cpu_to_be32(fore200e->stats->aal5.cells_transmitted);
-    tmp.rx_cells    = cpu_to_be32(fore200e->stats->aal0.cells_received)     +
-                     cpu_to_be32(fore200e->stats->aal34.cells_received)    +
-                     cpu_to_be32(fore200e->stats->aal5.cells_received);
+    tmp.section_bip = be32_to_cpu(fore200e->stats->oc3.section_bip8_errors);
+    tmp.line_bip    = be32_to_cpu(fore200e->stats->oc3.line_bip24_errors);
+    tmp.path_bip    = be32_to_cpu(fore200e->stats->oc3.path_bip8_errors);
+    tmp.line_febe   = be32_to_cpu(fore200e->stats->oc3.line_febe_errors);
+    tmp.path_febe   = be32_to_cpu(fore200e->stats->oc3.path_febe_errors);
+    tmp.corr_hcs    = be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors);
+    tmp.uncorr_hcs  = be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors);
+    tmp.tx_cells    = be32_to_cpu(fore200e->stats->aal0.cells_transmitted)  +
+                     be32_to_cpu(fore200e->stats->aal34.cells_transmitted) +
+                     be32_to_cpu(fore200e->stats->aal5.cells_transmitted);
+    tmp.rx_cells    = be32_to_cpu(fore200e->stats->aal0.cells_received)     +
+                     be32_to_cpu(fore200e->stats->aal34.cells_received)    +
+                     be32_to_cpu(fore200e->stats->aal5.cells_received);
 
     if (arg)
        return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0;       
@@ -2587,7 +2587,7 @@ fore200e_start_fw(struct fore200e* fore200e)
 static int __devinit
 fore200e_load_fw(struct fore200e* fore200e)
 {
-    u32* fw_data = (u32*) fore200e->bus->fw_data;
+    __le32* fw_data = (__le32*) fore200e->bus->fw_data;
     u32  fw_size = (u32) *fore200e->bus->fw_size / sizeof(u32);
 
     struct fw_header* fw_header = (struct fw_header*) fw_data;
@@ -2965,8 +2965,8 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "  4b5b:\n"
                       "     crc_header_errors:\t\t%10u\n"
                       "     framing_errors:\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->phy.crc_header_errors),
-                      cpu_to_be32(fore200e->stats->phy.framing_errors));
+                      be32_to_cpu(fore200e->stats->phy.crc_header_errors),
+                      be32_to_cpu(fore200e->stats->phy.framing_errors));
     
     if (!left--)
        return sprintf(page, "\n"
@@ -2978,13 +2978,13 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "     path_febe_errors:\t\t%10u\n"
                       "     corr_hcs_errors:\t\t%10u\n"
                       "     ucorr_hcs_errors:\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->oc3.section_bip8_errors),
-                      cpu_to_be32(fore200e->stats->oc3.path_bip8_errors),
-                      cpu_to_be32(fore200e->stats->oc3.line_bip24_errors),
-                      cpu_to_be32(fore200e->stats->oc3.line_febe_errors),
-                      cpu_to_be32(fore200e->stats->oc3.path_febe_errors),
-                      cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors),
-                      cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors));
+                      be32_to_cpu(fore200e->stats->oc3.section_bip8_errors),
+                      be32_to_cpu(fore200e->stats->oc3.path_bip8_errors),
+                      be32_to_cpu(fore200e->stats->oc3.line_bip24_errors),
+                      be32_to_cpu(fore200e->stats->oc3.line_febe_errors),
+                      be32_to_cpu(fore200e->stats->oc3.path_febe_errors),
+                      be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors),
+                      be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors));
 
     if (!left--)
        return sprintf(page,"\n"
@@ -2995,12 +2995,12 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "     vpi no conn:\t\t%10u\n"
                       "     vci out of range:\t\t%10u\n"
                       "     vci no conn:\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->atm.cells_transmitted),
-                      cpu_to_be32(fore200e->stats->atm.cells_received),
-                      cpu_to_be32(fore200e->stats->atm.vpi_bad_range),
-                      cpu_to_be32(fore200e->stats->atm.vpi_no_conn),
-                      cpu_to_be32(fore200e->stats->atm.vci_bad_range),
-                      cpu_to_be32(fore200e->stats->atm.vci_no_conn));
+                      be32_to_cpu(fore200e->stats->atm.cells_transmitted),
+                      be32_to_cpu(fore200e->stats->atm.cells_received),
+                      be32_to_cpu(fore200e->stats->atm.vpi_bad_range),
+                      be32_to_cpu(fore200e->stats->atm.vpi_no_conn),
+                      be32_to_cpu(fore200e->stats->atm.vci_bad_range),
+                      be32_to_cpu(fore200e->stats->atm.vci_no_conn));
     
     if (!left--)
        return sprintf(page,"\n"
@@ -3008,9 +3008,9 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "     TX:\t\t\t%10u\n"
                       "     RX:\t\t\t%10u\n"
                       "     dropped:\t\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->aal0.cells_transmitted),
-                      cpu_to_be32(fore200e->stats->aal0.cells_received),
-                      cpu_to_be32(fore200e->stats->aal0.cells_dropped));
+                      be32_to_cpu(fore200e->stats->aal0.cells_transmitted),
+                      be32_to_cpu(fore200e->stats->aal0.cells_received),
+                      be32_to_cpu(fore200e->stats->aal0.cells_dropped));
     
     if (!left--)
        return sprintf(page,"\n"
@@ -3026,15 +3026,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "       RX:\t\t\t%10u\n"
                       "       dropped:\t\t\t%10u\n"
                       "       protocol errors:\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->aal34.cells_transmitted),
-                      cpu_to_be32(fore200e->stats->aal34.cells_received),
-                      cpu_to_be32(fore200e->stats->aal34.cells_dropped),
-                      cpu_to_be32(fore200e->stats->aal34.cells_crc_errors),
-                      cpu_to_be32(fore200e->stats->aal34.cells_protocol_errors),
-                      cpu_to_be32(fore200e->stats->aal34.cspdus_transmitted),
-                      cpu_to_be32(fore200e->stats->aal34.cspdus_received),
-                      cpu_to_be32(fore200e->stats->aal34.cspdus_dropped),
-                      cpu_to_be32(fore200e->stats->aal34.cspdus_protocol_errors));
+                      be32_to_cpu(fore200e->stats->aal34.cells_transmitted),
+                      be32_to_cpu(fore200e->stats->aal34.cells_received),
+                      be32_to_cpu(fore200e->stats->aal34.cells_dropped),
+                      be32_to_cpu(fore200e->stats->aal34.cells_crc_errors),
+                      be32_to_cpu(fore200e->stats->aal34.cells_protocol_errors),
+                      be32_to_cpu(fore200e->stats->aal34.cspdus_transmitted),
+                      be32_to_cpu(fore200e->stats->aal34.cspdus_received),
+                      be32_to_cpu(fore200e->stats->aal34.cspdus_dropped),
+                      be32_to_cpu(fore200e->stats->aal34.cspdus_protocol_errors));
     
     if (!left--)
        return sprintf(page,"\n"
@@ -3050,15 +3050,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "       dropped:\t\t\t%10u\n"
                       "       CRC errors:\t\t%10u\n"
                       "       protocol errors:\t\t%10u\n",
-                      cpu_to_be32(fore200e->stats->aal5.cells_transmitted),
-                      cpu_to_be32(fore200e->stats->aal5.cells_received),
-                      cpu_to_be32(fore200e->stats->aal5.cells_dropped),
-                      cpu_to_be32(fore200e->stats->aal5.congestion_experienced),
-                      cpu_to_be32(fore200e->stats->aal5.cspdus_transmitted),
-                      cpu_to_be32(fore200e->stats->aal5.cspdus_received),
-                      cpu_to_be32(fore200e->stats->aal5.cspdus_dropped),
-                      cpu_to_be32(fore200e->stats->aal5.cspdus_crc_errors),
-                      cpu_to_be32(fore200e->stats->aal5.cspdus_protocol_errors));
+                      be32_to_cpu(fore200e->stats->aal5.cells_transmitted),
+                      be32_to_cpu(fore200e->stats->aal5.cells_received),
+                      be32_to_cpu(fore200e->stats->aal5.cells_dropped),
+                      be32_to_cpu(fore200e->stats->aal5.congestion_experienced),
+                      be32_to_cpu(fore200e->stats->aal5.cspdus_transmitted),
+                      be32_to_cpu(fore200e->stats->aal5.cspdus_received),
+                      be32_to_cpu(fore200e->stats->aal5.cspdus_dropped),
+                      be32_to_cpu(fore200e->stats->aal5.cspdus_crc_errors),
+                      be32_to_cpu(fore200e->stats->aal5.cspdus_protocol_errors));
     
     if (!left--)
        return sprintf(page,"\n"
@@ -3069,11 +3069,11 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
                       "     large b2:\t\t\t%10u\n"
                       "     RX PDUs:\t\t\t%10u\n"
                       "     TX PDUs:\t\t\t%10lu\n",
-                      cpu_to_be32(fore200e->stats->aux.small_b1_failed),
-                      cpu_to_be32(fore200e->stats->aux.large_b1_failed),
-                      cpu_to_be32(fore200e->stats->aux.small_b2_failed),
-                      cpu_to_be32(fore200e->stats->aux.large_b2_failed),
-                      cpu_to_be32(fore200e->stats->aux.rpd_alloc_failed),
+                      be32_to_cpu(fore200e->stats->aux.small_b1_failed),
+                      be32_to_cpu(fore200e->stats->aux.large_b1_failed),
+                      be32_to_cpu(fore200e->stats->aux.small_b2_failed),
+                      be32_to_cpu(fore200e->stats->aux.large_b2_failed),
+                      be32_to_cpu(fore200e->stats->aux.rpd_alloc_failed),
                       fore200e->tx_sat);
     
     if (!left--)
index b85a546..183841c 100644 (file)
@@ -349,90 +349,90 @@ typedef struct oc3_block {
 /* physical encoding statistics */
 
 typedef struct stats_phy {
-    u32 crc_header_errors;    /* cells received with bad header CRC */
-    u32 framing_errors;       /* cells received with bad framing    */
-    u32 pad[ 2 ];             /* i960 padding                       */
+    __be32 crc_header_errors;    /* cells received with bad header CRC */
+    __be32 framing_errors;       /* cells received with bad framing    */
+    __be32 pad[ 2 ];             /* i960 padding                       */
 } stats_phy_t;
 
 
 /* OC-3 statistics */
 
 typedef struct stats_oc3 {
-    u32 section_bip8_errors;    /* section 8 bit interleaved parity    */
-    u32 path_bip8_errors;       /* path 8 bit interleaved parity       */
-    u32 line_bip24_errors;      /* line 24 bit interleaved parity      */
-    u32 line_febe_errors;       /* line far end block errors           */
-    u32 path_febe_errors;       /* path far end block errors           */
-    u32 corr_hcs_errors;        /* correctable header check sequence   */
-    u32 ucorr_hcs_errors;       /* uncorrectable header check sequence */
-    u32 pad[ 1 ];               /* i960 padding                        */
+    __be32 section_bip8_errors;    /* section 8 bit interleaved parity    */
+    __be32 path_bip8_errors;       /* path 8 bit interleaved parity       */
+    __be32 line_bip24_errors;      /* line 24 bit interleaved parity      */
+    __be32 line_febe_errors;       /* line far end block errors           */
+    __be32 path_febe_errors;       /* path far end block errors           */
+    __be32 corr_hcs_errors;        /* correctable header check sequence   */
+    __be32 ucorr_hcs_errors;       /* uncorrectable header check sequence */
+    __be32 pad[ 1 ];               /* i960 padding                        */
 } stats_oc3_t;
 
 
 /* ATM statistics */
 
 typedef struct stats_atm {
-    u32        cells_transmitted;    /* cells transmitted                 */
-    u32        cells_received;       /* cells received                    */
-    u32        vpi_bad_range;        /* cell drops: VPI out of range      */
-    u32        vpi_no_conn;          /* cell drops: no connection for VPI */
-    u32        vci_bad_range;        /* cell drops: VCI out of range      */
-    u32        vci_no_conn;          /* cell drops: no connection for VCI */
-    u32        pad[ 2 ];             /* i960 padding                      */
+    __be32     cells_transmitted;    /* cells transmitted                 */
+    __be32     cells_received;       /* cells received                    */
+    __be32     vpi_bad_range;        /* cell drops: VPI out of range      */
+    __be32     vpi_no_conn;          /* cell drops: no connection for VPI */
+    __be32     vci_bad_range;        /* cell drops: VCI out of range      */
+    __be32     vci_no_conn;          /* cell drops: no connection for VCI */
+    __be32     pad[ 2 ];             /* i960 padding                      */
 } stats_atm_t;
 
 /* AAL0 statistics */
 
 typedef struct stats_aal0 {
-    u32        cells_transmitted;    /* cells transmitted */
-    u32        cells_received;       /* cells received    */
-    u32        cells_dropped;        /* cells dropped     */
-    u32        pad[ 1 ];             /* i960 padding      */
+    __be32     cells_transmitted;    /* cells transmitted */
+    __be32     cells_received;       /* cells received    */
+    __be32     cells_dropped;        /* cells dropped     */
+    __be32     pad[ 1 ];             /* i960 padding      */
 } stats_aal0_t;
 
 
 /* AAL3/4 statistics */
 
 typedef struct stats_aal34 {
-    u32        cells_transmitted;         /* cells transmitted from segmented PDUs */
-    u32        cells_received;            /* cells reassembled into PDUs           */
-    u32        cells_crc_errors;          /* payload CRC error count               */
-    u32        cells_protocol_errors;     /* SAR or CS layer protocol errors       */
-    u32        cells_dropped;             /* cells dropped: partial reassembly     */
-    u32        cspdus_transmitted;        /* CS PDUs transmitted                   */
-    u32        cspdus_received;           /* CS PDUs received                      */
-    u32        cspdus_protocol_errors;    /* CS layer protocol errors              */
-    u32        cspdus_dropped;            /* reassembled PDUs drop'd (in cells)    */
-    u32        pad[ 3 ];                  /* i960 padding                          */
+    __be32     cells_transmitted;         /* cells transmitted from segmented PDUs */
+    __be32     cells_received;            /* cells reassembled into PDUs           */
+    __be32     cells_crc_errors;          /* payload CRC error count               */
+    __be32     cells_protocol_errors;     /* SAR or CS layer protocol errors       */
+    __be32     cells_dropped;             /* cells dropped: partial reassembly     */
+    __be32     cspdus_transmitted;        /* CS PDUs transmitted                   */
+    __be32     cspdus_received;           /* CS PDUs received                      */
+    __be32     cspdus_protocol_errors;    /* CS layer protocol errors              */
+    __be32     cspdus_dropped;            /* reassembled PDUs drop'd (in cells)    */
+    __be32     pad[ 3 ];                  /* i960 padding                          */
 } stats_aal34_t;
 
 
 /* AAL5 statistics */
 
 typedef struct stats_aal5 {
-    u32        cells_transmitted;         /* cells transmitted from segmented SDUs */
-    u32        cells_received;            /* cells reassembled into SDUs           */
-    u32        cells_dropped;             /* reassembled PDUs dropped (in cells)   */
-    u32        congestion_experienced;    /* CRC error and length wrong            */
-    u32        cspdus_transmitted;        /* CS PDUs transmitted                   */
-    u32        cspdus_received;           /* CS PDUs received                      */
-    u32        cspdus_crc_errors;         /* CS PDUs CRC errors                    */
-    u32        cspdus_protocol_errors;    /* CS layer protocol errors              */
-    u32        cspdus_dropped;            /* reassembled PDUs dropped              */
-    u32        pad[ 3 ];                  /* i960 padding                          */
+    __be32     cells_transmitted;         /* cells transmitted from segmented SDUs */
+    __be32     cells_received;            /* cells reassembled into SDUs           */
+    __be32     cells_dropped;             /* reassembled PDUs dropped (in cells)   */
+    __be32     congestion_experienced;    /* CRC error and length wrong            */
+    __be32     cspdus_transmitted;        /* CS PDUs transmitted                   */
+    __be32     cspdus_received;           /* CS PDUs received                      */
+    __be32     cspdus_crc_errors;         /* CS PDUs CRC errors                    */
+    __be32     cspdus_protocol_errors;    /* CS layer protocol errors              */
+    __be32     cspdus_dropped;            /* reassembled PDUs dropped              */
+    __be32     pad[ 3 ];                  /* i960 padding                          */
 } stats_aal5_t;
 
 
 /* auxiliary statistics */
 
 typedef struct stats_aux {
-    u32        small_b1_failed;     /* receive BD allocation failures  */
-    u32        large_b1_failed;     /* receive BD allocation failures  */
-    u32        small_b2_failed;     /* receive BD allocation failures  */
-    u32        large_b2_failed;     /* receive BD allocation failures  */
-    u32        rpd_alloc_failed;    /* receive PDU allocation failures */
-    u32        receive_carrier;     /* no carrier = 0, carrier = 1     */
-    u32        pad[ 2 ];            /* i960 padding                    */
+    __be32     small_b1_failed;     /* receive BD allocation failures  */
+    __be32     large_b1_failed;     /* receive BD allocation failures  */
+    __be32     small_b2_failed;     /* receive BD allocation failures  */
+    __be32     large_b2_failed;     /* receive BD allocation failures  */
+    __be32     rpd_alloc_failed;    /* receive PDU allocation failures */
+    __be32     receive_carrier;     /* no carrier = 0, carrier = 1     */
+    __be32     pad[ 2 ];            /* i960 padding                    */
 } stats_aux_t;
 
 
@@ -643,10 +643,10 @@ typedef struct host_bsq {
 /* header of the firmware image */
 
 typedef struct fw_header {
-    u32 magic;           /* magic number                               */
-    u32 version;         /* firmware version id                        */
-    u32 load_offset;     /* fw load offset in board memory             */
-    u32 start_offset;    /* fw execution start address in board memory */
+    __le32 magic;           /* magic number                               */
+    __le32 version;         /* firmware version id                        */
+    __le32 load_offset;     /* fw load offset in board memory             */
+    __le32 start_offset;    /* fw execution start address in board memory */
 } fw_header_t;
 
 #define FW_HEADER_MAGIC  0x65726f66    /* 'fore' */