/* Shutdown an SRAM device */ void dev_c7200_sram_shutdown(vm_instance_t *vm,struct sram_data *d) { if (d != NULL) { /* Remove the PCI device */ pci_dev_remove(d->pci_dev); /* Remove the byte-swapped device */ vm_object_remove(vm,d->bs_obj); /* Remove the alias and the main device */ dev_remove(vm,d->alias_dev); dev_remove(vm,d->dev); /* Free devices */ free(d->alias_dev); free(d->dev); /* Free device names */ free(d->alias_dev_name); free(d->bs_dev_name); /* Remove filename used to virtualize SRAM */ if (d->filename) { unlink(d->filename); free(d->filename); } /* Free the structure itself */ free(d); } }
/* Remove a PA-POS-OC3 from the specified slot */ int dev_c7200_pa_pos_shutdown(vm_instance_t *vm,struct cisco_card *card) { struct pos_oc3_data *d = card->drv_info; /* Remove the PA EEPROM */ cisco_card_unset_eeprom(card); c7200_set_slot_eeprom(VM_C7200(vm),card->slot_id,NULL); /* Remove the PCI device */ pci_dev_remove(d->pci_dev); /* Remove the PLX9060 chips */ vm_object_remove(vm,d->rx_obj); vm_object_remove(vm,d->tx_obj); vm_object_remove(vm,d->cs_obj); /* Remove the devices from the CPU address space */ vm_unbind_device(vm,&d->rx_dev); vm_unbind_device(vm,&d->tx_dev); vm_unbind_device(vm,&d->cs_dev); vm_unbind_device(vm,&d->dev); cpu_group_rebuild_mts(vm->cpu_group); /* Free the device structure itself */ free(d); return(0); }
/* Shutdown a MV64460 system controller */ void dev_mv64460_shutdown(vm_instance_t *vm,struct mv64460_data *d) { if (d != NULL) { /* Remove the SRAM */ dev_remove(vm,&d->sram_dev); /* Remove the device */ dev_remove(vm,&d->dev); /* Remove the PCI device */ pci_dev_remove(d->pci_dev); /* Free the structure itself */ free(d); } }