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

Configure Feed

Select the types of activity you want to include in your feed.

net: usb: sr9700: replace magic numbers with register bit macros

The first byte of the Rx frame is a copy of the Rx status register, so
0x40 corresponds to RSR_MF (meaning the frame is multicast). Replace
0x40 with RSR_MF for clarity. (All other bits of the RSR indicate
errors. The fact that the driver ignores these errors will be fixed by
a later patch.)

The first byte of the status URB is a copy of the NSR, so 0x40
corresponds to NSR_LINKST. Replace 0x40 with NSR_LINKST for clarity.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Reviewed-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://patch.msgid.link/20260124032248.26807-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ethan Nelson-Moore and committed by
Jakub Kicinski
3b721117 90defad2

+2 -2
+2 -2
drivers/net/usb/sr9700.c
··· 366 366 367 367 /* one skb may contains multiple packets */ 368 368 while (skb->len > SR_RX_OVERHEAD) { 369 - if (skb->data[0] != 0x40) 369 + if (skb->data[0] != RSR_MF) 370 370 return 0; 371 371 372 372 /* ignore the CRC length */ ··· 455 455 456 456 buf = urb->transfer_buffer; 457 457 458 - link = !!(buf[0] & 0x40); 458 + link = !!(buf[0] & NSR_LINKST); 459 459 sr9700_handle_link_change(dev->net, link); 460 460 } 461 461