Пример #1
0
static void
ahd_linux_pci_dev_remove(struct pci_dev *pdev)
{
	struct ahd_softc *ahd = pci_get_drvdata(pdev);
	u_long s;

	if (ahd->platform_data && ahd->platform_data->host)
			scsi_remove_host(ahd->platform_data->host);

	ahd_lock(ahd, &s);
	ahd_intr_enable(ahd, FALSE);
	ahd_unlock(ahd, &s);
	ahd_free(ahd);
}
Пример #2
0
/*
 * Attach all the sub-devices we can find
 */
int
ahd_attach(struct ahd_softc *ahd)
{
    struct scsibus_attach_args saa;
    char   ahd_info[256];
    int	s;

    ahd_controller_info(ahd, ahd_info, sizeof ahd_info);
    printf("%s\n", ahd_info);
    ahd_lock(ahd, &s);

    /*
     * fill in the prototype scsi_links.
     */
    ahd->sc_channel.adapter_target = ahd->our_id;
    if (ahd->features & AHD_WIDE)
        ahd->sc_channel.adapter_buswidth = 16;
    ahd->sc_channel.adapter_softc = ahd;
    ahd->sc_channel.adapter = &ahd_switch;
    ahd->sc_channel.openings = 16;

    if (bootverbose) {
        ahd_controller_info(ahd, ahd_info, sizeof ahd_info);
        printf("%s: %s\n", ahd->sc_dev.dv_xname, ahd_info);
    }

    ahd_intr_enable(ahd, TRUE);

    if (ahd->flags & AHD_RESET_BUS_A)
        ahd_reset_channel(ahd, 'A', TRUE);

    bzero(&saa, sizeof(saa));
    saa.saa_sc_link = &ahd->sc_channel;

    ahd->sc_child = config_found((void *)&ahd->sc_dev, &saa, scsiprint);

    ahd_unlock(ahd, &s);

    return (1);

}