]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet
authorAnsuel Smith <ansuelsmth@gmail.com>
Wed, 2 Feb 2022 00:03:34 +0000 (01:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Feb 2022 14:44:00 +0000 (14:44 +0000)
commit57b05699e6d5ed61bd695b0179fb4c28b8e48e4a
tree4cc3f463556f5b043a1d8dbe1130241bc1117f52
parent4263e26a140b0fd210cf1323c85ba1a25b8ff4fb
net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet

mgmt Ethernet packet can read/write up to 16byte at times. The len reg
is limited to 15 (0xf). The switch actually sends and accepts data in 4
different steps of len values.
Len steps:
- 0: nothing
- 1-4: first 4 byte
- 5-6: first 12 byte
- 7-15: all 16 byte

In the alloc skb function we check if the len is 16 and we fix it to a
len of 15. It the read/write function interest to extract the real asked
data. The tagger handler will always copy the fully 16byte with a READ
command. This is useful for some big regs like the fdb reg that are
more than 4byte of data. This permits to introduce a bulk function that
will send and request the entire entry in one go.
Write function is changed and it does now require to pass the pointer to
val to also handle array val.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c