Lines Matching refs:asd_ha

21 static int asd_get_ddb(struct asd_ha_struct *asd_ha)  in asd_get_ddb()  argument
25 ddb = FIND_FREE_DDB(asd_ha); in asd_get_ddb()
26 if (ddb >= asd_ha->hw_prof.max_ddbs) { in asd_get_ddb()
30 SET_DDB(ddb, asd_ha); in asd_get_ddb()
33 asd_ddbsite_write_dword(asd_ha, ddb, i, 0); in asd_get_ddb()
57 static void asd_free_ddb(struct asd_ha_struct *asd_ha, int ddb) in asd_free_ddb() argument
61 asd_ddbsite_write_byte(asd_ha, ddb, DDB_TYPE, DDB_TYPE_UNUSED); in asd_free_ddb()
62 CLEAR_DDB(ddb, asd_ha); in asd_free_ddb()
67 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_set_ddb_type() local
71 asd_ddbsite_write_byte(asd_ha,ddb, DDB_TYPE, DDB_TYPE_PM_PORT); in asd_set_ddb_type()
73 asd_ddbsite_write_byte(asd_ha,ddb, DDB_TYPE, DDB_TYPE_TARGET); in asd_set_ddb_type()
75 asd_ddbsite_write_byte(asd_ha,ddb,DDB_TYPE,DDB_TYPE_INITIATOR); in asd_set_ddb_type()
80 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_init_sata_tag_ddb() local
83 ddb = asd_get_ddb(asd_ha); in asd_init_sata_tag_ddb()
88 asd_ddbsite_write_word(asd_ha, ddb, i, 0xFFFF); in asd_init_sata_tag_ddb()
90 asd_ddbsite_write_word(asd_ha, (int) (unsigned long) dev->lldd_dev, in asd_init_sata_tag_ddb()
97 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_set_dmamode() local
105 asd_ddbsite_write_dword(asd_ha, ddb, SATA_TAG_ALLOC_MASK, in asd_set_dmamode()
107 asd_ddbsite_write_byte(asd_ha, ddb, NUM_SATA_TAGS, qdepth); in asd_set_dmamode()
122 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_init_sata() local
125 asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF); in asd_init_sata()
130 asd_ddbsite_write_byte(asd_ha, ddb, SATA_STATUS, fis->status); in asd_init_sata()
132 asd_ddbsite_write_word(asd_ha, ddb, NCQ_DATA_SCB_PTR, 0xFFFF); in asd_init_sata()
140 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_init_target_ddb() local
143 ddb = asd_get_ddb(asd_ha); in asd_init_target_ddb()
149 asd_ddbsite_write_byte(asd_ha, ddb, 0, DDB_TP_CONN_TYPE); in asd_init_target_ddb()
150 asd_ddbsite_write_byte(asd_ha, ddb, 1, 0); in asd_init_target_ddb()
151 asd_ddbsite_write_word(asd_ha, ddb, INIT_CONN_TAG, 0xFFFF); in asd_init_target_ddb()
153 asd_ddbsite_write_byte(asd_ha, ddb, DEST_SAS_ADDR+i, in asd_init_target_ddb()
155 asd_ddbsite_write_word(asd_ha, ddb, SEND_QUEUE_HEAD, 0xFFFF); in asd_init_target_ddb()
157 asd_ddbsite_write_byte(asd_ha, ddb, CONN_MASK, dev->port->phy_mask); in asd_init_target_ddb()
174 asd_ddbsite_write_byte(asd_ha, ddb, MAX_CCONN, in asd_init_target_ddb()
177 asd_ddbsite_write_byte(asd_ha, ddb, MAX_CCONN, in asd_init_target_ddb()
179 asd_ddbsite_write_byte(asd_ha, ddb, NUM_CTX, 1); in asd_init_target_ddb()
184 asd_ddbsite_write_byte(asd_ha, ddb, DDB_TARG_FLAGS, flags); in asd_init_target_ddb()
189 asd_ddbsite_write_byte(asd_ha, ddb, DDB_TARG_FLAGS2, flags); in asd_init_target_ddb()
191 asd_ddbsite_write_word(asd_ha, ddb, EXEC_QUEUE_TAIL, 0xFFFF); in asd_init_target_ddb()
192 asd_ddbsite_write_word(asd_ha, ddb, SEND_QUEUE_TAIL, 0xFFFF); in asd_init_target_ddb()
193 asd_ddbsite_write_word(asd_ha, ddb, SISTER_DDB, 0xFFFF); in asd_init_target_ddb()
198 asd_free_ddb(asd_ha, ddb); in asd_init_target_ddb()
206 asd_ddbsite_write_word(asd_ha, ddb, ITNL_TIMEOUT, in asd_init_target_ddb()
210 asd_ddbsite_write_word(asd_ha, ddb, ITNL_TIMEOUT, in asd_init_target_ddb()
218 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_init_sata_pm_table_ddb() local
221 ddb = asd_get_ddb(asd_ha); in asd_init_sata_pm_table_ddb()
226 asd_ddbsite_write_word(asd_ha, ddb, i, 0xFFFF); in asd_init_sata_pm_table_ddb()
228 asd_ddbsite_write_word(asd_ha, (int) (unsigned long) dev->lldd_dev, in asd_init_sata_pm_table_ddb()
248 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_init_sata_pm_port_ddb() local
251 ddb = asd_get_ddb(asd_ha); in asd_init_sata_pm_port_ddb()
257 asd_ddbsite_write_byte(asd_ha, ddb, PM_PORT_FLAGS, flags); in asd_init_sata_pm_port_ddb()
258 asd_ddbsite_write_word(asd_ha, ddb, SISTER_DDB, 0xFFFF); in asd_init_sata_pm_port_ddb()
259 asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF); in asd_init_sata_pm_port_ddb()
263 asd_ddbsite_write_word(asd_ha, ddb, PARENT_DDB, parent_ddb); in asd_init_sata_pm_port_ddb()
264 pmtable_ddb = asd_ddbsite_read_word(asd_ha, parent_ddb, SISTER_DDB); in asd_init_sata_pm_port_ddb()
265 asd_ddbsite_write_word(asd_ha, pmtable_ddb, dev->sata_dev.port_no,ddb); in asd_init_sata_pm_port_ddb()
267 if (asd_ddbsite_read_byte(asd_ha, ddb, NUM_SATA_TAGS) > 0) { in asd_init_sata_pm_port_ddb()
270 asd_free_ddb(asd_ha, ddb); in asd_init_sata_pm_port_ddb()
308 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_dev_found() local
310 spin_lock_irqsave(&asd_ha->hw_prof.ddb_lock, flags); in asd_dev_found()
324 spin_unlock_irqrestore(&asd_ha->hw_prof.ddb_lock, flags); in asd_dev_found()
333 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; in asd_dev_gone() local
335 spin_lock_irqsave(&asd_ha->hw_prof.ddb_lock, flags); in asd_dev_gone()
337 sister_ddb = asd_ddbsite_read_word(asd_ha, ddb, SISTER_DDB); in asd_dev_gone()
340 asd_free_ddb(asd_ha, sister_ddb); in asd_dev_gone()
341 asd_free_ddb(asd_ha, ddb); in asd_dev_gone()
343 spin_unlock_irqrestore(&asd_ha->hw_prof.ddb_lock, flags); in asd_dev_gone()