Message ID | 20240305114045.388893-6-diogo.ivo@siemens.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Support ICSSG-based Ethernet on AM65x SR1.0 devices | expand |
On Tue, Mar 05, 2024 at 11:40:25AM +0000, Diogo Ivo wrote: > +struct emac_tx_ts_response_sr1 { > + u32 lo_ts; > + u32 hi_ts; > + u32 reserved; > + u32 cookie; > +}; In patch 10, this comes from skb->data, so seems to be a packet. Is the data dependent on the host endian, or is it always little endian?
On 3/5/24 14:41, Russell King (Oracle) wrote: > On Tue, Mar 05, 2024 at 11:40:25AM +0000, Diogo Ivo wrote: >> +struct emac_tx_ts_response_sr1 { >> + u32 lo_ts; >> + u32 hi_ts; >> + u32 reserved; >> + u32 cookie; >> +}; > > In patch 10, this comes from skb->data, so seems to be a packet. Is the > data dependent on the host endian, or is it always little endian? Since prueth_rx_mgm_rsp_thread() in patch 10 calls le32_to_cpu() on the data it gets from skb->data it seems likely that here the data is also __le32 and these calls should also be added so that we can use u32 data types. I will add these calls for next version unless there is some insight here that I am missing. Best regards, Diogo
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.h b/drivers/net/ethernet/ti/icssg/icssg_prueth.h index 5d792e9bade0..c5632a2388a1 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.h +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.h @@ -129,6 +129,7 @@ struct prueth_rx_chn { /* data for each emac port */ struct prueth_emac { + bool is_sr1; bool fw_running; struct prueth *prueth; struct net_device *ndev; @@ -157,6 +158,10 @@ struct prueth_emac { int rx_flow_id_base; int tx_ch_num; + /* SR1.0 Management channel */ + struct prueth_rx_chn rx_mgm_chn; + int rx_mgm_flow_id_base; + spinlock_t lock; /* serialize access */ /* TX HW Timestamping */ @@ -167,7 +172,7 @@ struct prueth_emac { u8 cmd_seq; /* shutdown related */ - u32 cmd_data[4]; + __le32 cmd_data[4]; struct completion cmd_complete; /* Mutex to serialize access to firmware command interface */ struct mutex cmd_lock; @@ -251,6 +256,13 @@ struct emac_tx_ts_response { u32 hi_ts; }; +struct emac_tx_ts_response_sr1 { + u32 lo_ts; + u32 hi_ts; + u32 reserved; + u32 cookie; +}; + /* get PRUSS SLICE number from prueth_emac */ static inline int prueth_emac_slice(struct prueth_emac *emac) {