示例#1
0
文件: pxe_undi.c 项目: 42wim/ipxe
/* PXENV_UNDI_RESET_ADAPTER
 *
 * Status: working
 */
static PXENV_EXIT_t
pxenv_undi_reset_adapter ( struct s_PXENV_UNDI_RESET *undi_reset_adapter ) {
	int rc;

	DBGC ( &pxe_netdev, "PXENV_UNDI_RESET_ADAPTER" );
	pxe_dump_mcast_list ( &undi_reset_adapter->R_Mcast_Buf );
	DBGC ( &pxe_netdev, "\n" );

	/* Sanity check */
	if ( ! pxe_netdev ) {
		DBGC ( &pxe_netdev, "PXENV_UNDI_RESET_ADAPTER called with no "
		       "network device\n" );
		undi_reset_adapter->Status = PXENV_STATUS_UNDI_INVALID_STATE;
		return PXENV_EXIT_FAILURE;
	}

	/* Close and reopen network device */
	pxe_netdev_close();
	if ( ( rc = pxe_netdev_open() ) != 0 ) {
		DBGC ( &pxe_netdev, "PXENV_UNDI_RESET_ADAPTER could not "
		       "reopen %s: %s\n", pxe_netdev->name, strerror ( rc ) );
		undi_reset_adapter->Status = PXENV_STATUS ( rc );
		return PXENV_EXIT_FAILURE;
	}

	undi_reset_adapter->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}
示例#2
0
文件: pxe_undi.c 项目: CSU-GH/gpxe
/* PXENV_UNDI_CLOSE
 *
 * Status: working
 */
PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
	DBG ( "PXENV_UNDI_CLOSE\n" );

	pxe_netdev_close();

	undi_close->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}
示例#3
0
文件: pxe_undi.c 项目: CSU-GH/gpxe
/* PXENV_UNDI_CLEANUP
 *
 * Status: working
 */
PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP *undi_cleanup ) {
	DBG ( "PXENV_UNDI_CLEANUP\n" );

	pxe_netdev_close();

	undi_cleanup->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}
示例#4
0
文件: pxe_undi.c 项目: CSU-GH/gpxe
/* PXENV_UNDI_SHUTDOWN
 *
 * Status: working
 */
PXENV_EXIT_t pxenv_undi_shutdown ( struct s_PXENV_UNDI_SHUTDOWN
				   *undi_shutdown ) {
	DBG ( "PXENV_UNDI_SHUTDOWN\n" );

	pxe_netdev_close();

	undi_shutdown->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}
示例#5
0
文件: pxe_undi.c 项目: 42wim/ipxe
/* PXENV_UNDI_CLOSE
 *
 * Status: working
 */
static PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
	DBGC ( &pxe_netdev, "PXENV_UNDI_CLOSE\n" );

	/* Sanity check */
	if ( ! pxe_netdev ) {
		DBGC ( &pxe_netdev, "PXENV_UNDI_CLOSE called with no "
		       "network device\n" );
		undi_close->Status = PXENV_STATUS_UNDI_INVALID_STATE;
		return PXENV_EXIT_FAILURE;
	}

	/* Close network device */
	pxe_netdev_close();

	undi_close->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}
示例#6
0
文件: pxe_undi.c 项目: CSU-GH/gpxe
/* PXENV_UNDI_RESET_ADAPTER
 *
 * Status: working
 */
PXENV_EXIT_t pxenv_undi_reset_adapter ( struct s_PXENV_UNDI_RESET
					*undi_reset_adapter ) {
	int rc;

	DBG ( "PXENV_UNDI_RESET_ADAPTER" );
	pxe_dump_mcast_list ( &undi_reset_adapter->R_Mcast_Buf );
	DBG ( "\n" );

	pxe_netdev_close();
	if ( ( rc = pxe_netdev_open() ) != 0 ) {
		DBG ( "PXENV_UNDI_RESET_ADAPTER could not reopen %s: %s\n",
		      pxe_netdev->name, strerror ( rc ) );
		undi_reset_adapter->Status = PXENV_STATUS ( rc );
		return PXENV_EXIT_FAILURE;
	}

	undi_reset_adapter->Status = PXENV_STATUS_SUCCESS;
	return PXENV_EXIT_SUCCESS;
}