#include <linux/cyclomx.h> /* Cyclom 2X common user API definitions */
#include <linux/cycx_x25.h> /* X.25 firmware API definitions */
+#include <net/x25device.h>
+
/* Defines & Macros */
#define CYCX_X25_MAX_CMD_RETRY 5
#define CYCX_X25_CHAN_MTU 2048 /* unfragmented logical channel MTU */
reset_timer(struct net_device *dev);
static u8 bps_to_speed_code(u32 bps);
-static u8 log2(u32 n);
+static u8 cycx_log2(u32 n);
static unsigned dec_to_uint(u8 *str, int len);
/* Initialize protocol-specific fields */
card->mbox = card->hw.dpmbase + X25_MBOX_OFFS;
card->u.x.connection_keys = 0;
- card->u.x.lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&card->u.x.lock);
/* Configure adapter. Here we set reasonable defaults, then parse
* device configuration structure and set configuration options.
else
card->wandev.mtu = 64;
- cfg.pktlen = log2(card->wandev.mtu);
+ cfg.pktlen = cycx_log2(card->wandev.mtu);
if (conf->station == WANOPT_DTE) {
cfg.locaddr = 3; /* DTE */
remotelen = strlen(chan->addr);
u8 key;
- if (card->u.x.connection_keys == ~0UL) {
+ if (card->u.x.connection_keys == ~0U) {
printk(KERN_INFO "%s: too many simultaneous connection "
"requests!\n", card->devname);
return -EAGAIN;
ptr = skb_put(skb, 1);
*ptr = event;
- skb->dev = dev;
- skb->protocol = htons(ETH_P_X25);
- skb->mac.raw = skb->data;
- skb->pkt_type = PACKET_HOST;
-
+ skb->protocol = x25_type_trans(skb, dev);
netif_rx(skb);
dev->last_rx = jiffies; /* timestamp */
}
}
/* log base 2 */
-static u8 log2(u32 n)
+static u8 cycx_log2(u32 n)
{
u8 log = 0;