From patchwork Fri Jun 12 14:00:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 6598871 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC3C09F2F4 for ; Fri, 12 Jun 2015 14:01:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C8852066D for ; Fri, 12 Jun 2015 14:01:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23E842034A for ; Fri, 12 Jun 2015 14:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754439AbbFLOBE (ORCPT ); Fri, 12 Jun 2015 10:01:04 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:59254 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753667AbbFLOBB (ORCPT ); Fri, 12 Jun 2015 10:01:01 -0400 Received: from a88-113-225-236.elisa-laajakaista.fi ([88.113.225.236] helo=localhost.localdomain) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.85) (envelope-from ) id 1Z3PVy-00057K-U1; Fri, 12 Jun 2015 17:00:59 +0300 From: Luca Coelho To: aspriel@gmail.com Cc: linux-wireless@vger.kernel.org Date: Fri, 12 Jun 2015 17:00:43 +0300 Message-Id: <1434117644-3033-4-git-send-email-luca@coelho.fi> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434117644-3033-1-git-send-email-luca@coelho.fi> References: <1434117644-3033-1-git-send-email-luca@coelho.fi> X-SA-Exim-Connect-IP: 88.113.225.236 X-SA-Exim-Mail-From: luca@coelho.fi X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Subject: [PATCH py80211 3/4] py80211: add sched_scan stop class X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on farmhouse.coelho.fi) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luciano Coelho Add a class to stop scheduled scans. Signed-off-by: Luciano Coelho --- lib/scan.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/scan.py b/lib/scan.py index bfaf4da..bfaf3d2 100644 --- a/lib/scan.py +++ b/lib/scan.py @@ -203,3 +203,18 @@ class sched_scan_start(scan_start_base): if genlh.cmd in [ nl80211.CMD_START_SCHED_SCAN ]: self.scan_busy = False return nl.NL_SKIP + +class sched_scan_stop(scan_cmd_base): + def __init__(self, ifidx, level=nl.NL_CB_DEFAULT): + super(sched_scan_stop, self).__init__(ifidx, level) + self._nl_cmd = nl80211.CMD_STOP_SCHED_SCAN + + def send(self): + self._prepare_cmd() + self._send_and_wait() + + def handle(self, msg, arg): + genlh = genl.genlmsg_hdr(nl.nlmsg_hdr(msg)) + if genlh.cmd in [ nl80211.CMD_SCHED_SCAN_STOPPED ]: + self.scan_busy = False + return nl.NL_SKIP