From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: "Li, Nami" <nami@qca.qualcomm.com>
Cc: Slawomir Bochenski <lkslawek@gmail.com>,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH obexd] Return correct obex service driver in obex_session_start
Date: Fri, 1 Jul 2011 09:52:19 +0300 [thread overview]
Message-ID: <BANLkTim9SSkDPpaeQbADkFMBobC2nvXiag@mail.gmail.com> (raw)
In-Reply-To: <EC94610F2568494D8D9291885C48D3103D0DC8@nasanexd01a.na.qualcomm.com>
Hi,
On Fri, Jul 1, 2011 at 5:50 AM, Li, Nami <nami@qca.qualcomm.com> wrote:
>
>
> -----Original Message-----
> From: Slawomir Bochenski [mailto:lkslawek@gmail.com]
> Sent: 2011年6月30日 18:26
> To: Li, Nami
> Cc: Luiz Augusto von Dentz; linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH obexd] Return correct obex service driver in obex_session_start
>
> On Thu, Jun 30, 2011 at 12:01 PM, Li, Nami <nami@qca.qualcomm.com> wrote:
>> Well, if the profile is OPP, then you can get correct service driver. But if the profile is FTP, because in ftp.c:
>>
>> static struct obex_service_driver ftp = {
>> .name = "File Transfer server",
>> .service = OBEX_FTP,
>> .channel = FTP_CHANNEL,
>> .psm = FTP_PSM,
>> .record = FTP_RECORD,
>> .target = FTP_TARGET,
>> .target_size = TARGET_SIZE,
>> .connect = ftp_connect,
>> .get = ftp_get,
>> .put = ftp_put,
>> .chkput = ftp_chkput,
>> .setpath = ftp_setpath,
>> .disconnect = ftp_disconnect
>> };
>> It`s target is not null, target_size is 16, so " obex_service_driver_find(server->drivers, NULL,0, NULL, 0)" will return null.
>>
>> And I`m not picking up the first driver in the list, actually it is the only one in the list.
>
> In case of other profiles, there is OBEX connect command required, and then the appropriate driver will be selected in callback for OBEX connect event (see cmd_connect()).
>
> --
> Slawomir Bochenski
>
>
> Yep, you can get right diver after cmd_connect(). But I think user should get correct driver once obex session start, not after connect cmd. What if user want to use driver in obex_session_start() ? I need to use it when add OBEX over L2CAP.
> For OPP, it doesn`t register target and target size in opp.c. So when you call "obex_service_driver_find(server->drivers, NULL, 0, NULL, 0); ", it also returns on first and only list member:
>
> if (memncmp0(target, target_size, driver->target,driver->target_size) == 0) return driver;
> which is actually ===> if (memncmp0(NULL,0, NULL,0) == 0) return driver;
>
>
> So I think my patch is OK.
There is no guarantee that the opp will be the first in the list, nor
that the first driver will have no target which is consider the
default, so Im not sure why you are needing this for OBEX over L2CAP
since you still need to figure out what is the real driver on
connect_cmd. Also the sentence about the obex_session_start having to
get the correct driver makes no sense to me, we only know the target
on connect_cmd so we can only guess on obex_session_start that it is
an OPP session, or do you have a better default? Btw, if you are
planning to match the psm/channel with service driver, I believe that
is not a good idea since on some transports there could be no such
separation e.g. usb.
--
Luiz Augusto von Dentz
next prev parent reply other threads:[~2011-07-01 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 7:34 [PATCH obexd] Return correct obex service driver in obex_session_start Hui Li
2011-06-30 8:24 ` Luiz Augusto von Dentz
2011-06-30 10:01 ` Li, Nami
2011-06-30 10:25 ` Slawomir Bochenski
2011-07-01 2:50 ` Li, Nami
2011-07-01 6:52 ` Luiz Augusto von Dentz [this message]
2011-07-01 7:50 ` Li, Nami
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=BANLkTim9SSkDPpaeQbADkFMBobC2nvXiag@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lkslawek@gmail.com \
--cc=nami@qca.qualcomm.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