Lines Matching refs:idev

51 	struct ionic_dev *idev = &ionic->idev;  in ionic_init_devinfo()  local
53 idev->dev_info.asic_type = ioread8(&idev->dev_info_regs->asic_type); in ionic_init_devinfo()
54 idev->dev_info.asic_rev = ioread8(&idev->dev_info_regs->asic_rev); in ionic_init_devinfo()
56 memcpy_fromio(idev->dev_info.fw_version, in ionic_init_devinfo()
57 idev->dev_info_regs->fw_version, in ionic_init_devinfo()
60 memcpy_fromio(idev->dev_info.serial_num, in ionic_init_devinfo()
61 idev->dev_info_regs->serial_num, in ionic_init_devinfo()
64 idev->dev_info.fw_version[IONIC_DEVINFO_FWVERS_BUFLEN] = 0; in ionic_init_devinfo()
65 idev->dev_info.serial_num[IONIC_DEVINFO_SERIAL_BUFLEN] = 0; in ionic_init_devinfo()
67 dev_dbg(ionic->dev, "fw_version %s\n", idev->dev_info.fw_version); in ionic_init_devinfo()
74 struct ionic_dev *idev = &ionic->idev; in ionic_dev_setup() local
90 idev->dev_info_regs = bar->vaddr + IONIC_BAR0_DEV_INFO_REGS_OFFSET; in ionic_dev_setup()
91 idev->dev_cmd_regs = bar->vaddr + IONIC_BAR0_DEV_CMD_REGS_OFFSET; in ionic_dev_setup()
92 idev->intr_status = bar->vaddr + IONIC_BAR0_INTR_STATUS_OFFSET; in ionic_dev_setup()
93 idev->intr_ctrl = bar->vaddr + IONIC_BAR0_INTR_CTRL_OFFSET; in ionic_dev_setup()
95 idev->hwstamp_regs = &idev->dev_info_regs->hwstamp; in ionic_dev_setup()
97 sig = ioread32(&idev->dev_info_regs->signature); in ionic_dev_setup()
116 atomic_long_set(&idev->last_check_time, jiffies - 2 * HZ); in ionic_dev_setup()
117 idev->last_hb_time = jiffies - 2 * ionic->watchdog_period; in ionic_dev_setup()
119 idev->last_fw_hb = 0; in ionic_dev_setup()
120 idev->fw_hb_ready = true; in ionic_dev_setup()
121 idev->fw_status_ready = true; in ionic_dev_setup()
122 idev->fw_generation = IONIC_FW_STS_F_GENERATION & in ionic_dev_setup()
123 ioread8(&idev->dev_info_regs->fw_status); in ionic_dev_setup()
128 idev->db_pages = bar->vaddr; in ionic_dev_setup()
129 idev->phy_db_pages = bar->bus_addr; in ionic_dev_setup()
137 struct ionic_dev *idev = &ionic->idev; in ionic_heartbeat_check() local
147 last_check_time = atomic_long_read(&idev->last_check_time); in ionic_heartbeat_check()
151 if (!atomic_long_try_cmpxchg_relaxed(&idev->last_check_time, in ionic_heartbeat_check()
162 fw_status = ioread8(&idev->dev_info_regs->fw_status); in ionic_heartbeat_check()
168 if (idev->fw_generation != fw_generation) { in ionic_heartbeat_check()
170 idev->fw_generation, fw_generation); in ionic_heartbeat_check()
172 idev->fw_generation = fw_generation; in ionic_heartbeat_check()
185 if (fw_status_ready != idev->fw_status_ready) { in ionic_heartbeat_check()
189 idev->fw_status_ready = fw_status_ready; in ionic_heartbeat_check()
217 last_check_time = idev->last_hb_time; in ionic_heartbeat_check()
221 fw_hb = ioread32(&idev->dev_info_regs->fw_heartbeat); in ionic_heartbeat_check()
222 fw_hb_ready = fw_hb != idev->last_fw_hb; in ionic_heartbeat_check()
229 __func__, fw_hb, idev->last_fw_hb, fw_hb_ready); in ionic_heartbeat_check()
231 idev->last_fw_hb = fw_hb; in ionic_heartbeat_check()
234 if (fw_hb_ready != idev->fw_hb_ready) { in ionic_heartbeat_check()
235 idev->fw_hb_ready = fw_hb_ready; in ionic_heartbeat_check()
245 idev->last_hb_time = check_time; in ionic_heartbeat_check()
250 u8 ionic_dev_cmd_status(struct ionic_dev *idev) in ionic_dev_cmd_status() argument
252 return ioread8(&idev->dev_cmd_regs->comp.comp.status); in ionic_dev_cmd_status()
255 bool ionic_dev_cmd_done(struct ionic_dev *idev) in ionic_dev_cmd_done() argument
257 return ioread32(&idev->dev_cmd_regs->done) & IONIC_DEV_CMD_DONE; in ionic_dev_cmd_done()
260 void ionic_dev_cmd_comp(struct ionic_dev *idev, union ionic_dev_cmd_comp *comp) in ionic_dev_cmd_comp() argument
262 memcpy_fromio(comp, &idev->dev_cmd_regs->comp, sizeof(*comp)); in ionic_dev_cmd_comp()
265 void ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd) in ionic_dev_cmd_go() argument
267 memcpy_toio(&idev->dev_cmd_regs->cmd, cmd, sizeof(*cmd)); in ionic_dev_cmd_go()
268 iowrite32(0, &idev->dev_cmd_regs->done); in ionic_dev_cmd_go()
269 iowrite32(1, &idev->dev_cmd_regs->doorbell); in ionic_dev_cmd_go()
273 void ionic_dev_cmd_identify(struct ionic_dev *idev, u8 ver) in ionic_dev_cmd_identify() argument
280 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_identify()
283 void ionic_dev_cmd_init(struct ionic_dev *idev) in ionic_dev_cmd_init() argument
290 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_init()
293 void ionic_dev_cmd_reset(struct ionic_dev *idev) in ionic_dev_cmd_reset() argument
299 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_reset()
303 void ionic_dev_cmd_port_identify(struct ionic_dev *idev) in ionic_dev_cmd_port_identify() argument
310 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_identify()
313 void ionic_dev_cmd_port_init(struct ionic_dev *idev) in ionic_dev_cmd_port_init() argument
318 .port_init.info_pa = cpu_to_le64(idev->port_info_pa), in ionic_dev_cmd_port_init()
321 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_init()
324 void ionic_dev_cmd_port_reset(struct ionic_dev *idev) in ionic_dev_cmd_port_reset() argument
331 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_reset()
334 void ionic_dev_cmd_port_state(struct ionic_dev *idev, u8 state) in ionic_dev_cmd_port_state() argument
343 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_state()
346 void ionic_dev_cmd_port_speed(struct ionic_dev *idev, u32 speed) in ionic_dev_cmd_port_speed() argument
355 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_speed()
358 void ionic_dev_cmd_port_autoneg(struct ionic_dev *idev, u8 an_enable) in ionic_dev_cmd_port_autoneg() argument
367 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_autoneg()
370 void ionic_dev_cmd_port_fec(struct ionic_dev *idev, u8 fec_type) in ionic_dev_cmd_port_fec() argument
379 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_fec()
382 void ionic_dev_cmd_port_pause(struct ionic_dev *idev, u8 pause_type) in ionic_dev_cmd_port_pause() argument
391 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_pause()
445 ionic_dev_cmd_go(&ionic->idev, &cmd); in ionic_set_vf_config()
453 void ionic_dev_cmd_queue_identify(struct ionic_dev *idev, in ionic_dev_cmd_queue_identify() argument
463 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_queue_identify()
466 void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, u8 type, u8 ver) in ionic_dev_cmd_lif_identify() argument
474 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_identify()
477 void ionic_dev_cmd_lif_init(struct ionic_dev *idev, u16 lif_index, in ionic_dev_cmd_lif_init() argument
486 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_init()
489 void ionic_dev_cmd_lif_reset(struct ionic_dev *idev, u16 lif_index) in ionic_dev_cmd_lif_reset() argument
496 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_reset()
499 void ionic_dev_cmd_adminq_init(struct ionic_dev *idev, struct ionic_qcq *qcq, in ionic_dev_cmd_adminq_init() argument
520 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_adminq_init()
595 int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev, in ionic_q_init() argument
610 q->idev = idev; in ionic_q_init()