/** 
 * \fn     wlanDrvIf_Stop
 * \brief  Stop driver
 * 
 * Called by network stack upon closing network interface (ifconfig down).
 * Can also be called from user application or CLI for flight mode.
 * Stop the driver and turn off the device.
 *
 * \note   
 * \param  dev - The driver network-interface handle
 * \return 0 (OK)
 * \sa     wlanDrvIf_Start
 */ 
int wlanDrvIf_Stop (struct net_device *dev)
{
	TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

	ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Stop()\n");

	if (DRV_STATE_FAILED == drv->tCommon.eDriverState)
	{
		return -ENODEV;
	}

	/* 
	 *  Insert Stop command in DrvMain action queue, request driver scheduling 
	 *      and wait for Stop process completion.
	 */
	os_printf("%s LINE %d\n", __func__, __LINE__);
	os_wake_lock_timeout_enable(drv);
	os_printf("%s LINE %d\n", __func__, __LINE__);
    if (TI_OK != drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_STOP)) 
    {
        return -ENODEV;
    }
	os_printf("%s\n", __func__);
	return 0;
}
/** 
 * \fn     wlanDrvIf_Start
 * \brief  Start driver
 * 
 * Called by network stack upon opening network interface (ifconfig up).
 * Can also be called from user application or CLI for flight mode.
 * Start the driver initialization process up to OPERATIONAL state.
 *
 * \note   
 * \param  dev - The driver network-interface handle
 * \return 0 if succeeded, error if driver not available
 * \sa     wlanDrvIf_Stop
 */ 
int wlanDrvIf_Start (struct net_device *dev)
{
	TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

	ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Start()\n");
	printk("%s\n", __func__);
    if (!drv->tCommon.hDrvMain)
    {
		ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Start() Driver not created!\n");
		return -ENODEV;
	}

	if (DRV_STATE_FAILED == drv->tCommon.eDriverState)
	{
		ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Start() Driver failed!\n");
		return -ENODEV;
	}

	/*
	 *  Insert Start command in DrvMain action queue, request driver scheduling 
	 *      and wait for action completion (all init process).
	 */
	os_wake_lock_timeout_enable(drv);
    if (TI_OK != drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_START)) 
    {
        return -ENODEV;
    }

    return 0;
}
예제 #3
0
/** 
 * \fn     wlanDrvIf_Stop
 * \brief  Stop driver
 * 
 * Called by network stack upon closing network interface (ifconfig down).
 * Can also be called from user application or CLI for flight mode.
 * Stop the driver and turn off the device.
 *
 * \note   
 * \param  dev - The driver network-interface handle
 * \return 0 (OK)
 * \sa     wlanDrvIf_Start
 */ 
int wlanDrvIf_Stop (struct net_device *dev)
{
    TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

    ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Stop()\n");

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
    /* Disable network interface queue */
    netif_stop_queue (dev);
#endif
    /* 
     *  Insert Stop command in DrvMain action queue, request driver scheduling 
     *      and wait for Stop process completion.
     */
    drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_STOP);
    return 0;
}
예제 #4
0
/** 
 * \fn     wlanDrvIf_Start
 * \brief  Start driver
 * 
 * Called by network stack upon opening network interface (ifconfig up).
 * Can also be called from user application or CLI for flight mode.
 * Start the driver initialization process up to OPERATIONAL state.
 *
 * \note   
 * \param  dev - The driver network-interface handle
 * \return 0 if succeeded, error if driver not available
 * \sa     wlanDrvIf_Stop
 */ 
int wlanDrvIf_Start (struct net_device *dev)
{
    TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

    ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Start()\n");

    if (!drv->tCommon.hDrvMain)
    {
        ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Start() Driver not created!\n");
        return -ENODEV;
    }


    /* 
     *  Insert Start command in DrvMain action queue, request driver scheduling 
     *      and wait for action completion (all init process).
     */
    drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_START);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
     /* 
     *  Finalize network interface setup
     */
  
  netif_start_queue (dev);
#ifdef AP_MODE_ENABLED
    netif_carrier_on (dev);
#endif


    /* register 3430 PM hooks in our SDIO driver */
#if defined HOST_PLATFORM_OMAP3430 || defined HOST_PLATFORM_ZOOM2 || defined HOST_PLATFORM_ZOOM1 || defined HOST_PLATFORM_MX25
    /*sdioDrv_register_pm(wlanDrvIf_pm_resume, wlanDrvIf_pm_suspend);*/
#endif

#endif
    return 0;
}
예제 #5
0
/**
 * \fn     wlanDrvIf_Stop
 * \brief  Stop driver
 *
 * Called by network stack upon closing network interface (ifconfig down).
 * Can also be called from user application or CLI for flight mode.
 * Stop the driver and turn off the device.
 *
 * \note
 * \param  dev - The driver network-interface handle
 * \return 0 (OK)
 * \sa     wlanDrvIf_Start
 */
int wlanDrvIf_Stop (struct net_device *dev)
{
    TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

    ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Stop()\n");

    /* Disable network interface queue */
    netif_stop_queue (dev);

    /*before inserting an action - check driver state*/
    if (DRV_STATE_FAILED == drv->tCommon.eDriverState)
    {
        return -ENODEV;
    }
    /*
     *  Insert Stop command in DrvMain action queue, request driver scheduling
     *      and wait for Stop process completion.
     */
    if (TI_OK != drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_STOP)) 
    {
        return -ENODEV;
    }
    return 0;
}
예제 #6
0
/**
 * \fn     wlanDrvIf_Start
 * \brief  Start driver
 *
 * Called by network stack upon opening network interface (ifconfig up).
 * Can also be called from user application or CLI for flight mode.
 * Start the driver initialization process up to OPERATIONAL state.
 *
 * \note
 * \param  dev - The driver network-interface handle
 * \return 0 if succeeded, error if driver not available
 * \sa     wlanDrvIf_Stop
 */
int wlanDrvIf_Start (struct net_device *dev)
{
	TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);

	ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Start()\n");

	if (!drv->tCommon.hDrvMain)
	{
		ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Start() Driver not created!\n");
		return -ENODEV;
	}


	/*before inserting an action - check driver state*/
	if (DRV_STATE_FAILED == drv->tCommon.eDriverState)
	{
		return -ENODEV;
	}

	os_wake_lock_timeout_enable(drv);
	drvMain_InsertAction (drv->tCommon.hDrvMain, ACTION_TYPE_START);

	return 0;
}
예제 #7
0
int wlanDrvIf_Resume(void)
{
	drvMain_InsertAction (pDrvStaticHandle->tCommon.hDrvMain, ACTION_TYPE_RESUME);
	return 0;
}
예제 #8
0
int wlanDrvIf_Suspend(void)
{
	drvMain_InsertAction (pDrvStaticHandle->tCommon.hDrvMain, ACTION_TYPE_SUSPEND);
	return 0;
}