diff options
Diffstat (limited to 'net/lapb/lapb_iface.c')
| -rw-r--r-- | net/lapb/lapb_iface.c | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index 956b7e47dc52..3cdaa046c1bc 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | * 2000-10-29 Henner Eisen lapb_data_indication() return status. | 15 | * 2000-10-29 Henner Eisen lapb_data_indication() return status. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 19 | |||
| 18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 19 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 20 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| @@ -32,7 +34,6 @@ | |||
| 32 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 33 | #include <net/sock.h> | 35 | #include <net/sock.h> |
| 34 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
| 35 | #include <asm/system.h> | ||
| 36 | #include <linux/fcntl.h> | 37 | #include <linux/fcntl.h> |
| 37 | #include <linux/mm.h> | 38 | #include <linux/mm.h> |
| 38 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
| @@ -139,7 +140,8 @@ out: | |||
| 139 | return lapb; | 140 | return lapb; |
| 140 | } | 141 | } |
| 141 | 142 | ||
| 142 | int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks) | 143 | int lapb_register(struct net_device *dev, |
| 144 | const struct lapb_register_struct *callbacks) | ||
| 143 | { | 145 | { |
| 144 | struct lapb_cb *lapb; | 146 | struct lapb_cb *lapb; |
| 145 | int rc = LAPB_BADTOKEN; | 147 | int rc = LAPB_BADTOKEN; |
| @@ -158,7 +160,7 @@ int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks | |||
| 158 | goto out; | 160 | goto out; |
| 159 | 161 | ||
| 160 | lapb->dev = dev; | 162 | lapb->dev = dev; |
| 161 | lapb->callbacks = *callbacks; | 163 | lapb->callbacks = callbacks; |
| 162 | 164 | ||
| 163 | __lapb_insert_cb(lapb); | 165 | __lapb_insert_cb(lapb); |
| 164 | 166 | ||
| @@ -279,9 +281,7 @@ int lapb_connect_request(struct net_device *dev) | |||
| 279 | 281 | ||
| 280 | lapb_establish_data_link(lapb); | 282 | lapb_establish_data_link(lapb); |
| 281 | 283 | ||
| 282 | #if LAPB_DEBUG > 0 | 284 | lapb_dbg(0, "(%p) S0 -> S1\n", lapb->dev); |
| 283 | printk(KERN_DEBUG "lapb: (%p) S0 -> S1\n", lapb->dev); | ||
| 284 | #endif | ||
| 285 | lapb->state = LAPB_STATE_1; | 285 | lapb->state = LAPB_STATE_1; |
| 286 | 286 | ||
| 287 | rc = LAPB_OK; | 287 | rc = LAPB_OK; |
| @@ -305,12 +305,8 @@ int lapb_disconnect_request(struct net_device *dev) | |||
| 305 | goto out_put; | 305 | goto out_put; |
| 306 | 306 | ||
| 307 | case LAPB_STATE_1: | 307 | case LAPB_STATE_1: |
| 308 | #if LAPB_DEBUG > 1 | 308 | lapb_dbg(1, "(%p) S1 TX DISC(1)\n", lapb->dev); |
| 309 | printk(KERN_DEBUG "lapb: (%p) S1 TX DISC(1)\n", lapb->dev); | 309 | lapb_dbg(0, "(%p) S1 -> S0\n", lapb->dev); |
| 310 | #endif | ||
| 311 | #if LAPB_DEBUG > 0 | ||
| 312 | printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->dev); | ||
| 313 | #endif | ||
| 314 | lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND); | 310 | lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND); |
| 315 | lapb->state = LAPB_STATE_0; | 311 | lapb->state = LAPB_STATE_0; |
| 316 | lapb_start_t1timer(lapb); | 312 | lapb_start_t1timer(lapb); |
| @@ -329,12 +325,8 @@ int lapb_disconnect_request(struct net_device *dev) | |||
| 329 | lapb_stop_t2timer(lapb); | 325 | lapb_stop_t2timer(lapb); |
| 330 | lapb->state = LAPB_STATE_2; | 326 | lapb->state = LAPB_STATE_2; |
| 331 | 327 | ||
| 332 | #if LAPB_DEBUG > 1 | 328 | lapb_dbg(1, "(%p) S3 DISC(1)\n", lapb->dev); |
| 333 | printk(KERN_DEBUG "lapb: (%p) S3 DISC(1)\n", lapb->dev); | 329 | lapb_dbg(0, "(%p) S3 -> S2\n", lapb->dev); |
| 334 | #endif | ||
| 335 | #if LAPB_DEBUG > 0 | ||
| 336 | printk(KERN_DEBUG "lapb: (%p) S3 -> S2\n", lapb->dev); | ||
| 337 | #endif | ||
| 338 | 330 | ||
| 339 | rc = LAPB_OK; | 331 | rc = LAPB_OK; |
| 340 | out_put: | 332 | out_put: |
| @@ -380,32 +372,32 @@ int lapb_data_received(struct net_device *dev, struct sk_buff *skb) | |||
| 380 | 372 | ||
| 381 | void lapb_connect_confirmation(struct lapb_cb *lapb, int reason) | 373 | void lapb_connect_confirmation(struct lapb_cb *lapb, int reason) |
| 382 | { | 374 | { |
| 383 | if (lapb->callbacks.connect_confirmation) | 375 | if (lapb->callbacks->connect_confirmation) |
| 384 | lapb->callbacks.connect_confirmation(lapb->dev, reason); | 376 | lapb->callbacks->connect_confirmation(lapb->dev, reason); |
| 385 | } | 377 | } |
| 386 | 378 | ||
| 387 | void lapb_connect_indication(struct lapb_cb *lapb, int reason) | 379 | void lapb_connect_indication(struct lapb_cb *lapb, int reason) |
| 388 | { | 380 | { |
| 389 | if (lapb->callbacks.connect_indication) | 381 | if (lapb->callbacks->connect_indication) |
| 390 | lapb->callbacks.connect_indication(lapb->dev, reason); | 382 | lapb->callbacks->connect_indication(lapb->dev, reason); |
| 391 | } | 383 | } |
| 392 | 384 | ||
| 393 | void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason) | 385 | void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason) |
| 394 | { | 386 | { |
| 395 | if (lapb->callbacks.disconnect_confirmation) | 387 | if (lapb->callbacks->disconnect_confirmation) |
| 396 | lapb->callbacks.disconnect_confirmation(lapb->dev, reason); | 388 | lapb->callbacks->disconnect_confirmation(lapb->dev, reason); |
| 397 | } | 389 | } |
| 398 | 390 | ||
| 399 | void lapb_disconnect_indication(struct lapb_cb *lapb, int reason) | 391 | void lapb_disconnect_indication(struct lapb_cb *lapb, int reason) |
| 400 | { | 392 | { |
| 401 | if (lapb->callbacks.disconnect_indication) | 393 | if (lapb->callbacks->disconnect_indication) |
| 402 | lapb->callbacks.disconnect_indication(lapb->dev, reason); | 394 | lapb->callbacks->disconnect_indication(lapb->dev, reason); |
| 403 | } | 395 | } |
| 404 | 396 | ||
| 405 | int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb) | 397 | int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb) |
| 406 | { | 398 | { |
| 407 | if (lapb->callbacks.data_indication) | 399 | if (lapb->callbacks->data_indication) |
| 408 | return lapb->callbacks.data_indication(lapb->dev, skb); | 400 | return lapb->callbacks->data_indication(lapb->dev, skb); |
| 409 | 401 | ||
| 410 | kfree_skb(skb); | 402 | kfree_skb(skb); |
| 411 | return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */ | 403 | return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */ |
| @@ -415,8 +407,8 @@ int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *skb) | |||
| 415 | { | 407 | { |
| 416 | int used = 0; | 408 | int used = 0; |
| 417 | 409 | ||
| 418 | if (lapb->callbacks.data_transmit) { | 410 | if (lapb->callbacks->data_transmit) { |
| 419 | lapb->callbacks.data_transmit(lapb->dev, skb); | 411 | lapb->callbacks->data_transmit(lapb->dev, skb); |
| 420 | used = 1; | 412 | used = 1; |
| 421 | } | 413 | } |
| 422 | 414 | ||
