FreeBSD/sys/dev/pci/pci_pci.c
/*
 * Send a HotPlug command to the slot control register.  If this slot
 * uses command completion interrupts and a previous command is still
 * in progress, then the command is dropped.  Once the previous
 * command completes or times out, pcib_pcie_hotplug_update() will be
 * invoked to post a new command based on the slot's state at that
 * time.
 */
Send a HotPlug command to the slot control register.  If this slot
uses command completion interrupts and a previous command is still
in progress, then the command is dropped.  Once the previous
command completes or times out, pcib_pcie_hotplug_update() will be
invoked to post a new command based on the slot's state at that
time.
Send a HotPlug command to the slot control register . If this slot uses command completion interrupts and a previous command is still in progress then the command is dropped . Once the previous command completes or times out pcib_pcie_hotplug_update () will be invoked to post a new command based on the slot ' s state at that time .
static void
pcib_pcie_hotplug_command(struct pcib_softc *sc, uint16_t val, uint16_t mask)
{
	device_t dev;
	uint16_t ctl, new;
	dev = sc->dev;
	if (sc->flags & PCIB_HOTPLUG_CMD_PENDING)
		return;
	ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
	new = (ctl & ~mask) | val;
	if (new == ctl)
		return;
	if (bootverbose)
		device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new);
	pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
	if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) &&
	    (ctl & new) & PCIEM_SLOT_CTL_CCIE) {
		sc->flags |= PCIB_HOTPLUG_CMD_PENDING;
		if (!cold)
			callout_reset(&sc->pcie_cc_timer, hz,
			    pcib_pcie_cc_timeout, sc);
	}
}
static void pcib_pcie_hotplug_command ( struct pcib_softc * sc , uint16_t val , uint16_t mask ) { device_t dev ; uint16_t ctl , new ; dev = sc -> dev ; if ( sc -> flags & PCIB_HOTPLUG_CMD_PENDING ) return ; ctl = pcie_read_config ( dev , PCIER_SLOT_CTL , 2 ) ; new = ( ctl & ~ mask ) | val ; if ( new == ctl ) return ; if ( bootverbose ) device_printf ( dev , " \n " , ctl , new ) ; pcie_write_config ( dev , PCIER_SLOT_CTL , new , 2 ) ; if ( ! ( sc -> pcie_slot_cap & PCIEM_SLOT_CAP_NCCS ) && ( ctl & new ) & PCIEM_SLOT_CTL_CCIE ) { sc -> flags |= PCIB_HOTPLUG_CMD_PENDING ; if ( ! cold ) callout_reset ( & sc -> pcie_cc_timer , hz , pcib_pcie_cc_timeout , sc ) ; } }
Send a HotPlug command to the slot control register.
Send a HotPlug command to the slot control register .