mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
net: phy: Replace phy driver features u32 with link_mode bitmap
This is one step in allowing phylib to make use of link_mode bitmaps, instead of u32 for supported and advertised features. Convert the phy drivers to use bitmaps to indicates the features they support. Build bitmap equivalents of the u32 values at runtime, and have the drivers point to the appropriate bitmap. These bitmaps are shared, and we don't want a driver to modify them. So mark them __ro_after_init. Within phylib, the features bitmap is currently turned back into a u32. This will be removed once the whole of phylib, and the drivers are converted to use bitmaps. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d0939c26c5
commit
719655a149
9 changed files with 197 additions and 38 deletions
|
@ -43,6 +43,15 @@ static inline void linkmode_set_bit(int nr, volatile unsigned long *addr)
|
|||
__set_bit(nr, addr);
|
||||
}
|
||||
|
||||
static inline void linkmode_set_bit_array(const int *array, int array_size,
|
||||
unsigned long *addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < array_size; i++)
|
||||
linkmode_set_bit(array[i], addr);
|
||||
}
|
||||
|
||||
static inline void linkmode_clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
__clear_bit(nr, addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue