From patchwork Fri Dec 9 13:19:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 130374 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B42B81007D7 for ; Sat, 10 Dec 2011 00:19:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B2FDC9D20A; Fri, 9 Dec 2011 08:19:45 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VFeoRIkIMzRZ; Fri, 9 Dec 2011 08:19:45 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 40E089D20B; Fri, 9 Dec 2011 08:19:41 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 715E29D20A for ; Fri, 9 Dec 2011 08:19:40 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3M+CnHGqzRiH for ; Fri, 9 Dec 2011 08:19:35 -0500 (EST) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 56F739D20D for ; Fri, 9 Dec 2011 08:19:28 -0500 (EST) Received: from [10.16.192.224] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Fri, 09 Dec 2011 05:27:06 -0800 X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031 Received: from SJEXCHCCR01.corp.ad.broadcom.com ([10.252.49.130]) by SJEXCHHUB01.corp.ad.broadcom.com ([10.16.192.224]) with mapi; Fri, 9 Dec 2011 05:19:16 -0800 From: "Jithu Jance" To: "hostap@lists.shmoo.com" Date: Fri, 9 Dec 2011 05:19:16 -0800 Subject: [PATCH] P2P: p2p_dev_address appended to AP-STA-DISCONNECTED event for P2P connections. Thread-Topic: [PATCH] P2P: p2p_dev_address appended to AP-STA-DISCONNECTED event for P2P connections. Thread-Index: AQHMtnOigkqR3ttyvUuw9AWpdh4CaA== Message-ID: <6C370B347C3FE8438C9692873287D2E1195AE35D64@SJEXCHCCR01.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 62FCD3203GG8239296-01-01 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com For AP-STA-CONNECTED event during P2P connection, the "dev_addr=" print is modified to "p2p_dev_addr=" for better readability. This patch also appends "p2p_dev_addr" to AP-STA-DISCONNECTED event [For P2P Connections]. Kindly see whether the patch is okay. Signed-hostap: Jithu Jance --- src/ap/sta_info.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index a9981cc..cc7ffe8 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -771,37 +771,48 @@ void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta) void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, int authorized) { + const u8 *dev_addr = NULL; if (!!authorized == !!(sta->flags & WLAN_STA_AUTHORIZED)) return; - if (authorized) { - const u8 *dev_addr = NULL; #ifdef CONFIG_P2P - dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr); + dev_addr = p2p_group_get_dev_addr(hapd->p2p_group, sta->addr); #endif /* CONFIG_P2P */ + + if (authorized) { if (dev_addr) wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED - MACSTR " dev_addr=" MACSTR, + MACSTR " p2p_dev_addr=" MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr)); else wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED MACSTR, MAC2STR(sta->addr)); if (hapd->msg_ctx_parent && - hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr) + hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr) wpa_msg(hapd->msg_ctx_parent, MSG_INFO, - AP_STA_CONNECTED MACSTR " dev_addr=" MACSTR, + AP_STA_CONNECTED MACSTR " p2p_dev_addr=" MACSTR, MAC2STR(sta->addr), MAC2STR(dev_addr)); else if (hapd->msg_ctx_parent && - hapd->msg_ctx_parent != hapd->msg_ctx) + hapd->msg_ctx_parent != hapd->msg_ctx) wpa_msg(hapd->msg_ctx_parent, MSG_INFO, AP_STA_CONNECTED MACSTR, MAC2STR(sta->addr)); sta->flags |= WLAN_STA_AUTHORIZED; } else { - wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED MACSTR, - MAC2STR(sta->addr)); + if(dev_addr) + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED + MACSTR " p2p_dev_addr=" MACSTR, + MAC2STR(sta->addr), MAC2STR(dev_addr)); + else + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED MACSTR, + MAC2STR(sta->addr)); if (hapd->msg_ctx_parent && - hapd->msg_ctx_parent != hapd->msg_ctx) + hapd->msg_ctx_parent != hapd->msg_ctx && dev_addr) + wpa_msg(hapd->msg_ctx_parent, MSG_INFO, + AP_STA_DISCONNECTED MACSTR " p2p_dev_addr=" MACSTR, + MAC2STR(sta->addr), MAC2STR(dev_addr)); + else if (hapd->msg_ctx_parent && + hapd->msg_ctx_parent != hapd->msg_ctx) wpa_msg(hapd->msg_ctx_parent, MSG_INFO, AP_STA_DISCONNECTED MACSTR, MAC2STR(sta->addr));