Lines Matching refs:ionic

341 	err = ionic_heartbeat_check(lif->ionic);  in ionic_adminq_post()
391 ionic_heartbeat_check(lif->ionic); in ionic_adminq_wait()
393 !lif->ionic->idev.fw_status_ready) || in ionic_adminq_wait()
405 dev_dbg(lif->ionic->dev, "%s: elapsed %d msecs\n", in ionic_adminq_wait()
419 if (!ionic_is_fw_running(&lif->ionic->idev)) in __ionic_adminq_post_wait()
437 static void ionic_dev_cmd_clean(struct ionic *ionic) in ionic_dev_cmd_clean() argument
439 struct ionic_dev *idev = &ionic->idev; in ionic_dev_cmd_clean()
448 void ionic_dev_cmd_dev_err_print(struct ionic *ionic, u8 opcode, u8 status, in ionic_dev_cmd_dev_err_print() argument
456 dev_err(ionic->dev, "DEV_CMD %s (%d) error, %s (%d) failed\n", in ionic_dev_cmd_dev_err_print()
460 static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, in __ionic_dev_cmd_wait() argument
463 struct ionic_dev *idev = &ionic->idev; in __ionic_dev_cmd_wait()
489 dev_dbg(ionic->dev, "DEVCMD %s (%d) done=%d took %ld secs (%ld jiffies)\n", in __ionic_dev_cmd_wait()
494 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
495 dev_warn(ionic->dev, "DEVCMD %s (%d) interrupted - FW is down\n", in __ionic_dev_cmd_wait()
501 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
502 dev_warn(ionic->dev, "DEVCMD %s (%d) timeout after %ld secs\n", in __ionic_dev_cmd_wait()
507 err = ionic_dev_cmd_status(&ionic->idev); in __ionic_dev_cmd_wait()
511 dev_dbg(ionic->dev, "DEV_CMD %s (%d), %s (%d) retrying...\n", in __ionic_dev_cmd_wait()
523 ionic_dev_cmd_dev_err_print(ionic, opcode, err, in __ionic_dev_cmd_wait()
529 ionic_dev_cmd_clean(ionic); in __ionic_dev_cmd_wait()
534 int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) in ionic_dev_cmd_wait() argument
536 return __ionic_dev_cmd_wait(ionic, max_seconds, true); in ionic_dev_cmd_wait()
539 int ionic_dev_cmd_wait_nomsg(struct ionic *ionic, unsigned long max_seconds) in ionic_dev_cmd_wait_nomsg() argument
541 return __ionic_dev_cmd_wait(ionic, max_seconds, false); in ionic_dev_cmd_wait_nomsg()
544 int ionic_setup(struct ionic *ionic) in ionic_setup() argument
548 err = ionic_dev_setup(ionic); in ionic_setup()
551 ionic_reset(ionic); in ionic_setup()
556 int ionic_identify(struct ionic *ionic) in ionic_identify() argument
558 struct ionic_identity *ident = &ionic->ident; in ionic_identify()
559 struct ionic_dev *idev = &ionic->idev; in ionic_identify()
569 mutex_lock(&ionic->dev_cmd_lock); in ionic_identify()
575 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_identify()
580 mutex_unlock(&ionic->dev_cmd_lock); in ionic_identify()
583 dev_err(ionic->dev, "Cannot identify ionic: %d\n", err); in ionic_identify()
589 dev_info(ionic->dev, "FW: %.*s\n", in ionic_identify()
593 dev_info(ionic->dev, "FW: (invalid string) 0x%02x 0x%02x 0x%02x 0x%02x ...\n", in ionic_identify()
599 err = ionic_lif_identify(ionic, IONIC_LIF_TYPE_CLASSIC, in ionic_identify()
600 &ionic->ident.lif); in ionic_identify()
602 dev_err(ionic->dev, "Cannot identify LIFs: %d\n", err); in ionic_identify()
612 int ionic_init(struct ionic *ionic) in ionic_init() argument
614 struct ionic_dev *idev = &ionic->idev; in ionic_init()
617 mutex_lock(&ionic->dev_cmd_lock); in ionic_init()
619 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_init()
620 mutex_unlock(&ionic->dev_cmd_lock); in ionic_init()
625 int ionic_reset(struct ionic *ionic) in ionic_reset() argument
627 struct ionic_dev *idev = &ionic->idev; in ionic_reset()
633 mutex_lock(&ionic->dev_cmd_lock); in ionic_reset()
635 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_reset()
636 mutex_unlock(&ionic->dev_cmd_lock); in ionic_reset()
641 int ionic_port_identify(struct ionic *ionic) in ionic_port_identify() argument
643 struct ionic_identity *ident = &ionic->ident; in ionic_port_identify()
644 struct ionic_dev *idev = &ionic->idev; in ionic_port_identify()
648 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_identify()
651 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_identify()
657 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_identify()
662 int ionic_port_init(struct ionic *ionic) in ionic_port_init() argument
664 struct ionic_identity *ident = &ionic->ident; in ionic_port_init()
665 struct ionic_dev *idev = &ionic->idev; in ionic_port_init()
671 idev->port_info = dma_alloc_coherent(ionic->dev, in ionic_port_init()
681 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_init()
685 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_init()
687 ionic_dev_cmd_port_state(&ionic->idev, IONIC_PORT_ADMIN_STATE_UP); in ionic_port_init()
688 ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_init()
690 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_init()
692 dev_err(ionic->dev, "Failed to init port\n"); in ionic_port_init()
693 dma_free_coherent(ionic->dev, idev->port_info_sz, in ionic_port_init()
702 int ionic_port_reset(struct ionic *ionic) in ionic_port_reset() argument
704 struct ionic_dev *idev = &ionic->idev; in ionic_port_reset()
711 mutex_lock(&ionic->dev_cmd_lock); in ionic_port_reset()
713 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_port_reset()
714 mutex_unlock(&ionic->dev_cmd_lock); in ionic_port_reset()
717 dma_free_coherent(ionic->dev, idev->port_info_sz, in ionic_port_reset()