node-drivers/base-driver/drivers/vca/plx87xx/plx_main.c
static int plx_first_boot_mgr(void *plxdev)
{
	struct plx_device *xdev = plxdev;
	int err = 0;
	int tries_pwr = 3;

	if (plx_identify_cpu_id(xdev) < 0) {
		dev_err(&xdev->pdev->dev, "%s: unknown device\n", __func__);
		err = -ENODEV;
		goto exit;
	}


	while (tries_pwr) {
		--tries_pwr;

		plx_card_press_power_button(plx_contexts[xdev->card_id][0], NULL,
						plx_identify_cpu_id(xdev), true, NULL);

		msleep(500);

		plx_card_press_power_button(plx_contexts[xdev->card_id][0], NULL,
						plx_identify_cpu_id(xdev), false, NULL);

		if (plx_wait_good_link(xdev)) {
			err = 0;
			goto exit;
		} else {
			dev_info(&xdev->pdev->dev, "No good node link for %d seconds, "
					"left tries of power button cycles %i\n",
					LINK_WAIT_TIMEOUT, tries_pwr);
		}
	}

	dev_err(&xdev->pdev->dev, "Node link cannot be established!!!\n");
	err = -ETIME;

exit:
	xdev->first_time_boot_mgr = false;
	do_exit(err);
	return err;
}
/**
 * plx_first_boot_mgr - thread function managing node link establishement after
 * power on
 * @plxdev: plx device structure
 * return: 0 on success, otherwise -errno
 *
 * Press long and short power button to equalize power state of node.
 * If no link after 60 seconds, press long and short power button again,
 * try this 3 times. Function shouldn't be invoked for VCA gen 1.
 */
thread function managing node link establishement after
power on
@plxdev: plx device structure
return: 0 on success, otherwise -errno

Press long and short power button to equalize power state of node.
If no link after 60 seconds, press long and short power button again,
try this 3 times. Function shouldn't be invoked for VCA gen 1.
thread function managing node link establishement after power on @plxdev : plx device structure return : 0 on success otherwise - errno Press long and short power button to equalize power state of node . If no link after 60 seconds press long and short power button again try this 3 times . Function shouldn ' t be invoked for VCA gen 1 .
static int plx_first_boot_mgr(void *plxdev)
{
	struct plx_device *xdev = plxdev;
	int err = 0;
	int tries_pwr = 3;
	if (plx_identify_cpu_id(xdev) < 0) {
		dev_err(&xdev->pdev->dev, "%s: unknown device\n", __func__);
		err = -ENODEV;
		goto exit;
	}
	while (tries_pwr) {
		--tries_pwr;
		plx_card_press_power_button(plx_contexts[xdev->card_id][0], NULL,
						plx_identify_cpu_id(xdev), true, NULL);
		msleep(500);
		plx_card_press_power_button(plx_contexts[xdev->card_id][0], NULL,
						plx_identify_cpu_id(xdev), false, NULL);
		if (plx_wait_good_link(xdev)) {
			err = 0;
			goto exit;
		} else {
			dev_info(&xdev->pdev->dev, "No good node link for %d seconds, "
					"left tries of power button cycles %i\n",
					LINK_WAIT_TIMEOUT, tries_pwr);
		}
	}
	dev_err(&xdev->pdev->dev, "Node link cannot be established!!!\n");
	err = -ETIME;
exit:
	xdev->first_time_boot_mgr = false;
	do_exit(err);
	return err;
}
static int plx_first_boot_mgr ( void * plxdev ) { struct plx_device * xdev = plxdev ; int err = 0 ; int tries_pwr = 3 ; if ( plx_identify_cpu_id ( xdev ) < 0 ) { dev_err ( & xdev -> pdev -> dev , " \n " , __func__ ) ; err = - ENODEV ; goto exit ; } while ( tries_pwr ) { -- tries_pwr ; plx_card_press_power_button ( plx_contexts [ xdev -> card_id ] [ 0 ] , NULL , plx_identify_cpu_id ( xdev ) , true , NULL ) ; msleep ( 500 ) ; plx_card_press_power_button ( plx_contexts [ xdev -> card_id ] [ 0 ] , NULL , plx_identify_cpu_id ( xdev ) , false , NULL ) ; if ( plx_wait_good_link ( xdev ) ) { err = 0 ; goto exit ; } else { dev_info ( & xdev -> pdev -> dev , " " " \n " , LINK_WAIT_TIMEOUT , tries_pwr ) ; } } dev_err ( & xdev -> pdev -> dev , " \n " ) ; err = - ETIME ; exit : xdev -> first_time_boot_mgr = false ; do_exit ( err ) ; return err ; }
plx_first_boot_mgr - thread function managing node link establishement after
 power on
 @plxdev: plx device structure
 return: 0 on success, otherwise -errno
plx_first_boot_mgr - thread function managing node link establishement after power on @plxdev : plx device structure return : 0 on success otherwise - errno