aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/b44.c
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2019-10-12 02:18:16 +0300
committerDavid S. Miller <davem@davemloft.net>2019-10-14 16:45:40 -0700
commit664277781c4cb312971c5a2e2df3290bd990ac14 (patch)
tree7af0c48089945b147dac312260a281caffaf6c68 /drivers/net/ethernet/broadcom/b44.c
parentnet: dsa: sja1105: Move PTP data to its own private structure (diff)
downloadlinux-dev-664277781c4cb312971c5a2e2df3290bd990ac14.tar.xz
linux-dev-664277781c4cb312971c5a2e2df3290bd990ac14.zip
net: dsa: sja1105: Change the PTP command access pattern
The PTP command register contains enable bits for: - Putting the 64-bit PTPCLKVAL register in add/subtract or write mode - Taking timestamps off of the corrected vs free-running clock - Starting/stopping the TTEthernet scheduling - Starting/stopping PPS output - Resetting the switch When a command needs to be issued (e.g. "change the PTPCLKVAL from write mode to add/subtract mode"), one cannot simply write to the command register setting the PTPCLKADD bit to 1, because that would zeroize the other settings. One also cannot do a read-modify-write (that would be too easy for this hardware) because not all bits of the command register are readable over SPI. So this leaves us with the only option of keeping the value of the PTP command register in the driver, and operating on that. Actually there are 2 types of PTP operations now: - Operations that modify the cached PTP command. These operate on ptp_data->cmd as a pointer. - Operations that apply all previously cached PTP settings, but don't otherwise cache what they did themselves. The sja1105_ptp_reset function is such an example. It copies the ptp_data->cmd on stack before modifying and writing it to SPI. This practically means that struct sja1105_ptp_cmd is no longer an implementation detail, since it needs to be stored in full into struct sja1105_ptp_data, and hence in struct sja1105_private. So the (*ptp_cmd) function prototype can change and take struct sja1105_ptp_cmd as second argument now. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/b44.c')
0 files changed, 0 insertions, 0 deletions