@@ -212,7 +212,7 @@ static void process_unack(struct h5_data *h5)
212212 LOG_DBG ("Need to remove %u packet from the queue" , number_removed );
213213
214214 while (number_removed ) {
215- struct net_buf * buf = net_buf_get (& h5 -> unack_queue , K_NO_WAIT );
215+ struct net_buf * buf = k_fifo_get (& h5 -> unack_queue , K_NO_WAIT );
216216
217217 if (!buf ) {
218218 LOG_ERR ("Unack queue is empty" );
@@ -349,22 +349,22 @@ static void retx_timeout(struct k_work *work)
349349 k_fifo_init (& tmp_queue );
350350
351351 /* Queue to temporary queue */
352- while ((buf = net_buf_get (& h5 -> tx_queue , K_NO_WAIT ))) {
353- net_buf_put (& tmp_queue , buf );
352+ while ((buf = k_fifo_get (& h5 -> tx_queue , K_NO_WAIT ))) {
353+ k_fifo_put (& tmp_queue , buf );
354354 }
355355
356356 /* Queue unack packets to the beginning of the queue */
357- while ((buf = net_buf_get (& h5 -> unack_queue , K_NO_WAIT ))) {
357+ while ((buf = k_fifo_get (& h5 -> unack_queue , K_NO_WAIT ))) {
358358 /* include also packet type */
359359 net_buf_push (buf , sizeof (uint8_t ));
360- net_buf_put (& h5 -> tx_queue , buf );
360+ k_fifo_put (& h5 -> tx_queue , buf );
361361 h5 -> tx_seq = (h5 -> tx_seq - 1 ) & 0x07 ;
362362 h5 -> unack_queue_len -- ;
363363 }
364364
365365 /* Queue saved packets from temp queue */
366- while ((buf = net_buf_get (& tmp_queue , K_NO_WAIT ))) {
367- net_buf_put (& h5 -> tx_queue , buf );
366+ while ((buf = k_fifo_get (& tmp_queue , K_NO_WAIT ))) {
367+ k_fifo_put (& h5 -> tx_queue , buf );
368368 }
369369 }
370370}
@@ -408,7 +408,7 @@ static void h5_process_complete_packet(const struct device *dev, uint8_t *hdr)
408408 net_buf_unref (buf );
409409 break ;
410410 case HCI_3WIRE_LINK_PKT :
411- net_buf_put (& h5 -> rx_queue , buf );
411+ k_fifo_put (& h5 -> rx_queue , buf );
412412 break ;
413413 case HCI_EVENT_PKT :
414414 case HCI_ACLDATA_PKT :
@@ -619,7 +619,7 @@ static int h5_queue(const struct device *dev, struct net_buf *buf)
619619
620620 memcpy (net_buf_push (buf , sizeof (type )), & type , sizeof (type ));
621621
622- net_buf_put (& h5 -> tx_queue , buf );
622+ k_fifo_put (& h5 -> tx_queue , buf );
623623
624624 return 0 ;
625625}
@@ -653,15 +653,15 @@ static void tx_thread(void *p1, void *p2, void *p3)
653653 k_sleep (K_MSEC (100 ));
654654 break ;
655655 case ACTIVE :
656- buf = net_buf_get (& h5 -> tx_queue , K_FOREVER );
656+ buf = k_fifo_get (& h5 -> tx_queue , K_FOREVER );
657657 type = h5_get_type (buf );
658658
659659 h5_send (dev , buf -> data , type , buf -> len );
660660
661661 /* buf is dequeued from tx_queue and queued to unack
662662 * queue.
663663 */
664- net_buf_put (& h5 -> unack_queue , buf );
664+ k_fifo_put (& h5 -> unack_queue , buf );
665665 h5 -> unack_queue_len ++ ;
666666
667667 k_work_reschedule (& h5 -> retx_work , H5_TX_ACK_TIMEOUT );
@@ -689,7 +689,7 @@ static void rx_thread(void *p1, void *p2, void *p3)
689689 while (true) {
690690 struct net_buf * buf ;
691691
692- buf = net_buf_get (& h5 -> rx_queue , K_FOREVER );
692+ buf = k_fifo_get (& h5 -> rx_queue , K_FOREVER );
693693
694694 hexdump ("=> " , buf -> data , buf -> len );
695695
0 commit comments