From patchwork Mon Jul 25 12:14:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 9245559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5AE1760869 for ; Mon, 25 Jul 2016 12:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A1C2205A4 for ; Mon, 25 Jul 2016 12:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF102787D; Mon, 25 Jul 2016 12:15:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD397205A4 for ; Mon, 25 Jul 2016 12:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751743AbcGYMPF (ORCPT ); Mon, 25 Jul 2016 08:15:05 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:48894 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbcGYMPD (ORCPT ); Mon, 25 Jul 2016 08:15:03 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=omega.localdomain) by metis.ext.pengutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1bRemj-0007nu-NB; Mon, 25 Jul 2016 14:15:01 +0200 From: Alexander Aring To: linux-wpan@vger.kernel.org Cc: kernel@pengutronix.de, Alexander Aring Subject: [RFC bluetooth-next 4/4] mac802154: iface: remove ioctl functionality Date: Mon, 25 Jul 2016 14:14:50 +0200 Message-Id: <20160725121450.4093-5-aar@pengutronix.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160725121450.4093-1-aar@pengutronix.de> References: <20160725121450.4093-1-aar@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: aar@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wpan@vger.kernel.org Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch removed deprecated ioctl functionality. This functionality offers to set not usual addresses: pan id and short address. When setting the short address the user gets the info to not use SIOCSIFADDR because it's not recommended. This ioctl was a fast solution to offer the setting of pan and short address. Nowadays we have nl802154. Signed-off-by: Alexander Aring --- net/mac802154/iface.c | 64 --------------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 9723099..4aed0f7 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -46,69 +46,6 @@ int mac802154_wpan_update_llsec(struct net_device *dev) return mac802154_llsec_set_params(&sdata->sec, ¶ms, changed); } -static int -mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) -{ - struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); - struct wpan_dev *wpan_dev = &sdata->wpan_dev; - struct sockaddr_ieee802154 *sa = - (struct sockaddr_ieee802154 *)&ifr->ifr_addr; - int err = -ENOIOCTLCMD; - - if (cmd != SIOCGIFADDR && cmd != SIOCSIFADDR) - return err; - - rtnl_lock(); - - switch (cmd) { - case SIOCGIFADDR: - { - u16 pan_id, short_addr; - - pan_id = le16_to_cpu(wpan_dev->pan_id); - short_addr = le16_to_cpu(wpan_dev->short_addr); - if (pan_id == IEEE802154_PANID_BROADCAST || - short_addr == IEEE802154_ADDR_BROADCAST) { - err = -EADDRNOTAVAIL; - break; - } - - sa->family = AF_IEEE802154; - sa->addr.addr_type = IEEE802154_ADDR_SHORT; - sa->addr.pan_id = pan_id; - sa->addr.short_addr = short_addr; - - err = 0; - break; - } - case SIOCSIFADDR: - if (netif_running(dev)) { - rtnl_unlock(); - return -EBUSY; - } - - dev_warn(&dev->dev, - "Using DEBUGing ioctl SIOCSIFADDR isn't recommended!\n"); - if (sa->family != AF_IEEE802154 || - sa->addr.addr_type != IEEE802154_ADDR_SHORT || - sa->addr.pan_id == IEEE802154_PANID_BROADCAST || - sa->addr.short_addr == IEEE802154_ADDR_BROADCAST || - sa->addr.short_addr == IEEE802154_ADDR_UNDEF) { - err = -EINVAL; - break; - } - - wpan_dev->pan_id = cpu_to_le16(sa->addr.pan_id); - wpan_dev->short_addr = cpu_to_le16(sa->addr.short_addr); - - err = mac802154_wpan_update_llsec(dev); - break; - } - - rtnl_unlock(); - return err; -} - static int mac802154_wpan_mac_addr(struct net_device *dev, void *p) { struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); @@ -504,7 +441,6 @@ static const struct net_device_ops mac802154_wpan_ops = { .ndo_open = mac802154_wpan_open, .ndo_stop = mac802154_slave_close, .ndo_start_xmit = ieee802154_subif_start_xmit, - .ndo_do_ioctl = mac802154_wpan_ioctl, .ndo_set_mac_address = mac802154_wpan_mac_addr, };