From: Marcel Holtmann <marcel@holtmann.org>
To: "Sjur Brændeland" <sjur.brandeland@stericsson.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
stefano.babic@babic.homelinux.org, randy.dunlap@oracle.com
Subject: RE: [PATCH net-next-2.6 02/13] net-caif: add CAIF header files
Date: Fri, 22 Jan 2010 09:39:02 +0100 [thread overview]
Message-ID: <1264149542.3469.8.camel@violet> (raw)
In-Reply-To: <61D8D34BB13CFE408D154529C120E07903231FED@eseldmw101.eemea.ericsson.se>
Hi Sjur,
> >> +/**
> >> + * struct sockaddr_caif - the sockaddr structure for CAIF sockets.
> >> + * @u: Union of address data 'switched' by familty.
> >> + * @at: Applies when family = CAIFPROTO_AT.
> >> + * @at.type: Type of AT link to set up (enum caif_at_type).
> >> + * @util: Applies when family = CAIFPROTO_UTIL
> >> + * @util.service: Service name.
> >> + * @dgm: Applies when family = CAIFPROTO_DATAGRAM
> >> + * @dgm.connection_id: Datagram connection id.
> >> + * @dgm.nsapi: NSAPI of the PDP-Context.
> >> + * @rfm: Applies when family = CAIFPROTO_RFM
> >> + * @rfm.connection_id: Connection ID for RFM.
> >> + * @rfm.volume: Volume to mount.
> >> + */
> >> +struct sockaddr_caif {
> >> + sa_family_t family;
> >> + union {
> >> + struct {
> >> + u_int8_t type; /* type: enum caif_at_type */
> >> + } at; /* CAIFPROTO_AT */
> >> + struct {
> >> + char service[16];
> >> + } util; /* CAIFPROTO_UTIL */
> >> + union {
> >> + u_int32_t connection_id;
> >> + u_int8_t nsapi;
> >> + } dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/
> >> + struct {
> >> + u_int32_t connection_id;
> >> + char volume[16];
> >> + } rfm; /* CAIFPROTO_RFM */
> >> + } u;
> >> +};
> >
> > as mentioned on the oFono mailing list, what is the right procedure
> > to select a local CAIF device for usage with doing bing(). The use
> > case I am thinking of is that you have multiple CAIF device attached
> > to the same system. Think of desktops with USB or even Dual-SIM
> > phones. Before we set the API in stone, we need to have a way o bind
> > the socket to a specific device. Maybe it is possible, but I am
> > missing it.
>
> The CAIF interface can be selected by using the following types:
> [snip caif_config.h]
> /**
> * enum caif_phy_preference - Types of physical HW interfaces
> * towards modem defined in CAIF stack
> * @CAIF_PHYPREF_UNSPECIFIED: Default physical interface
> * @CAIF_PHYPREF_LOW_LAT: Default physical interface for low-latency
> * traffic
> * @CAIF_PHYPREF_HIGH_BW: Default physical interface for high-bandwidth
> * traffic
> * @CAIF_PHYPREF_LOOP: TEST Loopback interface, simulating modem
> * responses
> *
> * For client convenience, two special types are defined:
> * CAIF_PHYPREF_LOW_LAT is the preferred low-latency physical link.
> * Typically used for "control" purposes.
> * CAIF_PHYPREF_HIGH_BW is the preferred high-bandwidth physical link.
> * Typically used for "payload" purposes.
> */
> ...
> enum caif_phy_preference {
> CAIF_PHYPREF_UNSPECIFIED,
> CAIF_PHYPREF_LOW_LAT,
> CAIF_PHYPREF_HIGH_BW,
> CAIF_PHYPREF_LOOP
> };
> [snip caif_socket.h]
> ...
> /**
> * struct caif_channel_opt - CAIF channel connect options.
> * @priority: Priority of the channel (between 0 and 0x1f)
> * @link_selector: Selector for the physical link.
> * (see enum caif_phy_preference in caif_config.h)
> * @link_name: Physical link to use. This is the instance name of the
> * CAIF Physical Driver.
> */
> struct caif_channel_opt {
> u_int16_t priority;
> u_int16_t link_selector;
> char link_name[16];
> };
> ...
> /** enum caif_socket_opts - CAIF option values for getsockopt and setsockopt
> * @CAIFSO_CHANNEL: Used to set the connect options on a CAIF
> * socket. (struct caif_config_opt). This can only
> * be set before connecting.
> [end snip]
>
> CAIFSO_CHANNEL is used for specifying the physical interface to use for the
> CAIF Channel. You can select the type of interface to use
> by setting link_selector:
> CAIF_PHYPREF_LOW_LAT will typically be used for AT (or other control traffic),
> and CAIF_PHYPREF_HIGH_BW for IP traffic.
> When the CAIF interfaces registers itself it will inform about their type,
> (low-latency or high-bandwidth). This approach assumes that you have only one
> modem, but multiple links to it (e.g. USB and UART).
>
> But you can also specify interface by name using link_name. In this case
> you specify the name of the interface to use. I think this would support
> your use case with multiple modems attached.
sounds good, but why using a socket option and not allowing to just use
bind(). Maybe it is just my personal preference, because I am used to do
it like this for TCP and Bluetooth.
Regards
Marcel
next prev parent reply other threads:[~2010-01-22 8:38 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 22:55 [PATCH net-next-2.6 00/13] net-caif: introducing CAIF protocol stack sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 01/13] net-caif: add CAIF protocol definitions sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 02/13] net-caif: add CAIF header files sjur.brandeland
2010-01-20 23:27 ` Randy Dunlap
2010-01-22 11:05 ` Sjur Brændeland
2010-01-21 7:44 ` Patrick McHardy
2010-01-22 10:53 ` Sjur Brændeland
2010-01-22 7:51 ` Marcel Holtmann
2010-01-22 8:18 ` Sjur Brændeland
2010-01-22 8:39 ` Marcel Holtmann [this message]
2010-01-22 8:56 ` Sjur Brændeland
2010-01-22 9:16 ` Marcel Holtmann
2010-01-22 9:43 ` Sjur Brændeland
2010-01-20 22:55 ` [PATCH net-next-2.6 03/13] net-caif: add CAIF generic protocol stack " sjur.brandeland
2010-01-21 8:13 ` Patrick McHardy
2010-01-22 11:02 ` Sjur Brændeland
2010-01-22 9:28 ` Marcel Holtmann
2010-01-22 10:01 ` Sjur Brændeland
2010-01-22 10:12 ` Marcel Holtmann
2010-01-22 10:16 ` Sjur Brændeland
2010-01-22 10:24 ` Marcel Holtmann
2010-01-20 22:55 ` [PATCH net-next-2.6 04/13] net-caif: add CAIF " sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 05/13] net-caif: add CAIF generic protocol stack sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 06/13] net-caif: add CAIF generic caif support functions sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 07/13] net-caif: add CAIF device registration functionality sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 08/13] net-caif: add CAIF socket implementation sjur.brandeland
2010-01-20 22:55 ` [PATCH net-next-2.6 09/13] net-caif: add CAIF netdevice sjur.brandeland
2010-01-21 8:03 ` Patrick McHardy
2010-02-02 12:37 ` Sjur Brændeland
2010-02-02 14:14 ` Marcel Holtmann
2010-02-02 14:19 ` Patrick McHardy
2010-02-02 14:17 ` Patrick McHardy
2010-01-20 22:55 ` [PATCH net-next-2.6 10/13] net-caif: add kernel-client API for CAIF sjur.brandeland
2010-01-26 17:50 ` Randy Dunlap
2010-01-26 19:56 ` Sjur Brændeland
2010-01-20 22:55 ` [PATCH net-next-2.6 11/13] net-caif: add CAIF Kconfig and Makefiles sjur.brandeland
2010-01-22 9:40 ` Marcel Holtmann
2010-01-20 22:55 ` [PATCH net-next-2.6 13/13] net-caif-driver: add CAIF serial driver (ldisc) sjur.brandeland
2010-01-20 23:36 ` Randy Dunlap
2010-01-22 11:07 ` Sjur Brændeland
2010-01-22 9:21 ` Marcel Holtmann
2010-01-22 9:56 ` Sjur Brændeland
2010-01-22 10:07 ` Marcel Holtmann
2010-01-22 9:43 ` [PATCH net-next-2.6 00/13] net-caif: introducing CAIF protocol stack Marcel Holtmann
2010-01-22 10:11 ` Sjur Brændeland
2010-01-22 10:19 ` Marcel Holtmann
[not found] ` <1264028130-14364-13-git-send-email-sjur.brandeland@stericsson.com>
2010-01-26 18:00 ` [PATCH net-next-2.6 12/13] net-caif: add CAIF documentation Randy Dunlap
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=1264149542.3469.8.camel@violet \
--to=marcel@holtmann.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=sjur.brandeland@stericsson.com \
--cc=stefano.babic@babic.homelinux.org \
/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