From owner-freebsd-wireless@freebsd.org Mon May 14 16:48:39 2018 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B5D2DF9873 for ; Mon, 14 May 2018 16:48:39 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA906AFAB for ; Mon, 14 May 2018 16:48:38 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-it0-x241.google.com with SMTP id 70-v6so12533113ity.2 for ; Mon, 14 May 2018 09:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=f9cNpChH6A2M7QZ/DRg9nPiKOr65PugfLsjcQR4Eu7I=; b=uW7SM2Jhr190yNvs21+5BV4uYrQ/H0tx79zCYkMpfB4d09Ssmt8JRovNRrXNID9VeK z5K0ZdWq8lQ7H6CSjQGpuFr3o3kHXDw2y2QP3LeA9naaiQKRx3oucMbuDP0aRqG02TUH r0CZliKp+R0YoNyI5h41fPZqqR38I9FUtX2P9i3C2AKGyZPOR+LqFau70+K3yHsVl0TA Ei2zzuy4Exf3YYbYWmWRH8wxmyh2fvEQXxcNeerKE5OjtpwD6ZJiybvQUZOXY3b/vHXK CHp1ecR2CQslWGKxSiRLJOaj1ogPijfjY0GYvdyjVgmT+LnNthRxr/DbVyx1NEuTlPAG yBHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=f9cNpChH6A2M7QZ/DRg9nPiKOr65PugfLsjcQR4Eu7I=; b=DXSo5W7URsz5i380yf/stUAHN+5g/+HEfl7IUx6ClEySnCnkOab/HkaYom+VvLfXA0 D/5WBuBQnFXn5n2Y11RzFqkKf16nrKiKH72D6L2qPj/mnAqpAIoZ5Up+ARreGK6fN7ku eTZzAMRqJvaDeeNC97COJkN6vJyaSqUnAYPDA0LQ4grWJH1lkoCLHIIOTAr+d39IYEom dZjmBdAlNw8OQk4E+Y69l5/Gs0Ol8SKC7s+AZELC0iGbPKsvDtZzzp8Oec+B30h9Ge0q 7lIeF7NIguT5J//KbcsKc4t2AC9Zo6fekE9zwL/tX/7SaBvAwHlJKSBRb5S/LUkQQzeL OaKA== X-Gm-Message-State: ALKqPwfkAJIXnlPB+2fHJjZ43/XY7LuxSogVYm8jYUyA9UGfinoqpSDA L5w5BlXD7xK8VuvodaSgH+Sii0ahmMl5oc4iPZyNyxGh X-Google-Smtp-Source: AB8JxZpzvh1uWK9q9BXsHE3aZE8iXAa51ACFgKNcSrCjzEzLr/rfOq1Aci7YMcnU/kdzF6OQ9IJX2DaY4CT8W3uv2gc= X-Received: by 2002:a24:29cb:: with SMTP id p194-v6mr10393932itp.128.1526316517600; Mon, 14 May 2018 09:48:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.192.160.196 with HTTP; Mon, 14 May 2018 09:48:17 -0700 (PDT) From: Farhan Khan Date: Mon, 14 May 2018 12:48:17 -0400 Message-ID: Subject: Handling C2H debug interrupt on rtwn(8) To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 16:48:39 -0000 Hi all, I have a question regarding catching an unhandled C2H event interrupt. rtwn(4) receives C2H interrupts from the device. One type is R92C_C2H_EVT_DEBUG as defined in sys/dev/rtwn/rtl8192c/r92c_fw_cmd.h as 0. Interrupts are handled in r92c_handle_c2h_task() in sys/dev/rtwn/rtl8192c/r92c_fw.c line 479. I noticed that rtl8188ee (driver in development) sends R92C_C2H_EVT_DEBUG, but they are not handled, resulting in the 'default' case, which is to print a warning into the kernel messages buffer. As a result, I am seeing a ton of warning messages across my terminal 1-2 times a second. This is not a problem for me in development, but would problematic for any user of the driver, as it would fill up the kernel messages buffer very quickly. I reviewed Linux's equivalent code and found that rtl8723ae is the only one of the rtlwifi drivers that checks C2H_EVT_HOST_CLOSE (also defined as 0), and immediately just does a 'return'. Would it be correct for me to imitate this behavior, check for the same C2H message type, and immediately issue a 'break'? I did so in my dev repository here: https://github.com/khanzf/rtl8188ee/commit/b9dd37c8f40af1bda1ec8d82fdaa051840b85e75 . Thanks! -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE