Patchwork [1/4] wpa_supplicant: Handle Notice Of Absence driver notification

login
register
mail settings
Submitter Janusz.Dziedzic@tieto.com
Date Nov. 28, 2011, 12:11 p.m.
Message ID <3078A9B976EF864C8DDD0C499FFD07911E3B76D9B0@EXMB01.eu.tieto.com>
Download mbox | patch
Permalink /patch/127966/
State Changes Requested
Headers show

Comments

Janusz.Dziedzic@tieto.com - Nov. 28, 2011, 12:11 p.m.
P2P GO basic definition for handling driver (EVENT_DRIVER_NOTIFY_NOA)
notification about current Notice Of Absence and Opportunistic Power
Save params used by driver.
---
 src/drivers/driver.h        |   36 +++++++++++++++++++++++++++++++++++-
 src/drivers/driver_common.c |    1 +
 wpa_supplicant/events.c     |    8 ++++++++
 3 files changed, 44 insertions(+), 1 deletions(-)

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index ce25d03..44127f4 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2884,7 +2884,12 @@  enum wpa_event_type {
 	/**
 	 * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
 	 */
-	EVENT_EAPOL_TX_STATUS
+	EVENT_EAPOL_TX_STATUS,
+
+	/**
+	 * EVENT_DRIVER_NOTIFY_NOA - Device/driver did NOA setup/change
+	 */
+	EVENT_DRIVER_NOTIFY_NOA
 };
 
 
@@ -3464,6 +3469,35 @@  union wpa_event_data {
 		int data_len;
 		int ack;
 	} eapol_tx_status;
+
+	/**
+	 * struct driver_notify_noa - Data for EVENT_DRIVER_NOTIFY_NOA
+	 * @index: inentifies an instance of NOA timing
+	 * @oppps_ctwindow: opportunistic power save capability
+	 *		    BIT(7): 1 - enabled, 0 disabled
+	 *		    BITS(0-6) - Client Traffic Window in TU
+	 * @count: indicates the number of absence intervals
+	 *	   255 - mean a continous schedule
+	 *	   0 - mean NOA disabled
+	 * @duration: duration in units of microseconds that P2P_GO
+	 *	      can remain absent following the start of NOA
+	 *	      interval
+	 * @interval: NOA interval in units of microseconds
+	 * @start: the start time for the schedule expressed in terms
+	 *	   of lower 4 bytes of the TSF timer
+	 *
+	 * Contain current params used by driver, Notice Of Absence
+	 * instance and Opportunistic Power Save
+	 *
+	 */
+	struct driver_notify_noa {
+		u8 index;
+		u8 oppps_ctwindow;
+		u8 count_type;
+		u32 duration;
+		u32 interval;
+		u32 start_time;
+	} driver_notify_noa;
 };
 
 /**
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index 26ca8d6..8580bd3 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -83,6 +83,7 @@  const char * event_to_string(enum wpa_event_type event)
 	E2S(SCHED_SCAN_STOPPED);
 	E2S(DRIVER_CLIENT_POLL_OK);
 	E2S(EAPOL_TX_STATUS);
+	E2S(DRIVER_NOTIFY_NOA);
 	}
 
 	return "UNKNOWN";
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index c9e53ca..509b05e 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2469,6 +2469,14 @@  void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 		wpas_wps_start_pbc(wpa_s, NULL, 0);
 #endif /* CONFIG_WPS */
 		break;
+	case EVENT_DRIVER_NOTIFY_NOA:
+#ifdef CONFIG_P2P
+		/* TODO: Update Beacon and probe response here
+		 *	 p2p_group_notif_noa()
+		 */
+		wpa_dbg(wpa_s, MSG_DEBUG, "EVENT_DRIVER_NOTIFY_NOA");
+#endif /* CONFIG_P2P */
+		break;
 	default:
 		wpa_msg(wpa_s, MSG_INFO, "Unknown event %d", event);
 		break;