/*********************************************************************
*
* Filename: irlap_frame.c
* Version: 1.0
* Description: Build and transmit IrLAP frames
* Status: Stable
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Aug 19 10:27:26 1997
* Modified at: Wed Jan 5 08:59:04 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-2000 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
* Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Neither Dag Brattli nor University of Tromsø admit liability nor
* provide warranty for any of this software. This material is
* provided "AS-IS" and at no charge.
*
********************************************************************/
#include <linux/skbuff.h>
#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/netdevice.h>
#include <linux/irda.h>
#include <linux/slab.h>
#include <net/pkt_sched.h>
#include <net/sock.h>
#include <asm/byteorder.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h>
#include <net/irda/irlap.h>
#include <net/irda/wrapper.h>
#include <net/irda/timer.h>
#include <net/irda/irlap_frame.h>
#include <net/irda/qos.h>
static void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb,
int command);
/*
* Function irlap_insert_info (self, skb)
*
* Insert minimum turnaround time and speed information into the skb. We
* need to do this since it's per packet relevant information. Safe to
* have this function inlined since it's only called from one place
*/
static inline void irlap_insert_info(struct irlap_cb *self,
struct sk_buff *skb)
{
struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb;
/*
* Insert MTT (min. turn time) and speed into skb, so that the
* device driver knows which settings to use
*/
cb->magic = LAP_MAGIC;
cb->mtt = self->mtt_required;
cb->next_speed = self->speed;
/* Reset */
self->mtt_required =