/**
* pm8001_pci_probe - probe supported device
* @pdev: pci device which kernel has been prepared for.
* @ent: pci device id
*
* This function is the main initialization function, when register a new
* pci driver it is invoked, all struct and hardware initialization should be
* done here, also, register interrupt
*/
static int __devinit pm8001_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int rc;
u32 pci_reg;
struct pm8001_hba_info *pm8001_ha;//HBA在LLD中的表示
struct Scsi_Host *shost = NULL;
const struct pm8001_chip_info *chip;
dev_printk(KERN_INFO, &pdev->dev,
"pm8001: driver version %s, %s\n", DRV_VERSION, DRV_DATE);
rc = pci_enable_device(pdev);//使能pci设备,即开启设备的地址映射和中断等
if (rc) {
dev_printk(KERN_INFO, &pdev->dev,
"pm8001: failed to enable device \n");
goto err_out_enable;
}
pci_set_master(pdev);//set pci device dma master mode
/*
* Enable pci slot busmaster by setting pci command register.
* This is required by FW for Cyclone card.
*/
pci_read_config_dword(pdev, PCI_COMMAND, &pci_reg);
pci_reg |= 0x157;
pci_write_config_dword(pdev, PCI_COMMAND, pci_reg);
rc = pci_request_regions(pdev, DRV_NAME);//request regions(virtual address)
pm8001_pci_probe分析(一)
最新推荐文章于 2024-05-07 19:30:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)