Lines Matching refs:ionic

312 	err = ionic_heartbeat_check(lif->ionic);  in ionic_adminq_post()
362 (void)ionic_heartbeat_check(lif->ionic); in ionic_adminq_wait()
364 !lif->ionic->idev.fw_status_ready) || in ionic_adminq_wait()
376 dev_dbg(lif->ionic->dev, "%s: elapsed %d msecs\n", in ionic_adminq_wait()
402 static void ionic_dev_cmd_clean(struct ionic *ionic) in ionic_dev_cmd_clean() argument
404 struct ionic_dev *idev = &ionic->idev; in ionic_dev_cmd_clean()
410 void ionic_dev_cmd_dev_err_print(struct ionic *ionic, u8 opcode, u8 status, in ionic_dev_cmd_dev_err_print() argument
418 dev_err(ionic->dev, "DEV_CMD %s (%d) error, %s (%d) failed\n", in ionic_dev_cmd_dev_err_print()
422 static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, in __ionic_dev_cmd_wait() argument
425 struct ionic_dev *idev = &ionic->idev; in __ionic_dev_cmd_wait()
451 dev_dbg(ionic->dev, "DEVCMD %s (%d) done=%d took %ld secs (%ld jiffies)\n", in __ionic_dev_cmd_wait()
456 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
457 dev_warn(ionic->dev, "DEVCMD %s (%d) interrupted - FW is down\n", in __ionic_dev_cmd_wait()
463 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
464 dev_warn(ionic->dev, "DEVCMD %s (%d) timeout after %ld secs\n", in __ionic_dev_cmd_wait()
469 err = ionic_dev_cmd_status(&ionic->idev); in __ionic_dev_cmd_wait()
473 dev_dbg(ionic->dev, "DEV_CMD %s (%d), %s (%d) retrying...\n", in __ionic_dev_cmd_wait()
485 ionic_dev_cmd_dev_err_print(ionic, opcode, err, in __ionic_dev_cmd_wait()
491 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
496 int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) in ionic_dev_cmd_wait() argument
498 return __ionic_dev_cmd_wait(ionic, max_seconds, true); in ionic_dev_cmd_wait()
501 int ionic_dev_cmd_wait_nomsg(struct ionic *ionic, unsigned long max_seconds) in ionic_dev_cmd_wait_nomsg() argument
503 return __ionic_dev_cmd_wait(ionic, max_seconds, false); in ionic_dev_cmd_wait_nomsg()
506 int ionic_setup(struct ionic *ionic) in ionic_setup() argument
510 err = ionic_dev_setup(ionic); in ionic_setup()
513 ionic_reset(ionic); in ionic_setup()
518 int ionic_identify(struct ionic *ionic) in ionic_identify() argument
520 struct ionic_identity *ident = &ionic->ident; in ionic_identify()
521 struct ionic_dev *idev = &ionic->idev; in ionic_identify()
531 mutex_lock(&ionic->dev_cmd_lock); in ionic_identify()
537 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_identify()
542 mutex_unlock(&ionic->dev_cmd_lock); in ionic_identify()
545 dev_err(ionic->dev, "Cannot identify ionic: %d\n", err); in ionic_identify()
551 dev_info(ionic->dev, "FW: %.*s\n", in ionic_identify()
555 dev_info(ionic->dev, "FW: (invalid string) 0x%02x 0x%02x 0x%02x 0x%02x ...\n", in ionic_identify()
561 err = ionic_lif_identify(ionic, IONIC_LIF_TYPE_CLASSIC, in ionic_identify()
562 &ionic->ident.lif); in ionic_identify()
564 dev_err(ionic->dev, "Cannot identify LIFs: %d\n", err); in ionic_identify()
574 int ionic_init(struct ionic *ionic) in ionic_init() argument
576 struct ionic_dev *idev = &ionic->idev; in ionic_init()
579 mutex_lock(&ionic->dev_cmd_lock); in ionic_init()
581 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_init()
582 mutex_unlock(&ionic->dev_cmd_lock); in ionic_init()
587 int ionic_reset(struct ionic *ionic) in ionic_reset() argument
589 struct ionic_dev *idev = &ionic->idev; in ionic_reset()
595 mutex_lock(&ionic->dev_cmd_lock); in ionic_reset()
597 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_reset()
598 mutex_unlock(&ionic->dev_cmd_lock); in ionic_reset()
603 int ionic_port_identify(struct ionic *ionic) in ionic_port_identify() argument
605 struct ionic_identity *ident = &ionic->ident; in ionic_port_identify()
606 struct ionic_dev *idev = &ionic->idev; in ionic_port_identify()
610 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_identify()
613 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_identify()
619 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_identify()
624 int ionic_port_init(struct ionic *ionic) in ionic_port_init() argument
626 struct ionic_identity *ident = &ionic->ident; in ionic_port_init()
627 struct ionic_dev *idev = &ionic->idev; in ionic_port_init()
633 idev->port_info = dma_alloc_coherent(ionic->dev, in ionic_port_init()
643 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_init()
647 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_init()
649 ionic_dev_cmd_port_state(&ionic->idev, IONIC_PORT_ADMIN_STATE_UP); in ionic_port_init()
650 (void)ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_init()
652 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_init()
654 dev_err(ionic->dev, "Failed to init port\n"); in ionic_port_init()
655 dma_free_coherent(ionic->dev, idev->port_info_sz, in ionic_port_init()
664 int ionic_port_reset(struct ionic *ionic) in ionic_port_reset() argument
666 struct ionic_dev *idev = &ionic->idev; in ionic_port_reset()
673 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_reset()
675 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_reset()
676 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_reset()
679 dma_free_coherent(ionic->dev, idev->port_info_sz, in ionic_port_reset()