FreeBSD/sys/dev/cxgb/cxgb_main.c
/**
 *	t3_os_phymod_changed - handle PHY module changes
 *	@phy: the PHY reporting the module change
 *	@mod_type: new module type
 *
 *	This is the OS-dependent handler for PHY module changes.  It is
 *	invoked when a PHY module is removed or inserted for any OS-specific
 *	processing.
 */
handle PHY module changes
@phy: the PHY reporting the module change
@mod_type: new module type

This is the OS-dependent handler for PHY module changes.  It is
invoked when a PHY module is removed or inserted for any OS-specific
processing.
handle PHY module changes @phy : the PHY reporting the module change @mod_type : new module type This is the OS - dependent handler for PHY module changes . It is invoked when a PHY module is removed or inserted for any OS - specific processing .
void t3_os_phymod_changed(struct adapter *adap, int port_id)
{
	static const char *mod_str[] = {
		NULL, "SR", "LR", "LRM", "TWINAX", "TWINAX-L", "unknown"
	};
	struct port_info *pi = &adap->port[port_id];
	int mod = pi->phy.modtype;
	if (mod != pi->media.ifm_cur->ifm_data)
		cxgb_build_medialist(pi);
	if (mod == phy_modtype_none)
		if_printf(pi->ifp, "PHY module unplugged\n");
	else {
		KASSERT(mod < ARRAY_SIZE(mod_str),
			("invalid PHY module type %d", mod));
		if_printf(pi->ifp, "%s PHY module inserted\n", mod_str[mod]);
	}
}
void t3_os_phymod_changed ( struct adapter * adap , int port_id ) { static const char * mod_str [ ] = { NULL , " " , " " , " " , " " , " " , " " } ; struct port_info * pi = & adap -> port [ port_id ] ; int mod = pi -> phy . modtype ; if ( mod != pi -> media . ifm_cur -> ifm_data ) cxgb_build_medialist ( pi ) ; if ( mod == phy_modtype_none ) if_printf ( pi -> ifp , " \n " ) ; else { KASSERT ( mod < ARRAY_SIZE ( mod_str ) , ( " " , mod ) ) ; if_printf ( pi -> ifp , " \n " , mod_str [ mod ] ) ; } }
t3_os_phymod_changed - handle PHY module changes
      @phy: the PHY reporting the module change
      @mod_type: new module type
t3_os_phymod_changed - handle PHY module changes @phy : the PHY reporting the module change @mod_type : new module type