STRUCT B43_PHY_OPERATIONS(9)
π struct b43_phy_operations(9) β a Kernel API Manual moment β¨
okay so bestie, gather round, because this one is literally the plug-and-play contract for b43 PHY drivers π«Ά it's the big ol' pile of function pointers that says "here's how you talk to my PHY," and it lives in the Kernel API Manual. every single member below is a vibe check the driver has to pass. no cap, some of them are mandatory and the kernel will absolutely not be normal about it if you leave them NULL π
β¨ NAME β¨
struct b43_phy_operations β Function pointers for PHY ops. that's it, that's the whole name. it's giving "interface struct with main character energy" π
πΈ SYNOPSIS πΈ
struct b43_phy_operations {
int (*allocate)(struct b43_wldev *dev);
void (*free)(struct b43_wldev *dev);
void (*prepare_structs)(struct b43_wldev *dev);
int (*prepare_hardware)(struct b43_wldev *dev);
int (*init)(struct b43_wldev *dev);
void (*exit)(struct b43_wldev *dev);
u16 (*phy_read)(struct b43_wldev *dev, u16 reg);
void (*phy_write)(struct b43_wldev *dev, u16 reg, u16 value);
void (*phy_maskset)(struct b43_wldev *dev, u16 reg, u16 mask, u16 set);
u16 (*radio_read)(struct b43_wldev *dev, u16 reg);
void (*radio_write)(struct b43_wldev *dev, u16 reg, u16 value);
bool (*supports_hwpctl)(struct b43_wldev *dev);
void (*software_rfkill)(struct b43_wldev *dev, bool blocked);
void (*switch_analog)(struct b43_wldev *dev, bool on);
int (*switch_channel)(struct b43_wldev *dev, unsigned int new_channel);
unsigned int (*get_default_chan)(struct b43_wldev *dev);
void (*set_rx_antenna)(struct b43_wldev *dev, int antenna);
int (*interf_mitigation)(struct b43_wldev *dev, enum b43_interference_mitigation new_mode);
enum b43_txpwr_result (*recalc_txpower)(struct b43_wldev *dev, bool ignore_tssi);
void (*adjust_txpower)(struct b43_wldev *dev);
void (*pwork_15sec)(struct b43_wldev *dev);
void (*pwork_60sec)(struct b43_wldev *dev);
};
π¦ Members π¦
listen, every one of these is a slot in the struct. some say "Must not be NULL" and they mean it π
allocateβ Allocate and initialise the PHY data structures. Must not be NULL. π¨freeβ Destroy and free the PHY data structures. Must not be NULL. π¨ (yes, she's the cleanup girlie, be nice to her)prepare_structsβ Prepare the PHY data structures. The data structures allocated inallocateare initialized here. Must not be NULL. π₯prepare_hardwareβ Prepare the PHY. This is called beforeb43_chip_initto do some early PHY hardware init. Can be NULL, if not required. πinitβ Initialize the PHY. Must not be NULL. βexitβ Shutdown the PHY. Can be NULL, if not required. π (the graceful goodbye, optional but slay)phy_readβ Read from a PHY register. Must not be NULL. πphy_writeβ Write to a PHY register. Must not be NULL. πphy_masksetβ Maskset a PHY register, taking shortcuts. If it is NULL, a generic algorithm is used. π§ (lowkey the optional speedrun version)radio_readβ Read from a Radio register. Must not be NULL. π»radio_writeβ Write to a Radio register. Must not be NULL. π»supports_hwpctlβ Returns a boolean whether Hardware Power Control is supported or not. If NULL, hwpctl is assumed to be never supported. π ββοΈ (no callback = no hardware power control, periodt)software_rfkillβ Turn the radio ON or OFF. Possible state values areRFKILL_STATE_SOFT_BLOCKEDorRFKILL_STATE_UNBLOCKED. Must not be NULL. π¨switch_analogβ Turn the Analog on/off. Must not be NULL. πswitch_channelβ Switch the radio to another channel. Must not be NULL. πΆget_default_chanβ Just returns the default channel number. Must not be NULL. π― (a whole callback whose only job is vibes and a number, iconic)set_rx_antennaβ Set the antenna used for RX. Can be NULL, if not supported. π¦interf_mitigationβ Switch the Interference Mitigation mode. Can be NULL, if not supported. πrecalc_txpowerβ Recalculate the transmission power parameters. This callback has to recalculate the TX power settings, but does not need to write them to the hardware, yet. βοΈ Returnsenum b43_txpwr_resultto indicate whether the hardware needs to be adjusted. IfB43_TXPWR_NEED_ADJUSTis returned,adjust_txpowerwill be called later. If the parameter"ignore_tssi"is true, the TSSI values should be ignored and a recalculation of the power settings should be done even if the TSSI values did not change. This function may sleep, but should not. Must not be NULL. π΄π₯ ("may sleep, but should not" is such a mood honestly)adjust_txpowerβ Write the previously calculated TX power settings (fromrecalc_txpower) to the hardware. This function may sleep. Can be NULL, if (and ONLY if)recalc_txpower_always_ returnsB43_TXPWR_RES_DONE. β οΈ like, the capital-letters ONLY if, bestie, don't test herpwork_15secβ Periodic work. Called every 15 seconds. Can be NULL, if not required. β°pwork_60secβ Periodic work. Called every 60 seconds. Can be NULL, if not required. β³
π SEE ALSO π
Kernel file ./drivers/net/wireless/broadcom/b43/phy_common.h, plus the whole friend group:
enum b43_interference_mitigation(9)enum b43_txpwr_result(9)b43_phy_allocate(9)b43_phy_free(9)b43_phy_init(9)b43_phy_exit(9)b43_has_hardware_pctl(9)b43_phy_read(9)b43_phy_write(9)b43_phy_copy(9)b43_phy_mask(9)b43_phy_set(9)b43_phy_maskset(9)b43_radio_read(9)b43_radio_write(9)b43_radio_mask(9)b43_radio_set(9)b43_radio_maskset(9)b43_radio_wait_value(9)b43_radio_lock(9)b43_radio_unlock(9)b43_phy_lock(9)b43_phy_unlock(9)b43_switch_channel(9)b43_software_rfkill(9)b43_phy_txpower_check(9)enum b43_phy_txpower_check_flags(9)b43_phy_shm_tssi_read(9)
π real talk though: those "Must not be NULL" members are not a suggestion. there is no soft launch here. fill them in or the PHY is not loading, iykyk.
and that's the page, bestie β¨ this one came out of ./drivers/net/wireless/broadco... and it's dated October 2026 β so go forth, fill your function pointers in correctly, and remember: Must not be NULL means Must not be NULL ππ
π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms