From patchwork Tue Mar 29 08:37:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 8683961 Return-Path: X-Original-To: patchwork-linux-wpan@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 E80799F30C for ; Tue, 29 Mar 2016 08:38:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE3FA20154 for ; Tue, 29 Mar 2016 08:37:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E96D3200BE for ; Tue, 29 Mar 2016 08:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755947AbcC2Ihw (ORCPT ); Tue, 29 Mar 2016 04:37:52 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:33811 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756411AbcC2Ihq (ORCPT ); Tue, 29 Mar 2016 04:37:46 -0400 Received: by mail-wm0-f46.google.com with SMTP id p65so128687798wmp.1 for ; Tue, 29 Mar 2016 01:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zhQiyAVnk3aN0YeN5rzdIM0zPQLlGsev/o61neI7Cjc=; b=Pm4uKwzjga0CPg4WQh9/hKsILZyJQapHNCR7OLt9vKfVW/FCB5iCgwncu0X3f17Gre RkVk1CztFu+6tmyxB9uyhVBH5IhMwOM3j5ZAw6kZRlJojmylsNyW0lIVzsjChll9ORji vBl9NQiuhc1sENNau4XU9XkJ9hvEZdqJ2+a/s97KHxNWWMFKzXcDlIU4CskfPvRYWMxu hQ14LL6/2HKieYgjKqV62UTnvqkYJ+D+j1ZJ+v+mzd1vDOfPQUvTVVcqnrmfn73xFmNn 89AyTeNY1x8ivwHCtFraGbqfdCZIx6GrVSjGb9juk+05iXEOwfnR/t5CNGs9L5p1R3GC l7dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zhQiyAVnk3aN0YeN5rzdIM0zPQLlGsev/o61neI7Cjc=; b=TcEg7AG3kIe5Vt+M+Y9Hn1nG1u8thKBIO+Qnjs/LlQ2sGOGb/02wR0c48S82VXn+5A JuyGtIJd3DDSMkhaXe5UQBthZFH/IqX1erXx+Fm46Tc5jGPdtu6XcFdUImlJO2WIJHoP nCIahj8f6nntGOWA7gr4pSOP1Ll9ZKxoL6Jn98By3ELPkO1JYMbXzk9io7DxQcbq7WNn AuWXiPzwGuLuAkECUoCnoRUHiehNlmQBnGDnB+2vhcikVEL5HJoRstQLuA4xGqpD0455 3Z1MRiYeQrzysjIXLJs4aRSR1Wmefil/P34X+hXu+UTpO3ZwR4kXkWve5XT+hxKsS1vO w0RA== X-Gm-Message-State: AD7BkJJ5kaSHqbGydbPsboCSgJG7bDFzFmsMH7tR7w77pHy7OqgHVbBwq5cq9/kSr0w6Vg== X-Received: by 10.194.189.231 with SMTP id gl7mr1244507wjc.162.1459240664729; Tue, 29 Mar 2016 01:37:44 -0700 (PDT) Received: from omega (p20030064A9642859E2CB4EFFFE1BB546.dip0.t-ipconnect.de. [2003:64:a964:2859:e2cb:4eff:fe1b:b546]) by smtp.gmail.com with ESMTPSA id 73sm13592700wmy.22.2016.03.29.01.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 01:37:44 -0700 (PDT) Date: Tue, 29 Mar 2016 10:37:36 +0200 From: Alexander Aring To: Adika Bintang Sulaeman Cc: linux-wpan@vger.kernel.org, stefan@osg.samsung.com, jukka.rissanen@linux.intel.com Subject: Re: No device found for binding socket ieee802.15.4 Message-ID: <20160329083732.GA1114@omega> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Mon, Mar 28, 2016 at 10:46:04PM +0700, Adika Bintang Sulaeman wrote: > Dear all linux-wpan developers and users, > > This is my first time exploring 6LoWPAN and I would like to ask you > some questions. Before getting into questions, these are the devices > and set up that I use: > -Raspberry Pi Model B Rev 2 > -Raspbian OS > -kernel from bluetooth-next ver 4.5.0-rc5+ > -MRF24J40MA Transceiver > > After setting up and installing the wpan-tools, I got my interface > work by prompting "ip link show" and there is something like: > > 3: wpan0 mtu 123 qdisc noop state DOWN mode DEFAULT > group default qlen 1000 > link/ieee802.15.4 ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff > > The first thing I notice strange is why after the command "sudo ip > link add link wpan0 name lowpan0 type lowpan" the output in "ip link > show" is a bit different, especially in link/[825]: > > 7: lowpan0 mtu 1280 qdisc noop state DOWN mode > DEFAULT group default qlen 1 > link/[825] ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff > > So this is the FIRST QUESTION: > 1. Is that normal/ok to have link/[825] instead of link/ieee802.15.4? > It's okay. lowpan0 != wpan0 these are different interfaces. It should be link/6lowpan, but this interface type is just too new and iproute2 doesn't know it. That's why it shows the identifier of such type. We need a patch for iproute2: Feel free somebody to submit such patch! I cc jukkar here, because this issue is related to btle 6lowpan also. btw: I didn't test it, just compile. The 6lowpan interface is the same type for 802.15.4 6LoWPAN and BTLE 6loWPAN, see slides [0]. > The second thing I notice strange is after "sudo ip link set wpan0 up" > for both wpan0 and lowpan0, the "ifconfig" command shows that these > network interfaces have "Link encap:UNSPEC". If I'm not mistaken, Link > encap shows the hardware family of the interface, right? > > So the SECOND QUESTION is: > 2. Is that normal/ok to have Link encap:UNSPEC? Because this thing > makes me suspicious about the next problem that I face. > I think this requires a similar fix like above for "ifconfig". It's just eyecandy. Remember: ip > ifconfig, because ifconfig is deprecated. > I tried to run wpan-ping daemon from /wpan-tools/wpan-ping by > prompting "wpan-ping --daemon" but the output is "bind: No such > device". I tried to make my own code to make a server program which > listen to this socket interface. But when binding with bind(), I got > the same error status "No device found". > > This leads to my THIRD QUESTION: > 3. Why "no device found" appears? The transceiver is attached, the > hardware address exists, the interface is up, and I am able to ping > between two devices using ping6. I am suspicious that the problems > that I ask you before have caused this problem. > > Do you know what's wrong here? > Don't know, I never tried the socket interface for 802.15.4. Stefan Schmidt did some stuff there, maybe he can help here. btw: the socket interface need a complete rework/cleanup. [1] What I test is the raw socket interface over AF_PACKET for 802.15.4 interfaces. - Alex [0] http://www.netdevconf.org/1.1/proceedings/slides/aring-generic-6lowpan-branch.pdf [1] https://github.com/linux-wpan/linux-wpan/issues/20 --- To unsubscribe from this list: send the line "unsubscribe linux-wpan" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/lib/ll_types.c b/lib/ll_types.c index 2c5bf8b..6c71c8b 100644 --- a/lib/ll_types.c +++ b/lib/ll_types.c @@ -35,6 +35,7 @@ static const struct { const char *name; } arphrd_names[] = { { 0, "generic" }, +__PF(6LOWPAN,6lowpan) __PF(ETHER,ether) __PF(EETHER,eether) __PF(AX25,ax25)