mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saurav Girepunje <saurav.girepunje@gmail.com>
To: Phillip Potter <phil@philpotter.co.uk>
Cc: saurav.girepunje@hotmail.com,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Martin Kaiser <martin@kaiser.cx>,
	Greg KH <gregkh@linuxfoundation.org>,
	Michael Straube <straube.linux@gmail.com>,
	"open list:STAGING SUBSYSTEM" <linux-staging@lists.linux.dev>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: r8188eu: os_dep: remove unused function rtw_android_priv_cmd
Date: Fri, 17 Sep 2021 21:09:51 +0530	[thread overview]
Message-ID: <6fe84f11-a9f8-0185-6174-19b700196254@gmail.com> (raw)
In-Reply-To: <CAA=Fs0n5xt5CtkyVcissVfJpP4_QBpCSUStUy=pT1DwXmsyMMg@mail.gmail.com>



On 13/09/21 11:10 pm, Phillip Potter wrote:
> On Mon, 13 Sept 2021 at 17:24, Greg KH <gregkh@linuxfoundation.org> wrote:
>>
>> On Sun, Sep 12, 2021 at 10:46:12PM +0530, Saurav Girepunje wrote:
>>> Remove unused function rtw_android_priv_cmd.
>>>
>>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>>> ---
>>>   drivers/staging/r8188eu/include/rtw_android.h |   1 -
>>>   drivers/staging/r8188eu/os_dep/rtw_android.c  | 138 ------------------
>>>   2 files changed, 139 deletions(-)
>>>
>>> diff --git a/drivers/staging/r8188eu/include/rtw_android.h b/drivers/staging/r8188eu/include/rtw_android.h
>>> index f60cf1c82984..86e3ac5f7955 100644
>>> --- a/drivers/staging/r8188eu/include/rtw_android.h
>>> +++ b/drivers/staging/r8188eu/include/rtw_android.h
>>> @@ -42,6 +42,5 @@ enum ANDROID_WIFI_CMD {
>>>   };
>>>
>>>   int rtw_android_cmdstr_to_num(char *cmdstr);
>>> -int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
>>>
>>>   #endif /* __RTW_ANDROID_H__ */
>>> diff --git a/drivers/staging/r8188eu/os_dep/rtw_android.c b/drivers/staging/r8188eu/os_dep/rtw_android.c
>>> index 010d529c8982..bd76177d60f9 100644
>>> --- a/drivers/staging/r8188eu/os_dep/rtw_android.c
>>> +++ b/drivers/staging/r8188eu/os_dep/rtw_android.c
>>> @@ -133,141 +133,3 @@ static int rtw_android_set_block(struct net_device *net, char *command,
>>>        return 0;
>>>   }
>>>
>>> -int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
>>> -{
>>> -     int ret = 0;
>>> -     char *command = NULL;
>>> -     int cmd_num;
>>> -     int bytes_written = 0;
>>> -     struct android_wifi_priv_cmd priv_cmd;
>>> -
>>> -     if (!ifr->ifr_data) {
>>> -             ret = -EINVAL;
>>> -             goto exit;
>>> -     }
>>> -     if (copy_from_user(&priv_cmd, ifr->ifr_data,
>>> -                        sizeof(struct android_wifi_priv_cmd))) {
>>> -             ret = -EFAULT;
>>> -             goto exit;
>>> -     }
>>> -     command = kmalloc(priv_cmd.total_len, GFP_KERNEL);
>>> -     if (!command) {
>>> -             DBG_88E("%s: failed to allocate memory\n", __func__);
>>> -             ret = -ENOMEM;
>>> -             goto exit;
>>> -     }
>>> -     if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) {
>>> -             DBG_88E("%s: failed to access memory\n", __func__);
>>> -             ret = -EFAULT;
>>> -             goto exit;
>>> -     }
>>> -     if (copy_from_user(command, (char __user *)priv_cmd.buf,
>>> -                        priv_cmd.total_len)) {
>>> -             ret = -EFAULT;
>>> -             goto exit;
>>> -     }
>>> -     DBG_88E("%s: Android private cmd \"%s\" on %s\n",
>>> -             __func__, command, ifr->ifr_name);
>>> -     cmd_num = rtw_android_cmdstr_to_num(command);
>>> -     switch (cmd_num) {
>>> -     case ANDROID_WIFI_CMD_START:
>>> -             goto response;
>>> -     case ANDROID_WIFI_CMD_SETFWPATH:
>>> -             goto response;
>>> -     }
>>> -     if (!g_wifi_on) {
>>> -             DBG_88E("%s: Ignore private cmd \"%s\" - iface %s is down\n",
>>> -                     __func__, command, ifr->ifr_name);
>>> -             ret = 0;
>>> -             goto exit;
>>> -     }
>>> -     switch (cmd_num) {
>>> -     case ANDROID_WIFI_CMD_STOP:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_SCAN_ACTIVE:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_SCAN_PASSIVE:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_RSSI:
>>> -             bytes_written = rtw_android_get_rssi(net, command,
>>> -                                                  priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_LINKSPEED:
>>> -             bytes_written = rtw_android_get_link_speed(net, command,
>>> -                                                        priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_MACADDR:
>>> -             bytes_written = rtw_android_get_macaddr(net, command,
>>> -                                                     priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_BLOCK:
>>> -             bytes_written = rtw_android_set_block(net, command,
>>> -                                                   priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_RXFILTER_START:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_RXFILTER_STOP:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_RXFILTER_ADD:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_RXFILTER_REMOVE:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_BTCOEXSCAN_START:
>>> -             /* TBD: BTCOEXSCAN-START */
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_BTCOEXSCAN_STOP:
>>> -             /* TBD: BTCOEXSCAN-STOP */
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_BTCOEXMODE:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_SETSUSPENDOPT:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_SETBAND:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_GETBAND:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_COUNTRY:
>>> -             bytes_written = android_set_cntry(net, command,
>>> -                                               priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_P2P_DEV_ADDR:
>>> -             bytes_written = android_get_p2p_addr(net, command,
>>> -                                                  priv_cmd.total_len);
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_P2P_SET_NOA:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_P2P_GET_NOA:
>>> -             break;
>>> -     case ANDROID_WIFI_CMD_P2P_SET_PS:
>>> -             break;
>>> -     default:
>>> -             DBG_88E("Unknown PRIVATE command %s - ignored\n", command);
>>> -             snprintf(command, 3, "OK");
>>> -             bytes_written = strlen("OK");
>>> -     }
>>> -
>>> -response:
>>> -     if (bytes_written >= 0) {
>>> -             if ((bytes_written == 0) && (priv_cmd.total_len > 0))
>>> -                     command[0] = '\0';
>>> -             if (bytes_written >= priv_cmd.total_len) {
>>> -                     DBG_88E("%s: bytes_written = %d\n", __func__,
>>> -                             bytes_written);
>>> -                     bytes_written = priv_cmd.total_len;
>>> -             } else {
>>> -                     bytes_written++;
>>> -             }
>>> -             priv_cmd.used_len = bytes_written;
>>> -             if (copy_to_user((char __user *)priv_cmd.buf, command,
>>> -                              bytes_written)) {
>>> -                     DBG_88E("%s: failed to copy data to user buffer\n",
>>> -                             __func__);
>>> -                     ret = -EFAULT;
>>> -             }
>>> -     } else {
>>> -             ret = bytes_written;
>>> -     }
>>> -exit:
>>> -     kfree(command);
>>> -     return ret;
>>> -}
>>> --
>>> 2.32.0
>>>
>>>
>>
>> Does not apply to my tree :(
> 
> Dear Saurav,
> 
> This code is already gone - Linus deleted it during a merge
> conflict resolution. I am planning to add it back soon though
> and reconnect with the newer siocdevprivate approach.
> 
> Regards,
> Phil
> 

Thanks Phil for information.

      reply	other threads:[~2021-09-17 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 17:16 Saurav Girepunje
2021-09-13 16:24 ` Greg KH
2021-09-13 17:40   ` Phillip Potter
2021-09-17 15:39     ` Saurav Girepunje [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fe84f11-a9f8-0185-6174-19b700196254@gmail.com \
    --to=saurav.girepunje@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --cc=saurav.girepunje@hotmail.com \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®