Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'net-aquantia-ptp-followup-fixes'

Igor Russkikh says:

====================
net: aquantia: ptp followup fixes

Here are two sparse warnings, third patch is a fix for
scaled_ppm_to_ppb missing. Eventually I reworked this
to exclude ptp module from build. Please consider it instead
of this patch: https://patchwork.ozlabs.org/patch/1184171/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+92 -8
+2 -1
drivers/net/ethernet/aquantia/atlantic/Makefile
··· 24 24 aq_ethtool.o \ 25 25 aq_drvinfo.o \ 26 26 aq_filters.o \ 27 - aq_ptp.o \ 28 27 aq_phy.o \ 29 28 hw_atl/hw_atl_a0.o \ 30 29 hw_atl/hw_atl_b0.o \ 31 30 hw_atl/hw_atl_utils.o \ 32 31 hw_atl/hw_atl_utils_fw2x.o \ 33 32 hw_atl/hw_atl_llh.o 33 + 34 + atlantic-$(CONFIG_PTP_1588_CLOCK) += aq_ptp.o
+1 -1
drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
··· 947 947 { 948 948 struct aq_ptp_s *aq_ptp = aq_nic->aq_ptp; 949 949 unsigned int tx_ring_idx, rx_ring_idx; 950 - struct aq_ring_s *hwts = 0; 950 + struct aq_ring_s *hwts; 951 951 u32 tx_tc_mode, rx_tc_mode; 952 952 struct aq_ring_s *ring; 953 953 int err;
+84
drivers/net/ethernet/aquantia/atlantic/aq_ptp.h
··· 11 11 #include <linux/net_tstamp.h> 12 12 #include <linux/version.h> 13 13 14 + #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) 15 + 14 16 /* Common functions */ 15 17 int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_vec); 16 18 ··· 55 53 struct ptp_clock *aq_ptp_get_ptp_clock(struct aq_ptp_s *aq_ptp); 56 54 57 55 int aq_ptp_link_change(struct aq_nic_s *aq_nic); 56 + 57 + #else 58 + 59 + static inline int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_vec) 60 + { 61 + return 0; 62 + } 63 + 64 + static inline void aq_ptp_unregister(struct aq_nic_s *aq_nic) {} 65 + 66 + static inline void aq_ptp_free(struct aq_nic_s *aq_nic) 67 + { 68 + } 69 + 70 + static inline int aq_ptp_irq_alloc(struct aq_nic_s *aq_nic) 71 + { 72 + return 0; 73 + } 74 + 75 + static inline void aq_ptp_irq_free(struct aq_nic_s *aq_nic) 76 + { 77 + } 78 + 79 + static inline int aq_ptp_ring_alloc(struct aq_nic_s *aq_nic) 80 + { 81 + return 0; 82 + } 83 + 84 + static inline void aq_ptp_ring_free(struct aq_nic_s *aq_nic) {} 85 + 86 + static inline int aq_ptp_ring_init(struct aq_nic_s *aq_nic) 87 + { 88 + return 0; 89 + } 90 + 91 + static inline int aq_ptp_ring_start(struct aq_nic_s *aq_nic) 92 + { 93 + return 0; 94 + } 95 + 96 + static inline void aq_ptp_ring_stop(struct aq_nic_s *aq_nic) {} 97 + static inline void aq_ptp_ring_deinit(struct aq_nic_s *aq_nic) {} 98 + static inline void aq_ptp_service_task(struct aq_nic_s *aq_nic) {} 99 + static inline void aq_ptp_tm_offset_set(struct aq_nic_s *aq_nic, 100 + unsigned int mbps) {} 101 + static inline void aq_ptp_clock_init(struct aq_nic_s *aq_nic) {} 102 + static inline int aq_ptp_xmit(struct aq_nic_s *aq_nic, struct sk_buff *skb) 103 + { 104 + return -EOPNOTSUPP; 105 + } 106 + 107 + static inline void aq_ptp_tx_hwtstamp(struct aq_nic_s *aq_nic, u64 timestamp) {} 108 + static inline void aq_ptp_hwtstamp_config_get(struct aq_ptp_s *aq_ptp, 109 + struct hwtstamp_config *config) {} 110 + static inline int aq_ptp_hwtstamp_config_set(struct aq_ptp_s *aq_ptp, 111 + struct hwtstamp_config *config) 112 + { 113 + return 0; 114 + } 115 + 116 + static inline bool aq_ptp_ring(struct aq_nic_s *aq_nic, struct aq_ring_s *ring) 117 + { 118 + return false; 119 + } 120 + 121 + static inline u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, 122 + struct sk_buff *skb, u8 *p, 123 + unsigned int len) 124 + { 125 + return 0; 126 + } 127 + 128 + static inline struct ptp_clock *aq_ptp_get_ptp_clock(struct aq_ptp_s *aq_ptp) 129 + { 130 + return NULL; 131 + } 132 + 133 + static inline int aq_ptp_link_change(struct aq_nic_s *aq_nic) 134 + { 135 + return 0; 136 + } 137 + #endif 58 138 59 139 #endif /* AQ_PTP_H */
+4 -5
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
··· 1236 1236 { 1237 1237 unsigned int offset = 14; 1238 1238 struct ethhdr *eth; 1239 - u64 sec; 1239 + __be64 sec; 1240 + __be32 ns; 1240 1241 u8 *ptr; 1241 - u32 ns; 1242 1242 1243 1243 if (len <= offset || !timestamp) 1244 1244 return 0; ··· 1256 1256 ptr += sizeof(sec); 1257 1257 memcpy(&ns, ptr, sizeof(ns)); 1258 1258 1259 - sec = be64_to_cpu(sec) & 0xffffffffffffllu; 1260 - ns = be32_to_cpu(ns); 1261 - *timestamp = sec * NSEC_PER_SEC + ns + self->ptp_clk_offset; 1259 + *timestamp = (be64_to_cpu(sec) & 0xffffffffffffllu) * NSEC_PER_SEC + 1260 + be32_to_cpu(ns) + self->ptp_clk_offset; 1262 1261 1263 1262 eth = (struct ethhdr *)p; 1264 1263
+1 -1
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
··· 41 41 u16 status; 42 42 u16 pkt_len; 43 43 u16 next_desc_ptr; 44 - u16 vlan; 44 + __le16 vlan; 45 45 }; 46 46 47 47 /* Hardware rx HW TIMESTAMP writeback */