Return-Path: Message-ID: <430D2B3B.3090106@core.kaist.ac.kr> From: Youngwoo Park MIME-Version: 1.0 To: bluez-devel@lists.sourceforge.net Content-Type: text/html; charset=EUC-KR Subject: [Bluez-devel] Re: Re: Re: Bluetooth SCO message sending (sco_send_frame) Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Thu, 25 Aug 2005 11:21:47 +0900

I 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!!!
It's all my fault.

Thank you very much for eveyone who point out my mistake :)


Here is my patch..



--- 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-25 10:58:44.537536256 +0900
@@ -234,33 +234,48 @@
        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;

-       /* 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;
+
+               len -= count;

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

-       return count;
+       return len;

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


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