STRUCT DEV_PRIV(9)
π struct dev_priv(9) β the Kernel API Manual glow-up
okay so bestie, we're in the Kernel API Manual today and the star of the show is struct dev_priv(9). this is the network device private data structure β the little locker where a network device keeps all its own secrets. π
β¨ NAME β¨
struct dev_priv β Network device private data structure. yes. that's the whole vibe. it holds the private data. slay. π
πΈ SYNOPSIS πΈ
struct dev_priv {
struct dev_info *adapter;
struct ksz_port port;
struct ksz_timer_info monitor_timer_info;
struct semaphore proc_sem;
int id;
struct mii_if_info mii_if;
u32 advertising;
u32 msg_enable;
int media_state;
int multicast;
int promiscuous;
};
lowkey iconic struct layout, no notes. π«Ά
π¦ Members π¦
here's the tour, one field at a time, iykyk:
adapterβ Adapter device information. the parent-energy field fr fr.portβ Port information. all the port lore lives right here.monitor_timer_infoβ Timer to monitor ports. it's giving "i watch you while you sleep" but make it kernel-friendly. β°proc_semβ Semaphore for proc accessing. the bouncer at theprocclub. you shall not pass (without the semaphore). πidβ Device ID. everyone needs an ID bestie.mii_ifβ MII interface information. yes MII, not me. πΈadvertisingβ Temporary variable to store advertised settings. temporary! like my attention span for anything that isn't Unix.msg_enableβ The message flags controlling driver output. this is the volume knob for the driver's yapping. π₯media_stateβ The connection status of the device. are we connected or are we not, that is the question.multicastβ The all multicast state of the device.promiscuousβ The promiscuous state of the device. π that's the field name. that's just what it's called. i don't make the rules.
π SEE ALSO π
the whole friend group shows up here, and honestly? respect the networking. the source of all this magic lives in the kernel file ./drivers/net/ethernet/micrel/ksz884x.c.
the structs:
struct ksz_hw_desc(9)struct ksz_sw_desc(9)struct ksz_dma_buf(9)struct ksz_desc(9)struct ksz_desc_info(9)struct ksz_mac_table(9)struct ksz_vlan_table(9)struct ksz_port_mib(9)struct ksz_port_cfg(9)struct ksz_switch(9)struct ksz_port_info(9)struct ksz_hw(9)struct ksz_port(9)struct ksz_timer_info(9)struct ksz_shared_mem(9)struct ksz_counter_info(9)struct dev_info(9)
the hw / sw helpers:
hw_turn_on_intr(9)hw_block_intr(9)sw_r_table(9)sw_w_table_64(9)sw_w_sta_mac_table(9)sw_r_vlan_table(9)port_r_mib_cnt(9)port_r_mib_pkt(9)port_r_cnt(9)port_init_cnt(9)port_cfg(9)port_r8(9)port_r16(9)port_w16(9)sw_chk(9)sw_cfg(9)sw_cfg_broad_storm(9)sw_get_broad_storm(9)sw_dis_broad_storm(9)sw_ena_broad_storm(9)sw_init_broad_storm(9)hw_cfg_broad_storm(9)sw_dis_prio_rate(9)sw_init_prio_rate(9)sw_dis_diffserv(9)sw_dis_802_1p(9)sw_cfg_replace_null_vid(9)sw_cfg_replace_vid(9)sw_cfg_port_based(9)sw_dis_multi_queue(9)sw_init_prio(9)port_get_def_vid(9)sw_init_vlan(9)sw_cfg_port_base_vlan(9)sw_set_addr(9)sw_set_global_ctrl(9)port_set_stp_state(9)sw_clr_sta_mac_table(9)sw_init_stp(9)sw_block_addr(9)
the phy / eeprom / link squad:
hw_r_phy(9)hw_w_phy(9)eeprom_read(9)eeprom_write(9)port_get_link_speed(9)port_set_link_speed(9)port_force_link_speed(9)
the wake-on-lan crew:
hw_chk_wol_pme_status(9)hw_clr_wol_pme_status(9)hw_cfg_wol_pme(9)hw_cfg_wol(9)hw_set_wol_frame(9)hw_add_wol_arp(9)hw_add_wol_bcast(9)hw_add_wol_mcast(9)hw_add_wol_ucast(9)hw_enable_wol(9)
the hw lifecycle besties:
hw_init(9)hw_reset(9)hw_setup(9)hw_setup_intr(9)hw_set_desc_base(9)hw_start_rx(9)hw_stop_rx(9)hw_start_tx(9)hw_stop_tx(9)hw_disable(9)hw_enable(9)hw_alloc_pkt(9)hw_send_pkt(9)hw_set_addr(9)hw_read_addr(9)hw_clr_multicast(9)hw_set_grp_addr(9)hw_set_multicast(9)hw_set_promiscuous(9)sw_enable(9)sw_setup(9)
the timer + descriptor + memory girlies:
ksz_start_timer(9)ksz_stop_timer(9)ksz_alloc_soft_desc(9)ksz_alloc_desc(9)free_dma_buf(9)ksz_init_rx_buffers(9)ksz_alloc_mem(9)ksz_free_desc(9)ksz_free_buffers(9)ksz_free_mem(9)
the tx / rx pipeline:
send_packet(9)transmit_cleanup(9)tx_done(9)netdev_tx(9)netdev_tx_timeout(9)netdev_intr(9)netdev_close(9)netdev_open(9)netdev_query_statistics(9)netdev_set_mac_address(9)netdev_set_rx_mode(9)netdev_ioctl(9)mdio_read(9)mdio_write(9)
the ethtool-adjacent icons:
netdev_get_link_ksettings(9)netdev_set_link_ksettings(9)netdev_nway_reset(9)netdev_get_link(9)netdev_get_drvinfo(9)netdev_get_regs_len(9)netdev_get_regs(9)netdev_get_wol(9)netdev_set_wol(9)netdev_get_msglevel(9)netdev_set_msglevel(9)netdev_get_eeprom_len(9)netdev_get_eeprom(9)netdev_set_eeprom(9)netdev_get_pauseparam(9)netdev_set_pauseparam(9)netdev_get_ringparam(9)netdev_get_strings(9)netdev_get_sset_count(9)netdev_get_ethtool_stats(9)netdev_set_features(9)dev_monitor(9)netdev_init(9)
like i said. the whole group chat got added. not one person left on read. πβ¨
ngl bestie, if you got this far you basically main-character'd your way through every reference in ksz884x.c. π
and that's the page! brought to you by ./drivers/net/ethernet/micrel, dated October 2026, straight out of the Kernel API Manual β bye bestie, go read some descriptors ππ§ββοΈ
π¦ 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