Lines Matching refs:packet

458 static void do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet)  in do_send_packet()  argument
461 unsigned short data_left = packet->length - packet->offset; in do_send_packet()
466 (packet->fragment_count == 0) in do_send_packet()
477 pkt.hdr_first.protocol = packet->protocol; in do_send_packet()
478 pkt.hdr_first.address = packet->dest_addr; in do_send_packet()
482 if (packet->fragment_count == 0) { in do_send_packet()
484 pkt.hdr_first.length_lsb = (unsigned char) packet->length; in do_send_packet()
486 (unsigned char) (packet->length >> 8); in do_send_packet()
490 ((unsigned char *) packet) + sizeof(struct ipw_tx_packet) + in do_send_packet()
491 packet->offset, fragment_data_len); in do_send_packet()
492 packet->offset += fragment_data_len; in do_send_packet()
493 packet->fragment_count++; in do_send_packet()
496 if (packet->offset == packet->length) in do_send_packet()
501 if (packet->offset < packet->length) { in do_send_packet()
509 list_add(&packet->queue, &hw->tx_queue[0]); in do_send_packet()
513 if (packet->packet_callback) in do_send_packet()
514 packet->packet_callback(packet->callback_data, in do_send_packet()
515 packet->length); in do_send_packet()
516 kfree(packet); in do_send_packet()
555 struct ipw_rx_packet *packet, in pool_allocate() argument
559 if (!packet) { in pool_allocate()
564 packet = list_first_entry(&hw->rx_pool, in pool_allocate()
568 list_del(&packet->queue); in pool_allocate()
579 packet = kmalloc(sizeof(struct ipw_rx_packet) in pool_allocate()
581 if (!packet) in pool_allocate()
583 packet->capacity = new_capacity; in pool_allocate()
585 packet->length = 0; in pool_allocate()
588 if (packet->length + minimum_free_space > packet->capacity) { in pool_allocate()
589 struct ipw_rx_packet *old_packet = packet; in pool_allocate()
591 packet = kmalloc(sizeof(struct ipw_rx_packet) + in pool_allocate()
594 if (!packet) { in pool_allocate()
598 memcpy(packet, old_packet, in pool_allocate()
601 packet->capacity = old_packet->length + minimum_free_space; in pool_allocate()
605 return packet; in pool_allocate()
608 static void pool_free(struct ipw_hardware *hw, struct ipw_rx_packet *packet) in pool_free() argument
611 kfree(packet); in pool_free()
614 list_add(&packet->queue, &hw->rx_pool); in pool_free()
625 struct ipw_rx_packet *packet = NULL; in queue_received_packet() local
661 packet = *assem; in queue_received_packet()
665 hw->rx_bytes_queued += packet->length; in queue_received_packet()
670 packet = pool_allocate(hw, NULL, length); in queue_received_packet()
671 if (!packet) { in queue_received_packet()
676 packet->protocol = protocol; in queue_received_packet()
677 packet->channel_idx = channel_idx; in queue_received_packet()
678 memcpy((unsigned char *)packet + sizeof(struct ipw_rx_packet), in queue_received_packet()
680 packet->length = length; in queue_received_packet()
687 if (packet) { in queue_received_packet()
689 list_add_tail(&packet->queue, &hw->rx_queue); in queue_received_packet()
710 struct ipw_rx_packet *packet = in ipw_receive_data_work() local
716 list_del(&packet->queue); in ipw_receive_data_work()
723 if (packet->protocol == TL_PROTOCOLID_COM_DATA) { in ipw_receive_data_work()
733 packet->channel_idx, in ipw_receive_data_work()
734 (unsigned char *)packet in ipw_receive_data_work()
736 packet->length); in ipw_receive_data_work()
740 hw->rx_bytes_queued -= packet->length; in ipw_receive_data_work()
746 handle_received_CTRL_packet(hw, packet->channel_idx, in ipw_receive_data_work()
747 (unsigned char *)packet in ipw_receive_data_work()
749 packet->length); in ipw_receive_data_work()
751 pool_free(hw, packet); in ipw_receive_data_work()
811 const union nl_packet *packet, in handle_received_packet() argument
814 unsigned int protocol = packet->hdr.protocol; in handle_received_packet()
815 unsigned int address = packet->hdr.address; in handle_received_packet()
819 int is_last = packet->hdr.packet_rank & NL_LAST_PACKET; in handle_received_packet()
821 if (packet->hdr.packet_rank & NL_FIRST_PACKET) in handle_received_packet()
826 data = packet->rawpkt + header_length; in handle_received_packet()
962 struct ipw_tx_packet *packet = NULL; in send_pending_packet() local
967 packet = list_first_entry( in send_pending_packet()
973 list_del(&packet->queue); in send_pending_packet()
978 if (!packet) { in send_pending_packet()
987 do_send_packet(hw, packet); in send_pending_packet()
1237 struct ipw_tx_packet *packet) in send_packet() argument
1242 list_add_tail(&packet->queue, &hw->tx_queue[priority]); in send_packet()
1254 struct ipw_tx_packet *packet = kzalloc( in alloc_data_packet() local
1258 if (!packet) in alloc_data_packet()
1261 INIT_LIST_HEAD(&packet->queue); in alloc_data_packet()
1262 packet->dest_addr = dest_addr; in alloc_data_packet()
1263 packet->protocol = protocol; in alloc_data_packet()
1264 packet->length = data_size; in alloc_data_packet()
1266 return packet; in alloc_data_packet()
1279 struct ipw_control_packet *packet = kzalloc(header_size, GFP_ATOMIC); in alloc_ctrl_packet() local
1281 if (!packet) in alloc_ctrl_packet()
1284 INIT_LIST_HEAD(&packet->header.queue); in alloc_ctrl_packet()
1285 packet->header.dest_addr = dest_addr; in alloc_ctrl_packet()
1286 packet->header.protocol = protocol; in alloc_ctrl_packet()
1287 packet->header.length = header_size - sizeof(struct ipw_tx_packet); in alloc_ctrl_packet()
1288 packet->body.sig_no = sig_no; in alloc_ctrl_packet()
1290 return packet; in alloc_ctrl_packet()
1298 struct ipw_tx_packet *packet; in ipwireless_send_packet() local
1300 packet = alloc_data_packet(length, (channel_idx + 1), in ipwireless_send_packet()
1302 if (!packet) in ipwireless_send_packet()
1304 packet->packet_callback = callback; in ipwireless_send_packet()
1305 packet->callback_data = callback_data; in ipwireless_send_packet()
1306 memcpy((unsigned char *) packet + sizeof(struct ipw_tx_packet), data, in ipwireless_send_packet()
1309 send_packet(hw, PRIO_DATA, packet); in ipwireless_send_packet()
1316 struct ipw_control_packet *packet; in set_control_line() local
1322 packet = alloc_ctrl_packet(sizeof(struct ipw_control_packet), in set_control_line()
1324 if (!packet) in set_control_line()
1326 packet->header.length = sizeof(struct ipw_control_packet_body); in set_control_line()
1327 packet->body.value = (state == 0 ? 0 : 1); in set_control_line()
1328 send_packet(hw, prio, &packet->header); in set_control_line()
1567 struct ipw_setup_reboot_msg_ack *packet; in handle_received_SETUP_packet() local
1571 packet = alloc_ctrl_packet( in handle_received_SETUP_packet()
1575 packet->header.length = in handle_received_SETUP_packet()
1577 send_packet(hw, PRIO_SETUP, &packet->header); in handle_received_SETUP_packet()