public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
@ 2005-08-24  5:45 Youngwoo Park
  2005-08-24  9:56 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Youngwoo Park @ 2005-08-24  5:45 UTC (permalink / raw)
  To: bluez-devel



I apologize my inexperience..

This is unified diff result..


--- linux-2.6.12/net/bluetooth/sco.c 2005-06-18 04:48:29.000000000 +0900
+++ linux-2.6.12-patch/net/bluetooth/sco.c 2005-08-24 14:33:54.517717440
+0900
@@ -234,35 +234,50 @@
return err;
}

+/**
+ * sco_send_frame
+ *
+ * Modified 2005 by Youngwoo Park
+ *
+ * Send large sco frame sequentially even if frame size is larger than MTU
+ *
+ **/
static inline int sco_send_frame(struct sock *sk, struct msghdr *msg,
int len)
{
- struct sco_conn *conn = sco_pi(sk)->conn;
- struct sk_buff *skb;
- int err, count;
+ struct sco_conn *conn = sco_pi(sk)->conn;
+ struct sk_buff *skb;
+ int err, count;

- /* Check outgoing MTU */
- if (len > conn->mtu)
- return -EINVAL;
+ do {

- BT_DBG("sk %p len %d", sk, len);
+ BT_DBG("sk %p len %d", sk, len);

- count = min_t(unsigned int, conn->mtu, len);
- if (!(skb = bt_skb_send_alloc(sk, count, msg->msg_flags &
MSG_DONTWAIT, &err)))
- return err;
+ count = min_t(unsigned int, conn->mtu, len);
+ BT_DBG("sk %p len %d", sk, len);

- if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
- err = -EFAULT;
- goto fail;
- }
+ if (!(skb = bt_skb_send_alloc(sk, count, msg->msg_flags &
MSG_DONTWAIT, &err))) {
+ BT_DBG("Faile to alloc");
+ return err;
+ }
+
+ if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
+ err = -EFAULT;
+ goto fail;
+ }

- if ((err = hci_send_sco(conn->hcon, skb)) < 0)
- goto fail;
+ if ((err = hci_send_sco(conn->hcon, skb)) < 0)
+ goto fail;

- return count;
+ len -= count;
+
+ } while(len > 0);
+
+ return len;

fail:
- kfree_skb(skb);
- return err;
+ BT_DBG("Fail To Send", sk, len);
+ kfree_skb(skb);
+ return err;
}

static inline void sco_recv_frame(struct sco_conn *conn, struct sk_buff
*skb)



If my diff format or coding style still has a problem.
Please, let me give a hint about that.

Thank you.


Regards

Park.

-- 
Youngwoo Park

M.S. Student
CORE(COmputer engineering REsearch) Lab
Dept. EECS, KAIST, Daejeon 305-701, Korea
Phone: +82-42-869-5425 Fax: +82-42-8695425
e-mail: ywpark@core.kaist.ac.kr

--




















-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
  2005-08-24  5:45 Youngwoo Park
@ 2005-08-24  9:56 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-08-24  9:56 UTC (permalink / raw)
  To: bluez-devel

Hi Youngwoo,

> I apologize my inexperience..
> 
> This is unified diff result..

you screwed it up again. When I talk about coding style, I really mean
an indentation with a tab that is 8 characters width. Your code is too
hard to read and so I won't do it.

Regards

Marcel




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
@ 2005-08-25  3:35 Young-woo Park
  2005-08-25 19:11 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Young-woo Park @ 2005-08-25  3:35 UTC (permalink / raw)
  To: bluez-devel; +Cc: ywpark

I'm really apologize my mistake.
The problem was my e-mail sending program.
Of course, I follow up the bluez-coding style.
However the e-mail program sent message as a plain text removing tab!!!
I change my mail server now.


It's all my fault that I don't confirm my message.


Here is my patch..



--- linux-2.6.12/net/bluetooth/sco.c=092005-06-18 04:48:29.000000000 +0900
+++ linux-2.6.12-patch/net/bluetooth/sco.c=092005-08-25 10:58:44.537536256 =
+0900
@@ -234,33 +234,48 @@
 =09return err;
 }
=20
+/**
+ *  sco_send_frame
+ *
+ *  Modified 2005 by Youngwoo Park
+ *
+ *  Send large sco frame sequentially even if frame size is larger than MT=
U
+ *
+ **/
 static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int =
len)
 {
 =09struct sco_conn *conn =3D sco_pi(sk)->conn;
 =09struct sk_buff *skb;
 =09int err, count;
=20
-=09/* Check outgoing MTU */
-=09if (len > conn->mtu)
-=09=09return -EINVAL;
+=09do {
=20
-=09BT_DBG("sk %p len %d", sk, len);
+=09=09BT_DBG("sk %p len %d", sk, len);
=20
-=09count =3D min_t(unsigned int, conn->mtu, len);
-=09if (!(skb =3D bt_skb_send_alloc(sk, count, msg->msg_flags &
MSG_DONTWAIT, &err)))
-=09=09return err;
+=09=09count =3D min_t(unsigned int, conn->mtu, len);
+=09=09BT_DBG("sk %p len %d", sk, len);
=20
-=09if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
-=09=09err =3D -EFAULT;
-=09=09goto fail;
-=09}
+=09=09if (!(skb =3D bt_skb_send_alloc(sk, count, msg->msg_flags &
MSG_DONTWAIT, &err))) {
+=09=09=09BT_DBG("Faile to alloc");
+=09=09=09return err;
+=09=09}
+
+=09=09if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
+=09=09=09err =3D -EFAULT;
+=09=09=09goto fail;
+=09=09}
+
+=09=09if ((err =3D hci_send_sco(conn->hcon, skb)) < 0)
+=09=09=09goto fail;
+
+=09=09len -=3D count;
=20
-=09if ((err =3D hci_send_sco(conn->hcon, skb)) < 0)
-=09=09goto fail;
+=09} while(len > 0);
=20
-=09return count;
+=09return len;
=20
 fail:
+=09BT_DBG("Fail To Send", sk, len);
 =09kfree_skb(skb);
 =09return err;
 }

Regards

Park


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
  2005-08-25  3:35 [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame) Young-woo Park
@ 2005-08-25 19:11 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-08-25 19:11 UTC (permalink / raw)
  To: bluez-devel; +Cc: ywpark

Hi Young-woo,

> Here is my patch..

so the question is, why can't you do the fragmentation inside your
userspace program? I don't see any need to make the kernel deal with it.

Regards

Marcel




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
@ 2005-08-26  3:50 Youngwoo Park
  2005-08-27  3:11 ` Brad Midgley
  0 siblings, 1 reply; 6+ messages in thread
From: Youngwoo Park @ 2005-08-26  3:50 UTC (permalink / raw)
  To: bluez-devel



I used the "btsco" program.
Do you think that "btsco' program is changed to solve my problem?

I think btsco program read data from bluetooth h4 device, and just write
data to bluetooth.
Also, Application has no information about socket and MTU size.
Is it hard to handling data fragmentation in application program?

I think framgmentation is handled by kernel if we need.
Otherwise h4 device driver must guarantee that data frame size is
smaller than MTU.


Regards

Park

-- 
Youngwoo Park

M.S. Student
CORE(COmputer engineering REsearch) Lab
Dept. EECS, KAIST, Daejeon 305-701, Korea
Phone: +82-42-869-5425 Fax: +82-42-8695425
e-mail: ywpark@core.kaist.ac.kr

--




















-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame)
  2005-08-26  3:50 Youngwoo Park
@ 2005-08-27  3:11 ` Brad Midgley
  0 siblings, 0 replies; 6+ messages in thread
From: Brad Midgley @ 2005-08-27  3:11 UTC (permalink / raw)
  To: bluez-devel

Youngwoo

> I used the "btsco" program.
> Do you think that "btsco' program is changed to solve my problem?
> 
> I think btsco program read data from bluetooth h4 device, and just write
> data to bluetooth.
> Also, Application has no information about socket and MTU size.
> Is it hard to handling data fragmentation in application program?
> 
> I think framgmentation is handled by kernel if we need.
> Otherwise h4 device driver must guarantee that data frame size is
> smaller than MTU.

When does this fragmentation problem show up? btsco is not doing
anything special so we expect the kernel to take care of it...

Brad


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-27  3:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-25  3:35 [Bluez-devel] Re: Re: Bluetooth SCO message sending (sco_send_frame) Young-woo Park
2005-08-25 19:11 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2005-08-26  3:50 Youngwoo Park
2005-08-27  3:11 ` Brad Midgley
2005-08-24  5:45 Youngwoo Park
2005-08-24  9:56 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox