Lines Matching refs:asd_ha
25 static int asd_get_user_sas_addr(struct asd_ha_struct *asd_ha) in asd_get_user_sas_addr() argument
28 if (asd_ha->hw_prof.sas_addr[0]) in asd_get_user_sas_addr()
31 return sas_request_addr(asd_ha->sas_ha.shost, in asd_get_user_sas_addr()
32 asd_ha->hw_prof.sas_addr); in asd_get_user_sas_addr()
35 static void asd_propagate_sas_addr(struct asd_ha_struct *asd_ha) in asd_propagate_sas_addr() argument
40 if (asd_ha->hw_prof.phy_desc[i].sas_addr[0] == 0) in asd_propagate_sas_addr()
45 SAS_ADDR(asd_ha->hw_prof.sas_addr)); in asd_propagate_sas_addr()
46 memcpy(asd_ha->hw_prof.phy_desc[i].sas_addr, in asd_propagate_sas_addr()
47 asd_ha->hw_prof.sas_addr, SAS_ADDR_SIZE); in asd_propagate_sas_addr()
71 struct asd_ha_struct *asd_ha = phy->sas_phy.ha->lldd_ha; in asd_init_phy() local
81 phy->id_frm_tok = asd_alloc_coherent(asd_ha, in asd_init_phy()
95 static void asd_init_ports(struct asd_ha_struct *asd_ha) in asd_init_ports() argument
99 spin_lock_init(&asd_ha->asd_ports_lock); in asd_init_ports()
101 struct asd_port *asd_port = &asd_ha->asd_ports[i]; in asd_init_ports()
110 static int asd_init_phys(struct asd_ha_struct *asd_ha) in asd_init_phys() argument
113 u8 phy_mask = asd_ha->hw_prof.enabled_phys; in asd_init_phys()
116 struct asd_phy *phy = &asd_ha->phys[i]; in asd_init_phys()
118 phy->phy_desc = &asd_ha->hw_prof.phy_desc[i]; in asd_init_phys()
125 phy->sas_phy.ha = &asd_ha->sas_ha; in asd_init_phys()
131 int err = asd_init_phy(&asd_ha->phys[i]); in asd_init_phys()
141 static int asd_init_sw(struct asd_ha_struct *asd_ha) in asd_init_sw() argument
143 struct pci_dev *pcidev = asd_ha->pcidev; in asd_init_sw()
169 asd_ha->io_handle[0].swa_base = REG_BASE_ADDR; in asd_init_sw()
170 asd_ha->io_handle[0].swb_base = REG_BASE_ADDR_CSEQCIO; in asd_init_sw()
171 asd_ha->io_handle[0].swc_base = REG_BASE_ADDR_EXSI; in asd_init_sw()
172 MBAR0_SWB_SIZE = asd_ha->io_handle[0].len - 0x80; in asd_init_sw()
173 if (!asd_ha->iospace) { in asd_init_sw()
176 asd_ha->io_handle[1].swa_base = OCM_BASE_ADDR; in asd_init_sw()
178 spin_lock_init(&asd_ha->iolock); in asd_init_sw()
196 static int asd_init_scbs(struct asd_ha_struct *asd_ha) in asd_init_scbs() argument
198 struct asd_seq_data *seq = &asd_ha->seq; in asd_init_scbs()
202 asd_ha->seq.tc_index_bitmap_bits = asd_ha->hw_prof.max_scbs; in asd_init_scbs()
203 asd_ha->seq.tc_index_array = kcalloc(asd_ha->seq.tc_index_bitmap_bits, in asd_init_scbs()
206 if (!asd_ha->seq.tc_index_array) in asd_init_scbs()
209 bitmap_bytes = (asd_ha->seq.tc_index_bitmap_bits+7)/8; in asd_init_scbs()
211 asd_ha->seq.tc_index_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL); in asd_init_scbs()
212 if (!asd_ha->seq.tc_index_bitmap) { in asd_init_scbs()
213 kfree(asd_ha->seq.tc_index_array); in asd_init_scbs()
214 asd_ha->seq.tc_index_array = NULL; in asd_init_scbs()
221 seq->next_scb.vaddr = dma_pool_alloc(asd_ha->scb_pool, GFP_KERNEL, in asd_init_scbs()
224 kfree(asd_ha->seq.tc_index_bitmap); in asd_init_scbs()
225 kfree(asd_ha->seq.tc_index_array); in asd_init_scbs()
226 asd_ha->seq.tc_index_bitmap = NULL; in asd_init_scbs()
227 asd_ha->seq.tc_index_array = NULL; in asd_init_scbs()
238 static void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha) in asd_get_max_scb_ddb() argument
240 asd_ha->hw_prof.max_scbs = asd_get_cmdctx_size(asd_ha)/ASD_SCB_SIZE; in asd_get_max_scb_ddb()
241 asd_ha->hw_prof.max_ddbs = asd_get_devctx_size(asd_ha)/ASD_DDB_SIZE; in asd_get_max_scb_ddb()
243 asd_ha->hw_prof.max_scbs, in asd_get_max_scb_ddb()
244 asd_ha->hw_prof.max_ddbs); in asd_get_max_scb_ddb()
251 static int asd_init_dl(struct asd_ha_struct *asd_ha) in asd_init_dl() argument
253 asd_ha->seq.actual_dl in asd_init_dl()
254 = asd_alloc_coherent(asd_ha, in asd_init_dl()
257 if (!asd_ha->seq.actual_dl) in asd_init_dl()
259 asd_ha->seq.dl = asd_ha->seq.actual_dl->vaddr; in asd_init_dl()
260 asd_ha->seq.dl_toggle = ASD_DEF_DL_TOGGLE; in asd_init_dl()
261 asd_ha->seq.dl_next = 0; in asd_init_dl()
262 tasklet_init(&asd_ha->seq.dl_tasklet, asd_dl_tasklet_handler, in asd_init_dl()
263 (unsigned long) asd_ha); in asd_init_dl()
270 static int asd_alloc_edbs(struct asd_ha_struct *asd_ha, gfp_t gfp_flags) in asd_alloc_edbs() argument
272 struct asd_seq_data *seq = &asd_ha->seq; in asd_alloc_edbs()
281 seq->edb_arr[i] = asd_alloc_coherent(asd_ha, ASD_EDB_SIZE, in asd_alloc_edbs()
294 asd_free_coherent(asd_ha, seq->edb_arr[i]); in asd_alloc_edbs()
301 static int asd_alloc_escbs(struct asd_ha_struct *asd_ha, in asd_alloc_escbs() argument
304 struct asd_seq_data *seq = &asd_ha->seq; in asd_alloc_escbs()
314 escb = asd_ascb_alloc_list(asd_ha, &escbs, gfp_flags); in asd_alloc_escbs()
337 static void asd_assign_edbs2escbs(struct asd_ha_struct *asd_ha) in asd_assign_edbs2escbs() argument
339 struct asd_seq_data *seq = &asd_ha->seq; in asd_assign_edbs2escbs()
368 static int asd_init_escbs(struct asd_ha_struct *asd_ha) in asd_init_escbs() argument
370 struct asd_seq_data *seq = &asd_ha->seq; in asd_init_escbs()
374 int edbs = 2*(1+asd_ha->hw_prof.num_phys); in asd_init_escbs()
379 err = asd_alloc_edbs(asd_ha, GFP_KERNEL); in asd_init_escbs()
385 err = asd_alloc_escbs(asd_ha, GFP_KERNEL); in asd_init_escbs()
391 asd_assign_edbs2escbs(asd_ha); in asd_init_escbs()
398 seq->can_queue = 1 + (asd_ha->hw_prof.max_scbs - seq->pending)/2; in asd_init_escbs()
412 int asd_chip_hardrst(struct asd_ha_struct *asd_ha) in asd_chip_hardrst() argument
419 asd_write_reg_dword(asd_ha, COMBIST, HARDRST); in asd_chip_hardrst()
424 reg = asd_read_reg_dword(asd_ha, CHIMINT); in asd_chip_hardrst()
426 asd_write_reg_dword(asd_ha, CHIMINT, in asd_chip_hardrst()
443 static int asd_init_chip(struct asd_ha_struct *asd_ha) in asd_init_chip() argument
447 err = asd_chip_hardrst(asd_ha); in asd_init_chip()
450 pci_name(asd_ha->pcidev)); in asd_init_chip()
454 asd_disable_ints(asd_ha); in asd_init_chip()
456 err = asd_init_seqs(asd_ha); in asd_init_chip()
459 pci_name(asd_ha->pcidev)); in asd_init_chip()
463 err = asd_start_seqs(asd_ha); in asd_init_chip()
466 pci_name(asd_ha->pcidev)); in asd_init_chip()
487 static void asd_extend_devctx_ocm(struct asd_ha_struct *asd_ha) in asd_extend_devctx_ocm() argument
492 dma_addr -= asd_ha->hw_prof.max_ddbs * ASD_DDB_SIZE; in asd_extend_devctx_ocm()
493 asd_write_reg_addr(asd_ha, DEVCTXBASE, (dma_addr_t) dma_addr); in asd_extend_devctx_ocm()
494 d = asd_read_reg_dword(asd_ha, CTXDOMAIN); in asd_extend_devctx_ocm()
496 asd_write_reg_dword(asd_ha, CTXDOMAIN, d); in asd_extend_devctx_ocm()
497 asd_ha->hw_prof.max_ddbs += MAX_DEVS; in asd_extend_devctx_ocm()
500 static int asd_extend_devctx(struct asd_ha_struct *asd_ha) in asd_extend_devctx() argument
507 asd_extend_devctx_ocm(asd_ha); in asd_extend_devctx()
509 asd_ha->hw_prof.ddb_ext = NULL; in asd_extend_devctx()
510 if (max_devs <= asd_ha->hw_prof.max_ddbs || max_devs > 0xFFFF) { in asd_extend_devctx()
511 max_devs = asd_ha->hw_prof.max_ddbs; in asd_extend_devctx()
515 size = (max_devs - asd_ha->hw_prof.max_ddbs + 1) * ASD_DDB_SIZE; in asd_extend_devctx()
517 asd_ha->hw_prof.ddb_ext = asd_alloc_coherent(asd_ha, size, GFP_KERNEL); in asd_extend_devctx()
518 if (!asd_ha->hw_prof.ddb_ext) { in asd_extend_devctx()
521 max_devs = asd_ha->hw_prof.max_ddbs; in asd_extend_devctx()
524 dma_handle = asd_ha->hw_prof.ddb_ext->dma_handle; in asd_extend_devctx()
526 dma_addr -= asd_ha->hw_prof.max_ddbs * ASD_DDB_SIZE; in asd_extend_devctx()
528 asd_write_reg_addr(asd_ha, DEVCTXBASE, dma_handle); in asd_extend_devctx()
529 d = asd_read_reg_dword(asd_ha, CTXDOMAIN); in asd_extend_devctx()
531 asd_write_reg_dword(asd_ha, CTXDOMAIN, d); in asd_extend_devctx()
533 asd_ha->hw_prof.max_ddbs = max_devs; in asd_extend_devctx()
538 static int asd_extend_cmdctx(struct asd_ha_struct *asd_ha) in asd_extend_cmdctx() argument
545 asd_ha->hw_prof.scb_ext = NULL; in asd_extend_cmdctx()
546 if (max_cmnds <= asd_ha->hw_prof.max_scbs || max_cmnds > 0xFFFF) { in asd_extend_cmdctx()
547 max_cmnds = asd_ha->hw_prof.max_scbs; in asd_extend_cmdctx()
551 size = (max_cmnds - asd_ha->hw_prof.max_scbs + 1) * ASD_SCB_SIZE; in asd_extend_cmdctx()
553 asd_ha->hw_prof.scb_ext = asd_alloc_coherent(asd_ha, size, GFP_KERNEL); in asd_extend_cmdctx()
554 if (!asd_ha->hw_prof.scb_ext) { in asd_extend_cmdctx()
557 max_cmnds = asd_ha->hw_prof.max_scbs; in asd_extend_cmdctx()
560 dma_handle = asd_ha->hw_prof.scb_ext->dma_handle; in asd_extend_cmdctx()
562 dma_addr -= asd_ha->hw_prof.max_scbs * ASD_SCB_SIZE; in asd_extend_cmdctx()
564 asd_write_reg_addr(asd_ha, CMDCTXBASE, dma_handle); in asd_extend_cmdctx()
565 d = asd_read_reg_dword(asd_ha, CTXDOMAIN); in asd_extend_cmdctx()
567 asd_write_reg_dword(asd_ha, CTXDOMAIN, d); in asd_extend_cmdctx()
569 asd_ha->hw_prof.max_scbs = max_cmnds; in asd_extend_cmdctx()
586 static int asd_init_ctxmem(struct asd_ha_struct *asd_ha) in asd_init_ctxmem() argument
590 asd_get_max_scb_ddb(asd_ha); in asd_init_ctxmem()
591 asd_extend_devctx(asd_ha); in asd_init_ctxmem()
592 asd_extend_cmdctx(asd_ha); in asd_init_ctxmem()
595 bitmap_bytes = (asd_ha->hw_prof.max_ddbs+7)/8; in asd_init_ctxmem()
597 asd_ha->hw_prof.ddb_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL); in asd_init_ctxmem()
598 if (!asd_ha->hw_prof.ddb_bitmap) in asd_init_ctxmem()
600 spin_lock_init(&asd_ha->hw_prof.ddb_lock); in asd_init_ctxmem()
605 int asd_init_hw(struct asd_ha_struct *asd_ha) in asd_init_hw() argument
610 err = asd_init_sw(asd_ha); in asd_init_hw()
614 err = pci_read_config_dword(asd_ha->pcidev, PCIC_HSTPCIX_CNTRL, &v); in asd_init_hw()
617 pci_name(asd_ha->pcidev)); in asd_init_hw()
620 err = pci_write_config_dword(asd_ha->pcidev, PCIC_HSTPCIX_CNTRL, in asd_init_hw()
624 pci_name(asd_ha->pcidev)); in asd_init_hw()
628 err = asd_read_ocm(asd_ha); in asd_init_hw()
635 err = asd_read_flash(asd_ha); in asd_init_hw()
643 asd_init_ctxmem(asd_ha); in asd_init_hw()
645 if (asd_get_user_sas_addr(asd_ha)) { in asd_init_hw()
647 pci_name(asd_ha->pcidev)); in asd_init_hw()
652 asd_propagate_sas_addr(asd_ha); in asd_init_hw()
654 err = asd_init_phys(asd_ha); in asd_init_hw()
657 pci_name(asd_ha->pcidev)); in asd_init_hw()
661 asd_init_ports(asd_ha); in asd_init_hw()
663 err = asd_init_scbs(asd_ha); in asd_init_hw()
666 pci_name(asd_ha->pcidev)); in asd_init_hw()
670 err = asd_init_dl(asd_ha); in asd_init_hw()
677 err = asd_init_escbs(asd_ha); in asd_init_hw()
683 err = asd_init_chip(asd_ha); in asd_init_hw()
704 static void asd_chip_reset(struct asd_ha_struct *asd_ha) in asd_chip_reset() argument
706 ASD_DPRINTK("chip reset for %s\n", pci_name(asd_ha->pcidev)); in asd_chip_reset()
707 asd_chip_hardrst(asd_ha); in asd_chip_reset()
714 struct asd_ha_struct *asd_ha = (struct asd_ha_struct *) data; in asd_dl_tasklet_handler() local
715 struct asd_seq_data *seq = &asd_ha->seq; in asd_dl_tasklet_handler()
757 static void asd_process_donelist_isr(struct asd_ha_struct *asd_ha) in asd_process_donelist_isr() argument
759 tasklet_schedule(&asd_ha->seq.dl_tasklet); in asd_process_donelist_isr()
766 static void asd_com_sas_isr(struct asd_ha_struct *asd_ha) in asd_com_sas_isr() argument
768 u32 comstat = asd_read_reg_dword(asd_ha, COMSTAT); in asd_com_sas_isr()
771 asd_write_reg_dword(asd_ha, COMSTAT, 0xFFFFFFFF); in asd_com_sas_isr()
775 pci_name(asd_ha->pcidev)); in asd_com_sas_isr()
778 u32 dmaerr = asd_read_reg_dword(asd_ha, DMAERR); in asd_com_sas_isr()
782 pci_name(asd_ha->pcidev), in asd_com_sas_isr()
784 asd_read_reg_dword(asd_ha, CSDMAADR), in asd_com_sas_isr()
785 asd_read_reg_dword(asd_ha, CSDMAADR+4)); in asd_com_sas_isr()
789 asd_read_reg_dword(asd_ha, CSBUFFER), in asd_com_sas_isr()
790 asd_read_reg_dword(asd_ha, CSBUFFER+4), in asd_com_sas_isr()
791 asd_read_reg_dword(asd_ha, CSBUFFER+8), in asd_com_sas_isr()
792 asd_read_reg_dword(asd_ha, CSBUFFER+12)); in asd_com_sas_isr()
794 asd_dump_seq_state(asd_ha, 0); in asd_com_sas_isr()
796 u32 dmaerr = asd_read_reg_dword(asd_ha, DMAERR); in asd_com_sas_isr()
799 pci_name(asd_ha->pcidev), in asd_com_sas_isr()
802 asd_chip_reset(asd_ha); in asd_com_sas_isr()
805 static void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus) in asd_arp2_err() argument
847 u32 arp2int = asd_read_reg_dword(asd_ha, CARP2INT); in asd_arp2_err()
851 pci_name(asd_ha->pcidev), in asd_arp2_err()
855 pci_name(asd_ha->pcidev), in asd_arp2_err()
859 pci_name(asd_ha->pcidev), in asd_arp2_err()
867 u32 arp2int = asd_read_reg_dword(asd_ha, in asd_arp2_err()
872 pci_name(asd_ha->pcidev), in asd_arp2_err()
877 pci_name(asd_ha->pcidev), in asd_arp2_err()
881 pci_name(asd_ha->pcidev), lseq, in asd_arp2_err()
885 asd_chip_reset(asd_ha); in asd_arp2_err()
892 static void asd_dch_sas_isr(struct asd_ha_struct *asd_ha) in asd_dch_sas_isr() argument
894 u32 dchstatus = asd_read_reg_dword(asd_ha, DCHSTATUS); in asd_dch_sas_isr()
897 asd_printk("%s: CFIFTOERR\n", pci_name(asd_ha->pcidev)); in asd_dch_sas_isr()
898 asd_chip_reset(asd_ha); in asd_dch_sas_isr()
900 asd_arp2_err(asd_ha, dchstatus); in asd_dch_sas_isr()
907 static void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha) in asd_rbi_exsi_isr() argument
909 u32 stat0r = asd_read_reg_dword(asd_ha, ASISTAT0R); in asd_rbi_exsi_isr()
918 pci_name(asd_ha->pcidev)); in asd_rbi_exsi_isr()
920 u32 stat1r = asd_read_reg_dword(asd_ha, ASISTAT1R); in asd_rbi_exsi_isr()
923 pci_name(asd_ha->pcidev)); in asd_rbi_exsi_isr()
925 u32 statr = asd_read_reg_dword(asd_ha, ASIERRSTATR); in asd_rbi_exsi_isr()
931 u32 addr = asd_read_reg_dword(asd_ha, ASIERRADDR); in asd_rbi_exsi_isr()
932 u32 data = asd_read_reg_dword(asd_ha, ASIERRDATAR); in asd_rbi_exsi_isr()
937 pci_name(asd_ha->pcidev), in asd_rbi_exsi_isr()
946 asd_chip_reset(asd_ha); in asd_rbi_exsi_isr()
955 static void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha) in asd_hst_pcix_isr() argument
961 pci_read_config_word(asd_ha->pcidev, PCI_STATUS, &status); in asd_hst_pcix_isr()
962 pci_read_config_dword(asd_ha->pcidev, PCIX_STATUS, &pcix_status); in asd_hst_pcix_isr()
963 pci_read_config_dword(asd_ha->pcidev, ECC_CTRL_STAT, &ecc_status); in asd_hst_pcix_isr()
966 asd_printk("parity error for %s\n", pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
968 asd_printk("master abort for %s\n", pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
970 asd_printk("target abort for %s\n", pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
972 asd_printk("data parity for %s\n", pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
975 pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
976 pci_write_config_dword(asd_ha->pcidev,PCIX_STATUS,pcix_status); in asd_hst_pcix_isr()
981 pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
982 pci_write_config_dword(asd_ha->pcidev,PCIX_STATUS,pcix_status); in asd_hst_pcix_isr()
987 pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
990 pci_name(asd_ha->pcidev)); in asd_hst_pcix_isr()
991 asd_chip_reset(asd_ha); in asd_hst_pcix_isr()
1003 struct asd_ha_struct *asd_ha = dev_id; in asd_hw_isr() local
1004 u32 chimint = asd_read_reg_dword(asd_ha, CHIMINT); in asd_hw_isr()
1009 asd_write_reg_dword(asd_ha, CHIMINT, chimint); in asd_hw_isr()
1010 (void) asd_read_reg_dword(asd_ha, CHIMINT); in asd_hw_isr()
1013 asd_process_donelist_isr(asd_ha); in asd_hw_isr()
1015 asd_com_sas_isr(asd_ha); in asd_hw_isr()
1017 asd_dch_sas_isr(asd_ha); in asd_hw_isr()
1019 asd_rbi_exsi_isr(asd_ha); in asd_hw_isr()
1021 asd_hst_pcix_isr(asd_ha); in asd_hw_isr()
1028 static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha, in asd_ascb_alloc() argument
1032 struct asd_seq_data *seq = &asd_ha->seq; in asd_ascb_alloc()
1040 ascb->dma_scb.vaddr = dma_pool_zalloc(asd_ha->scb_pool, in asd_ascb_alloc()
1047 asd_init_ascb(asd_ha, ascb); in asd_ascb_alloc()
1060 dma_pool_free(asd_ha->scb_pool, ascb->dma_scb.vaddr, in asd_ascb_alloc()
1084 *asd_ha, int *num, in asd_ascb_alloc_list()
1090 struct asd_ascb *ascb = asd_ascb_alloc(asd_ha, gfp_flags); in asd_ascb_alloc_list()
1127 static void asd_swap_head_scb(struct asd_ha_struct *asd_ha, in asd_swap_head_scb() argument
1130 struct asd_seq_data *seq = &asd_ha->seq; in asd_swap_head_scb()
1184 int asd_post_ascb_list(struct asd_ha_struct *asd_ha, struct asd_ascb *ascb, in asd_post_ascb_list() argument
1191 spin_lock_irqsave(&asd_ha->seq.pend_q_lock, flags); in asd_post_ascb_list()
1192 can_queue = asd_ha->hw_prof.max_scbs - asd_ha->seq.pending; in asd_post_ascb_list()
1194 asd_ha->seq.pending += num; in asd_post_ascb_list()
1199 spin_unlock_irqrestore(&asd_ha->seq.pend_q_lock, flags); in asd_post_ascb_list()
1200 asd_printk("%s: scb queue full\n", pci_name(asd_ha->pcidev)); in asd_post_ascb_list()
1204 asd_swap_head_scb(asd_ha, ascb); in asd_post_ascb_list()
1210 asd_ha->seq.scbpro += num; in asd_post_ascb_list()
1211 list_splice_init(&list, asd_ha->seq.pend_q.prev); in asd_post_ascb_list()
1212 asd_write_reg_dword(asd_ha, SCBPRO, (u32)asd_ha->seq.scbpro); in asd_post_ascb_list()
1213 spin_unlock_irqrestore(&asd_ha->seq.pend_q_lock, flags); in asd_post_ascb_list()
1236 int asd_post_escb_list(struct asd_ha_struct *asd_ha, struct asd_ascb *ascb, in asd_post_escb_list() argument
1241 spin_lock_irqsave(&asd_ha->seq.pend_q_lock, flags); in asd_post_escb_list()
1242 asd_swap_head_scb(asd_ha, ascb); in asd_post_escb_list()
1243 asd_ha->seq.scbpro += num; in asd_post_escb_list()
1244 asd_write_reg_dword(asd_ha, SCBPRO, (u32)asd_ha->seq.scbpro); in asd_post_escb_list()
1245 spin_unlock_irqrestore(&asd_ha->seq.pend_q_lock, flags); in asd_post_escb_list()
1258 void asd_turn_led(struct asd_ha_struct *asd_ha, int phy_id, int op) in asd_turn_led() argument
1261 u32 v = asd_read_reg_dword(asd_ha, LmCONTROL(phy_id)); in asd_turn_led()
1266 asd_write_reg_dword(asd_ha, LmCONTROL(phy_id), v); in asd_turn_led()
1279 void asd_control_led(struct asd_ha_struct *asd_ha, int phy_id, int op) in asd_control_led() argument
1284 v = asd_read_reg_dword(asd_ha, GPIOOER); in asd_control_led()
1289 asd_write_reg_dword(asd_ha, GPIOOER, v); in asd_control_led()
1291 v = asd_read_reg_dword(asd_ha, GPIOCNFGR); in asd_control_led()
1296 asd_write_reg_dword(asd_ha, GPIOCNFGR, v); in asd_control_led()
1302 static int asd_enable_phy(struct asd_ha_struct *asd_ha, int phy_id) in asd_enable_phy() argument
1304 struct asd_phy *phy = &asd_ha->phys[phy_id]; in asd_enable_phy()
1306 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, INT_ENABLE_2), 0); in asd_enable_phy()
1307 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, HOT_PLUG_DELAY), in asd_enable_phy()
1312 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, PHY_CONTROL_0), in asd_enable_phy()
1314 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, PHY_CONTROL_1), in asd_enable_phy()
1316 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, PHY_CONTROL_2), in asd_enable_phy()
1318 asd_write_reg_byte(asd_ha, LmSEQ_OOB_REG(phy_id, PHY_CONTROL_3), in asd_enable_phy()
1321 asd_write_reg_dword(asd_ha, LmSEQ_TEN_MS_COMINIT_TIMEOUT(phy_id), in asd_enable_phy()
1324 asd_write_reg_addr(asd_ha, LmSEQ_TX_ID_ADDR_FRAME(phy_id), in asd_enable_phy()
1327 asd_control_led(asd_ha, phy_id, 1); in asd_enable_phy()
1332 int asd_enable_phys(struct asd_ha_struct *asd_ha, const u8 phy_mask) in asd_enable_phys() argument
1347 asd_enable_phy(asd_ha, i); in asd_enable_phys()
1351 ascb_list = asd_ascb_alloc_list(asd_ha, &k, GFP_KERNEL); in asd_enable_phys()
1364 k = asd_post_ascb_list(asd_ha, ascb_list, num); in asd_enable_phys()