Subject: [RFC][PATCH 08/11] bna: (partial) endianness annotations
Subsystems (3)
Signed-off-by Al Viro <[email protected]>
--- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 26 +++---- drivers/net/ethernet/brocade/bna/bfa_ioc.h | 4 +- drivers/net/ethernet/brocade/bna/bfi.h | 94 ++++++++++++------------- drivers/net/ethernet/brocade/bna/bfi_enet.h | 96 +++++++++++++------------- drivers/net/ethernet/brocade/bna/bna.h | 2 +- drivers/net/ethernet/brocade/bna/bna_enet.c | 6 +- drivers/net/ethernet/brocade/bna/bna_hw_defs.h | 34 ++++----- drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 2 +- 8 files changed, 132 insertions(+), 132 deletions(-)
drivers/net/ethernet/brocade/bna/bfa_ioc.c +13 -13
@@ -93,7 +93,7 @@ static void bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc *ioc,static void bfa_ioc_get_adapter_manufacturer (struct bfa_ioc *ioc,char *manufacturer);static void bfa_ioc_get_adapter_model (struct bfa_ioc *ioc,char *model); -static u64 bfa_ioc_get_pwwn (struct bfa_ioc *ioc); +static __be64 bfa_ioc_get_pwwn (struct bfa_ioc *ioc);/* IOC state machine definitions/declarations */ enum ioc_event {
@@ -1904,7 +1904,7 @@ bfa_nw_ioc_timeout(struct bfa_ioc *ioc)static void bfa_ioc_mbox_send (struct bfa_ioc *ioc,void *ioc_msg,int len) { -u32 *msgp = (u32 *) ioc_msg; +__le32 *msgp = (__le32 *) ioc_msg;u32 i;BUG_ON (!(len <=BFI_IOC_MSGLEN_MAX ));
@@ -1913,7 +1913,7 @@ bfa_ioc_mbox_send(struct bfa_ioc *ioc, void *ioc_msg, int len)* first write msg to mailbox registers */ for (i =0 ; i < len /sizeof (u32); i++) -writel (cpu_to_le32 (msgp[i]), +writel (le32_to_cpu (msgp[i]), ioc->ioc_regs.hfn_mbox + i *sizeof (u32));for (; i <BFI_IOC_MSGLEN_MAX /sizeof (u32); i++)
@@ -1936,7 +1936,7 @@ bfa_ioc_send_enable(struct bfa_ioc *ioc) enable_req.clscode =htons (ioc->clscode); enable_req.rsvd =htons (0 );/* overflow in 2106 */ - enable_req.tv_sec =ntohl (ktime_get_real_seconds ()); + enable_req.tv_sec =htonl (ktime_get_real_seconds ());bfa_ioc_mbox_send (ioc, &enable_req,sizeof (struct bfi_ioc_ctrl_req )); }
@@ -1950,7 +1950,7 @@ bfa_ioc_send_disable(struct bfa_ioc *ioc) disable_req.clscode =htons (ioc->clscode); disable_req.rsvd =htons (0 );/* overflow in 2106 */ - disable_req.tv_sec =ntohl (ktime_get_real_seconds ()); + disable_req.tv_sec =htonl (ktime_get_real_seconds ());bfa_ioc_mbox_send (ioc, &disable_req,sizeof (struct bfi_ioc_ctrl_req )); }
@@ -2417,7 +2417,7 @@ bfa_nw_ioc_auto_recover(bool auto_recover)static bool bfa_ioc_msgget (struct bfa_ioc *ioc,void *mbmsg) { -u32 *msgp = mbmsg; +__be32 *msgp = mbmsg;u32 r32;int i;
@@ -2924,7 +2924,7 @@ bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr) }/* WWN public */ -static u64 +static __be64 bfa_ioc_get_pwwn (struct bfa_ioc *ioc) {return ioc->attr->pwwn;
@@ -3072,12 +3072,12 @@ bfa_flash_write_send(struct bfa_flash *flash) (struct bfi_flash_write_req *) flash->mb.msg;u32 len; - msg->type =be32_to_cpu (flash->type); + msg->type =cpu_to_be32 (flash->type); msg->instance = flash->instance; - msg->offset =be32_to_cpu (flash->addr_off + flash->offset); + msg->offset =cpu_to_be32 (flash->addr_off + flash->offset); len = (flash->residue <BFA_FLASH_DMA_BUF_SZ ) ? flash->residue :BFA_FLASH_DMA_BUF_SZ ; - msg->length =be32_to_cpu (len); + msg->length =cpu_to_be32 (len);/* indicate if it's the last msg of the whole write operation */ msg->last = (len == flash->residue) ?1 :0 ;
@@ -3105,12 +3105,12 @@ bfa_flash_read_send(void *cbarg) (struct bfi_flash_read_req *) flash->mb.msg;u32 len; - msg->type =be32_to_cpu (flash->type); + msg->type =cpu_to_be32 (flash->type); msg->instance = flash->instance; - msg->offset =be32_to_cpu (flash->addr_off + flash->offset); + msg->offset =cpu_to_be32 (flash->addr_off + flash->offset); len = (flash->residue <BFA_FLASH_DMA_BUF_SZ ) ? flash->residue :BFA_FLASH_DMA_BUF_SZ ; - msg->length =be32_to_cpu (len); + msg->length =cpu_to_be32 (len);bfi_h2i_set (msg->mh,BFI_MC_FLASH ,BFI_FLASH_H2I_READ_REQ ,bfa_ioc_portid (flash->ioc));bfa_alen_set (&msg->alen, len, flash->dbuf_pa);
drivers/net/ethernet/brocade/bna/bfa_ioc.h +2 -2
@@ -60,8 +60,8 @@ struct bfa_dma {static inline void __bfa_dma_be_addr_set (union bfi_addr_u *dma_addr,u64 pa) { - dma_addr->a32.addr_lo = (u32 )htonl (pa); - dma_addr->a32.addr_hi = (u32 )htonl (upper_32_bits (pa)); + dma_addr->a32.addr_lo =htonl (pa); + dma_addr->a32.addr_hi =htonl (upper_32_bits (pa)); }#define bfa_alen_set (__alen, __len, __pa) \
drivers/net/ethernet/brocade/bna/bfi.h +47 -47
243 lines not on this page · raw message
drivers/net/ethernet/brocade/bna/bfi_enet.h +48 -48
225 lines not on this page · raw message
drivers/net/ethernet/brocade/bna/bna.h +1 -1
@@ -36,7 +36,7 @@ extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];*/ #define BNA_SET_DMA_ADDR (_addr, _bna_dma_addr) \ do { \ - u64 tmp_addr = \ + __be64 tmp_addr = \ cpu_to_be64((u64)(_addr)); \ (_bna_dma_addr)->msb = ((struct bna_dma_addr *)&tmp_addr)->msb; \ (_bna_dma_addr)->lsb = ((struct bna_dma_addr *)&tmp_addr)->lsb; \
drivers/net/ethernet/brocade/bna/bna_enet.c +3 -3
@@ -70,7 +70,7 @@ enum bna_ioceth_event {#define bna_stats_copy (_name, _type) \ do { \ count = sizeof(struct bfi_enet_stats_ ## _type) / sizeof(u64); \ - stats_src = (u64 *)&bna->stats.hw_stats_kva->_name ## _stats; \ + stats_src = (__be64 *)&bna->stats.hw_stats_kva->_name ## _stats; \ stats_dst = (u64 *)&bna->stats.hw_stats._name ## _stats; \ for (i = 0; i < count; i++) \ stats_dst[i] = be64_to_cpu(stats_src[i]); \
@@ -187,7 +187,7 @@ static void bna_bfi_stats_get_rsp(struct bna *bna, struct bfi_msgq_mhdr *msghdr) { struct bfi_enet_stats_req *stats_req = &bna->stats_mod.stats_get; -u64 *stats_src; +__be64 *stats_src;u64 *stats_dst;u32 tx_enet_mask =ntohl (stats_req->tx_enet_mask);u32 rx_enet_mask =ntohl (stats_req->rx_enet_mask);
@@ -201,7 +201,7 @@ bna_bfi_stats_get_rsp(struct bna *bna, struct bfi_msgq_mhdr *msghdr)bna_stats_copy (fc_rx, fc_rx);bna_stats_copy (fc_tx, fc_tx); - stats_src = (u64 *)&(bna->stats.hw_stats_kva->rxf_stats[0 ]); + stats_src = (__be64 *)&(bna->stats.hw_stats_kva->rxf_stats[0 ]);/* Copy Rxf stats to SW area, scatter them while copying */ for (i =0 ; i <BFI_ENET_CFG_MAX ; i++) {
drivers/net/ethernet/brocade/bna/bna_hw_defs.h +17 -17
@@ -351,13 +351,13 @@ struct bna_reg {/* TxQ Vector (a.k.a. Tx-Buffer Descriptor) */ struct bna_dma_addr { -u32 msb; -u32 lsb; +__be32 msb; +__be32 lsb; };struct bna_txq_wi_vector { -u16 reserved; -u16 length;/* Only 14 LSB are valid */ +__be16 reserved; +__be16 length;/* Only 14 LSB are valid */ struct bna_dma_addr host_addr;/* Tx-Buf DMA addr */ };
@@ -370,21 +370,21 @@ struct bna_txq_entry {struct {u8 reserved;u8 num_vectors;/* number of vectors present */ -u16 opcode;/* Either */ +__be16 opcode;/* Either */ /* BNA_TXQ_WI_SEND or */ /* BNA_TXQ_WI_SEND_LSO */ -u16 flags;/* OR of all the flags */ -u16 l4_hdr_size_n_offset; -u16 vlan_tag; -u16 lso_mss;/* Only 14 LSB are valid */ -u32 frame_length;/* Only 24 LSB are valid */ +__be16 flags;/* OR of all the flags */ +__be16 l4_hdr_size_n_offset; +__be16 vlan_tag; +__be16 lso_mss;/* Only 14 LSB are valid */ +__be32 frame_length;/* Only 24 LSB are valid */ } wi;struct { -u16 reserved; -u16 opcode;/* Must be */ +__be16 reserved; +__be16 opcode;/* Must be */ /* BNA_TXQ_WI_EXTENSION */ -u32 reserved2[3 ];/* Place holder for */ +__be32 reserved2[3 ];/* Place holder for */ /* removed vector (12 bytes) */ } wi_ext; } hdr;
@@ -398,10 +398,10 @@ struct bna_rxq_entry { /* Rx-Buffer *//* CQ Entry Structure */ struct bna_cq_entry { -u32 flags; -u16 vlan_tag; -u16 length; -u32 rss_hash; +__be32 flags; +__be16 vlan_tag; +__be16 length; +__be32 rss_hash;u8 valid;u8 reserved1;u8 reserved2;
drivers/net/ethernet/brocade/bna/bna_tx_rx.c +1 -1
@@ -278,7 +278,7 @@ bna_bfi_rx_vlan_filter_set(struct bna_rxf *rxf, u8 block_idx) req->bit_mask[i] =htonl (rxf->vlan_filter_table[j]); else - req->bit_mask[i] = 0xFFFFFFFF; + req->bit_mask[i] = htonl(0xFFFFFFFF); }bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL ,sizeof (struct bfi_enet_rx_vlan_req ), &req->mh);
Signature · 1 line
2.11.0