b43: be more user friendly with PHY info
PATCH 1/1 b43: be more user friendly with PHY info
First of all, use PHY names instead of magic numbers. It should make configuring kernel easier in case of not enabled PHY type support. Secondly, always print info about PHY. This is really basic info about hardware and quite important for the support level.
Signed-off-by Rafał Miłecki <[email protected]>
--- drivers/net/wireless/b43/main.c | 36 +++++++++++++++++++++++++++++++----- 1 files changed, 31 insertions(+), 5 deletions(-)
drivers/net/wireless/b43/main.c +31 -5
@@ -4277,6 +4277,33 @@ out:return err; } +static char *b43_phy_name (struct b43_wldev *dev,u8 phy_type) +{ +switch (phy_type) { +case B43_PHYTYPE_A : +return "A" ; +case B43_PHYTYPE_B : +return "B" ; +case B43_PHYTYPE_G : +return "G" ; +case B43_PHYTYPE_N : +return "N" ; +case B43_PHYTYPE_LP : +return "LP" ; +case B43_PHYTYPE_SSLPN : +return "SSLPN" ; +case B43_PHYTYPE_HT : +return "HT" ; +case B43_PHYTYPE_LCN : +return "LCN" ; +case B43_PHYTYPE_LCNXN : +return "LCNXN" ; + } + +b43err (dev->wl,"Unknown PHY Type: %d\n" , phy_type); +return "UNKNOWN" ; +} +/* Get PHY and RADIO versioning numbers */ static int b43_phy_versioning (struct b43_wldev *dev) {
@@ -4337,13 +4364,12 @@ static int b43_phy_versioning(struct b43_wldev *dev) unsupported =1 ; }if (unsupported) { -b43err (dev->wl,"FOUND UNSUPPORTED PHY " -"(Analog %u, Type %u, Revision %u)\n" , - analog_type, phy_type, phy_rev); +b43err (dev->wl,"FOUND UNSUPPORTED PHY (Analog %u, Type %s, Revision %u)\n" , + analog_type,b43_phy_name (dev, phy_type), phy_rev);return -EOPNOTSUPP ; } -b43dbg (dev->wl,"Found PHY: Analog %u, Type %u, Revision %u\n" , - analog_type, phy_type, phy_rev); +b43info (dev->wl,"Found PHY: Analog %u, Type %s, Revision %u\n" , + analog_type,b43_phy_name (dev, phy_type), phy_rev);/* Get RADIO versioning */ if (dev->dev->core_rev >=24 ) {
Signature · 1 line
1.7.7
PATCH 1/1 b43: be more user friendly with PHY info
Quoted 9 lines · Rafa? Mi?ecki
First of all, use PHY names instead of magic numbers. It should make configuring kernel easier in case of not enabled PHY type support. Secondly, always print info about PHY. This is really basic info about hardware and quite important for the support level.
Signed-off-by Rafa? Mi?ecki <[email protected]>--- drivers/net/wireless/b43/main.c | 36 +++++++++++++++++++++++++++++++----- 1 files changed, 31 insertions(+), 5 deletions(-)
I like this change. It is worth the small increase in the size of b43.
Larry
Quoted 58 lines
drivers/net/wireless/b43/main.c +31
-5@@ -4277,6 +4277,33 @@ out:return err; } +static char *b43_phy_name (struct b43_wldev *dev,u8 phy_type) +{ +switch (phy_type) { +case B43_PHYTYPE_A : +return "A" ; +case B43_PHYTYPE_B : +return "B" ; +case B43_PHYTYPE_G : +return "G" ; +case B43_PHYTYPE_N : +return "N" ; +case B43_PHYTYPE_LP : +return "LP" ; +case B43_PHYTYPE_SSLPN : +return "SSLPN" ; +case B43_PHYTYPE_HT : +return "HT" ; +case B43_PHYTYPE_LCN : +return "LCN" ; +case B43_PHYTYPE_LCNXN : +return "LCNXN" ; + } + +b43err (dev->wl,"Unknown PHY Type: %d\n" , phy_type); +return "UNKNOWN" ; +} +/* Get PHY and RADIO versioning numbers */ static int b43_phy_versioning (struct b43_wldev *dev) {@@ -4337,13 +4364,12 @@ static int b43_phy_versioning(struct b43_wldev *dev) unsupported =1 ; }if (unsupported) { -b43err (dev->wl,"FOUND UNSUPPORTED PHY " -"(Analog %u, Type %u, Revision %u)\n" , - analog_type, phy_type, phy_rev); +b43err (dev->wl,"FOUND UNSUPPORTED PHY (Analog %u, Type %s, Revision %u)\n" , + analog_type,b43_phy_name (dev, phy_type), phy_rev);return -EOPNOTSUPP ; } -b43dbg (dev->wl,"Found PHY: Analog %u, Type %u, Revision %u\n" , - analog_type, phy_type, phy_rev); +b43info (dev->wl,"Found PHY: Analog %u, Type %s, Revision %u\n" , + analog_type,b43_phy_name (dev, phy_type), phy_rev);/* Get RADIO versioning */ if (dev->dev->core_rev >=24 ) {