Lines Matching refs:idev

52 	struct ionic_dev *idev = &ionic->idev;  in ionic_watchdog_init()  local
58 atomic_long_set(&idev->last_check_time, jiffies - 2 * HZ); in ionic_watchdog_init()
59 idev->last_hb_time = jiffies - 2 * ionic->watchdog_period; in ionic_watchdog_init()
61 idev->last_fw_hb = 0; in ionic_watchdog_init()
62 idev->fw_hb_ready = true; in ionic_watchdog_init()
63 idev->fw_status_ready = true; in ionic_watchdog_init()
64 idev->fw_generation = IONIC_FW_STS_F_GENERATION & in ionic_watchdog_init()
65 ioread8(&idev->dev_info_regs->fw_status); in ionic_watchdog_init()
70 struct ionic_dev *idev = &ionic->idev; in ionic_init_devinfo() local
72 idev->dev_info.asic_type = ioread8(&idev->dev_info_regs->asic_type); in ionic_init_devinfo()
73 idev->dev_info.asic_rev = ioread8(&idev->dev_info_regs->asic_rev); in ionic_init_devinfo()
75 memcpy_fromio(idev->dev_info.fw_version, in ionic_init_devinfo()
76 idev->dev_info_regs->fw_version, in ionic_init_devinfo()
79 memcpy_fromio(idev->dev_info.serial_num, in ionic_init_devinfo()
80 idev->dev_info_regs->serial_num, in ionic_init_devinfo()
83 idev->dev_info.fw_version[IONIC_DEVINFO_FWVERS_BUFLEN] = 0; in ionic_init_devinfo()
84 idev->dev_info.serial_num[IONIC_DEVINFO_SERIAL_BUFLEN] = 0; in ionic_init_devinfo()
86 dev_dbg(ionic->dev, "fw_version %s\n", idev->dev_info.fw_version); in ionic_init_devinfo()
93 struct ionic_dev *idev = &ionic->idev; in ionic_dev_setup() local
109 idev->dev_info_regs = bar->vaddr + IONIC_BAR0_DEV_INFO_REGS_OFFSET; in ionic_dev_setup()
110 idev->dev_cmd_regs = bar->vaddr + IONIC_BAR0_DEV_CMD_REGS_OFFSET; in ionic_dev_setup()
111 idev->intr_status = bar->vaddr + IONIC_BAR0_INTR_STATUS_OFFSET; in ionic_dev_setup()
112 idev->intr_ctrl = bar->vaddr + IONIC_BAR0_INTR_CTRL_OFFSET; in ionic_dev_setup()
114 idev->hwstamp_regs = &idev->dev_info_regs->hwstamp; in ionic_dev_setup()
116 sig = ioread32(&idev->dev_info_regs->signature); in ionic_dev_setup()
133 idev->db_pages = bar->vaddr; in ionic_dev_setup()
134 idev->phy_db_pages = bar->bus_addr; in ionic_dev_setup()
140 bool ionic_is_fw_running(struct ionic_dev *idev) in ionic_is_fw_running() argument
142 u8 fw_status = ioread8(&idev->dev_info_regs->fw_status); in ionic_is_fw_running()
153 struct ionic_dev *idev = &ionic->idev; in ionic_heartbeat_check() local
163 last_check_time = atomic_long_read(&idev->last_check_time); in ionic_heartbeat_check()
167 if (!atomic_long_try_cmpxchg_relaxed(&idev->last_check_time, in ionic_heartbeat_check()
174 fw_status = ioread8(&idev->dev_info_regs->fw_status); in ionic_heartbeat_check()
177 if (!ionic_is_fw_running(idev)) { in ionic_heartbeat_check()
181 if (idev->fw_generation != fw_generation) { in ionic_heartbeat_check()
183 idev->fw_generation, fw_generation); in ionic_heartbeat_check()
185 idev->fw_generation = fw_generation; in ionic_heartbeat_check()
199 idev->fw_status_ready = false; /* go to running */ in ionic_heartbeat_check()
206 fw_status, fw_status_ready, idev->fw_status_ready, in ionic_heartbeat_check()
207 idev->last_fw_hb, lif->state[0]); in ionic_heartbeat_check()
210 if (fw_status_ready != idev->fw_status_ready && in ionic_heartbeat_check()
214 idev->fw_status_ready = fw_status_ready; in ionic_heartbeat_check()
240 if (!idev->fw_status_ready) in ionic_heartbeat_check()
246 last_check_time = idev->last_hb_time; in ionic_heartbeat_check()
250 fw_hb = ioread32(&idev->dev_info_regs->fw_heartbeat); in ionic_heartbeat_check()
251 fw_hb_ready = fw_hb != idev->last_fw_hb; in ionic_heartbeat_check()
258 __func__, fw_hb, idev->last_fw_hb, fw_hb_ready); in ionic_heartbeat_check()
260 idev->last_fw_hb = fw_hb; in ionic_heartbeat_check()
263 if (fw_hb_ready != idev->fw_hb_ready) { in ionic_heartbeat_check()
264 idev->fw_hb_ready = fw_hb_ready; in ionic_heartbeat_check()
274 idev->last_hb_time = check_time; in ionic_heartbeat_check()
279 u8 ionic_dev_cmd_status(struct ionic_dev *idev) in ionic_dev_cmd_status() argument
281 return ioread8(&idev->dev_cmd_regs->comp.comp.status); in ionic_dev_cmd_status()
284 bool ionic_dev_cmd_done(struct ionic_dev *idev) in ionic_dev_cmd_done() argument
286 return ioread32(&idev->dev_cmd_regs->done) & IONIC_DEV_CMD_DONE; in ionic_dev_cmd_done()
289 void ionic_dev_cmd_comp(struct ionic_dev *idev, union ionic_dev_cmd_comp *comp) in ionic_dev_cmd_comp() argument
291 memcpy_fromio(comp, &idev->dev_cmd_regs->comp, sizeof(*comp)); in ionic_dev_cmd_comp()
294 void ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd) in ionic_dev_cmd_go() argument
296 memcpy_toio(&idev->dev_cmd_regs->cmd, cmd, sizeof(*cmd)); in ionic_dev_cmd_go()
297 iowrite32(0, &idev->dev_cmd_regs->done); in ionic_dev_cmd_go()
298 iowrite32(1, &idev->dev_cmd_regs->doorbell); in ionic_dev_cmd_go()
302 void ionic_dev_cmd_identify(struct ionic_dev *idev, u8 ver) in ionic_dev_cmd_identify() argument
309 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_identify()
312 void ionic_dev_cmd_init(struct ionic_dev *idev) in ionic_dev_cmd_init() argument
319 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_init()
322 void ionic_dev_cmd_reset(struct ionic_dev *idev) in ionic_dev_cmd_reset() argument
328 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_reset()
332 void ionic_dev_cmd_port_identify(struct ionic_dev *idev) in ionic_dev_cmd_port_identify() argument
339 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_identify()
342 void ionic_dev_cmd_port_init(struct ionic_dev *idev) in ionic_dev_cmd_port_init() argument
347 .port_init.info_pa = cpu_to_le64(idev->port_info_pa), in ionic_dev_cmd_port_init()
350 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_init()
353 void ionic_dev_cmd_port_reset(struct ionic_dev *idev) in ionic_dev_cmd_port_reset() argument
360 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_reset()
363 void ionic_dev_cmd_port_state(struct ionic_dev *idev, u8 state) in ionic_dev_cmd_port_state() argument
372 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_state()
375 void ionic_dev_cmd_port_speed(struct ionic_dev *idev, u32 speed) in ionic_dev_cmd_port_speed() argument
384 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_speed()
387 void ionic_dev_cmd_port_autoneg(struct ionic_dev *idev, u8 an_enable) in ionic_dev_cmd_port_autoneg() argument
396 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_autoneg()
399 void ionic_dev_cmd_port_fec(struct ionic_dev *idev, u8 fec_type) in ionic_dev_cmd_port_fec() argument
408 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_fec()
411 void ionic_dev_cmd_port_pause(struct ionic_dev *idev, u8 pause_type) in ionic_dev_cmd_port_pause() argument
420 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_port_pause()
437 ionic_dev_cmd_go(&ionic->idev, &cmd); in ionic_set_vf_config()
471 ionic_dev_cmd_go(&ionic->idev, &cmd); in ionic_dev_cmd_vf_getattr()
473 memcpy_fromio(comp, &ionic->idev.dev_cmd_regs->comp.vf_getattr, in ionic_dev_cmd_vf_getattr()
485 void ionic_dev_cmd_queue_identify(struct ionic_dev *idev, in ionic_dev_cmd_queue_identify() argument
495 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_queue_identify()
498 void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, u8 type, u8 ver) in ionic_dev_cmd_lif_identify() argument
506 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_identify()
509 void ionic_dev_cmd_lif_init(struct ionic_dev *idev, u16 lif_index, in ionic_dev_cmd_lif_init() argument
518 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_init()
521 void ionic_dev_cmd_lif_reset(struct ionic_dev *idev, u16 lif_index) in ionic_dev_cmd_lif_reset() argument
528 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_lif_reset()
531 void ionic_dev_cmd_adminq_init(struct ionic_dev *idev, struct ionic_qcq *qcq, in ionic_dev_cmd_adminq_init() argument
552 ionic_dev_cmd_go(idev, &cmd); in ionic_dev_cmd_adminq_init()
627 int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev, in ionic_q_init() argument
642 q->idev = idev; in ionic_q_init()