Example #1
0
/*
 * Configure the hardware for software and LED blinking.
 * The user may choose to configure part of each, depending upon the
 * NIC being used.
 *
 * This requires the configuration to be set before this function
 * is called.
 */
void
ath_led_config(struct ath_softc *sc)
{

	ATH_LOCK(sc);
	ath_power_set_power_state(sc, HAL_PM_AWAKE);
	ATH_UNLOCK(sc);

	/* Software LED blinking - GPIO controlled LED */
	if (sc->sc_softled) {
		ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
		    HAL_GPIO_OUTPUT_MUX_AS_OUTPUT);
		ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon);
	}

	/* Hardware LED blinking - MAC controlled LED */
	if (sc->sc_hardled) {
		/*
		 * Only enable each LED if required.
		 *
		 * Some NICs only have one LED connected; others may
		 * have GPIO1/GPIO2 connected to other hardware.
		 */
		if (sc->sc_led_pwr_pin > 0)
			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_pwr_pin,
			    HAL_GPIO_OUTPUT_MUX_MAC_POWER_LED);
		if (sc->sc_led_net_pin > 0)
			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_net_pin,
			    HAL_GPIO_OUTPUT_MUX_MAC_NETWORK_LED);
	}

	ATH_LOCK(sc);
	ath_power_restore_power_state(sc);
	ATH_UNLOCK(sc);
}
void txabort(struct ath_softc *sc)
{
    printk(KERN_ERR "Abort transmission\n");
    vap = netdev_priv(dev);
    ic = vap->iv_ic;
    ATH_LOCK(sc);
    ic->ic_reset(ic->ic_dev);
    ATH_UNLOCK(sc);


}