[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bluetooth-dev] ask about about hci.c



Hi,
In the hci.c of OpenBT, there is the following code:
void
send_cmd_queue(void)
{
   cmd_t *tmp = NULL;
 
   D_CTRL(__FUNCTION__ ": start: Num_HCI_Command_Packets=%d\n",
         hci_ctrl.hc_buf.cmd_num);

   cli();
   while ((hci_ctrl.hc_buf.cmd_num > 0)
          && ((tmp = get_next_cmd()) != NULL)) {
       sti();
 
       PRINTPKT(__FUNCTION__ ": ", tmp->data, tmp->len);
       /* more in queue and we can send */
#ifdef HCI_EMULATION
       hci_emulator(tmp->data, tmp->len);
#else
       bt_write_lower_driver(tmp->data, tmp->len);
#endif
       kfree(tmp->data);
       tmp->data = NULL;

       cli();
       hci_ctrl.hc_buf.cmd_num--;
   }
   sti();
  
   D_CTRL(__FUNCTION__ ": end : %d cmds left in queue\n", cmd_buf.count);

   /*FIXME: this should really be fixed...*/
   /*why execute these? */
   if (hci_ctrl.hc_buf.cmd_num > 0) {
       wake_up_interruptible(&set_baudrate_wq);
   }
}

I don't undertand the last lines, that is if (hci_ctrl.hc_buf.cmd_num > 0) {
       wake_up_interruptible(&set_baudrate_wq);
   }

Who can explain it to me? And if need modification , how to do?

Thanks a lot.

-- 
Subing Zhang

-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com