/*----------------------------------------------------------------
* prism2mgmt_readpda
*
* Collect the PDA data and put it in the message.
*
* Arguments:
*	wlandev		wlan device structure
*	msgp		ptr to msg buffer
*
* Returns:
*	0	success and done
*	<0	success, but we're waiting for something to finish.
*	>0	an error occurred while handling the message.
* Side effects:
*
* Call context:
*	process thread  (usually)
----------------------------------------------------------------*/
int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
{
    hfa384x_t		*hw = wlandev->priv;
    p80211msg_p2req_readpda_t	*msg = msgp;
    int				result;
    DBFENTER;

    /* We only support collecting the PDA when in the FWLOAD
     * state.
     */
    if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
        WLAN_LOG_ERROR(
            "PDA may only be read "
            "in the fwload state.\n");
        msg->resultcode.data =
            P80211ENUM_resultcode_implementation_failure;
        msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
    } else {
        /*  Call drvr_readpda(), it handles the auxport enable
         *  and validating the returned PDA.
         */
        result = hfa384x_drvr_readpda(
                     hw,
                     msg->pda.data,
                     HFA384x_PDA_LEN_MAX);
        if (result) {
            WLAN_LOG_ERROR(
                "hfa384x_drvr_readpda() failed, "
                "result=%d\n",
                result);

            msg->resultcode.data =
                P80211ENUM_resultcode_implementation_failure;
            msg->resultcode.status =
                P80211ENUM_msgitem_status_data_ok;
            DBFEXIT;
            return 0;
        }
        msg->pda.status = P80211ENUM_msgitem_status_data_ok;
        msg->resultcode.data = P80211ENUM_resultcode_success;
        msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
    }

    DBFEXIT;
    return 0;
}
Beispiel #2
0
/*----------------------------------------------------------------
 * prism2mgmt_readpda
 *
 * Collect the PDA data and put it in the message.
 *
 * Arguments:
 *	wlandev		wlan device structure
 *	msgp		ptr to msg buffer
 *
 * Returns:
 *	0	success and done
 *	<0	success, but we're waiting for something to finish.
 *	>0	an error occurred while handling the message.
 * Side effects:
 *
 * Call context:
 *	process thread  (usually)
 *----------------------------------------------------------------
 */
int prism2mgmt_readpda(struct wlandevice *wlandev, void *msgp)
{
	struct hfa384x *hw = wlandev->priv;
	struct p80211msg_p2req_readpda *msg = msgp;
	int result;

	/* We only support collecting the PDA when in the FWLOAD
	 * state.
	 */
	if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
		netdev_err(wlandev->netdev,
			   "PDA may only be read in the fwload state.\n");
		msg->resultcode.data =
		    P80211ENUM_resultcode_implementation_failure;
		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
	} else {
		/*  Call drvr_readpda(), it handles the auxport enable
		 *  and validating the returned PDA.
		 */
		result = hfa384x_drvr_readpda(hw,
					      msg->pda.data,
					      HFA384x_PDA_LEN_MAX);
		if (result) {
			netdev_err(wlandev->netdev,
				   "hfa384x_drvr_readpda() failed, result=%d\n",
				   result);

			msg->resultcode.data =
			    P80211ENUM_resultcode_implementation_failure;
			msg->resultcode.status =
			    P80211ENUM_msgitem_status_data_ok;
			return 0;
		}
		msg->pda.status = P80211ENUM_msgitem_status_data_ok;
		msg->resultcode.data = P80211ENUM_resultcode_success;
		msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
	}

	return 0;
}