patch-1.3.68 linux/net/ax25/ax25_subr.c

Next file: linux/net/ax25/ax25_timer.c
Previous file: linux/net/ax25/ax25_route.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.67/linux/net/ax25/ax25_subr.c linux/net/ax25/ax25_subr.c
@@ -25,7 +25,7 @@
  *					Added fragmentation support.
  *			Darryl(G7LED)	Added function ax25_requeue_frames() to split
  *					it up from ax25_frames_acked().
- *			Joerg(DL1BKE)	DAMA needs KISS Fullduplex ON/OFF.
+ *	AX.25 031	Joerg(DL1BKE)	DAMA needs KISS Fullduplex ON/OFF.
  *					Thus we have ax25_kiss_cmd() now... ;-)
  *			Dave Brown(N2RJT)
  *					Killed a silly bug in the DAMA code.
@@ -360,8 +360,7 @@
 	digi->lastrepeat = -1;
 	digi->ndigi      = 0;
 	
-	while (!(buf[-1] & LAPB_E))
-	{
+	while (!(buf[-1] & LAPB_E)) {
 		if (d >= AX25_MAX_DIGIS)  return NULL;	/* Max of 6 digis */
 		if (len < 7) return NULL;	/* Short packet */
 
@@ -473,7 +472,16 @@
 	out->lastrepeat = 0;
 }
 
-void ax25_kiss_cmd(ax25_cb * ax25, unsigned char cmd, unsigned char param)
+/*
+ *	:::FIXME:::
+ *	This is ****NOT**** the right approach. Not all drivers do kiss. We
+ *	need a driver level request to switch duplex mode, that does either
+ *	SCC changing, PI config or KISS as required.
+ *
+ *	Not to mention this request isnt currently reliable.
+ */
+ 
+void ax25_kiss_cmd(ax25_cb *ax25, unsigned char cmd, unsigned char param)
 {
 	struct sk_buff *skb;
 	unsigned char *p;
@@ -487,8 +495,7 @@
 	skb->free = 1;
 	skb->arp = 1;
 	
-	if (ax25->sk != NULL)
-	{
+	if (ax25->sk != NULL) {
 		skb->sk = ax25->sk;
 		ax25->sk->wmem_alloc += skb->truesize;
 	}
@@ -507,10 +514,9 @@
 {
 	int count = ax25_dev_is_dama_slave(ax25->device);
 
-	if (count == 0)
-	{
-		if (ax25->sk && ax25->sk->debug)
-			printk("DAMA on\n");
+	if (count == 0) {
+		if (ax25->sk != NULL && ax25->sk->debug)
+			printk("ax25_dama_on: DAMA on\n");
 		ax25_kiss_cmd(ax25, 5, 1);
 	}
 }
@@ -519,11 +525,9 @@
 {
 	int count = ax25_dev_is_dama_slave(ax25->device);
 	
-	
-	if (count == 0)
-	{
-		if (ax25->sk && ax25->sk->debug)
-			printk("DAMA off\n");
+	if (count == 0) {
+		if (ax25->sk != NULL && ax25->sk->debug)
+			printk("ax25_dama_off: DAMA off\n");
 		ax25_kiss_cmd(ax25, 5, 0);
 	}
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this