6pack.c-2.4.0-test12-pre7-patch-v1

From: Hans Grobler (zufqubzv.fhzbnx@kindredhealthcare.com)
Date: Sat Dec 09 2000 - 16:01:35 EET

  • Next message: Bill Vodall: "Re: Questions re pseudo-ports"

    6pack.c-2.4.0-test12-pre7-patch-v1:
      - sp_open: removed comment about cbuf (accidently copied from slip.c)
      - sp_set_mac_address,sixpack_ioctl: converted to linux2.4 to/from
          userspace functions
      - sp_set_mac_address,sixpack_init,sixpack_decode,decode_std_command,
          decode_data: made static functions

    diff -u3Nr -X dontdiff linux-2.4.0-test12-pre7.orig/drivers/net/hamradio/6pack.c linux-2.4.0-test12-pre7/drivers/net/hamradio/6pack.c
    --- linux-2.4.0-test12-pre7.orig/drivers/net/hamradio/6pack.c Thu May 4 20:31:21 2000
    +++ linux-2.4.0-test12-pre7/drivers/net/hamradio/6pack.c Sat Dec 9 09:42:57 2000
    @@ -391,7 +391,6 @@
              *
              * rbuff Receive buffer.
              * xbuff Transmit buffer.
    - * cbuff Temporary compression buffer.
              */

             /* !!! length of the buffers. MTU is IP MTU, not PACLEN!
    @@ -603,19 +602,10 @@
     }

    -int
    +static int
     sp_set_mac_address(struct net_device *dev, void *addr)
     {
    - int err;
    -
    - err = verify_area(VERIFY_READ, addr, AX25_ADDR_LEN);
    - if (err) {
    - return err;
    - }
    -
    - copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN); /* addr is an AX.25 shifted ASCII mac address */
    -
    - return 0;
    + return copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN) ? -EFAULT : 0;
     }

     static int
    @@ -632,7 +622,6 @@
     sixpack_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
     {
             struct sixpack *sp = (struct sixpack *) tty->disc_data;
    - int err;
             unsigned int tmp;

             /* First make sure we're connected. */
    @@ -642,29 +631,16 @@

             switch(cmd) {
              case SIOCGIFNAME:
    - err = verify_area(VERIFY_WRITE, arg, strlen(sp->dev->name) + 1);
    - if (err) {
    - return err;
    - }
    - copy_to_user(arg, sp->dev->name, strlen(sp->dev->name) + 1);
    - return 0;
    + return copy_to_user(arg, sp->dev->name, strlen(sp->dev->name) + 1) ? -EFAULT : 0;

             case SIOCGIFENCAP:
    - err = verify_area(VERIFY_WRITE, arg, sizeof(int));
    - if (err) {
    - return err;
    - }
    - put_user(0, (int *)arg);
    - return 0;
    + return put_user(0, (int *)arg);

             case SIOCSIFENCAP:
    - err = verify_area(VERIFY_READ, arg, sizeof(int));
    - if (err) {
    - return err;
    - }
    - get_user(tmp,(int *)arg);
    + if (get_user(tmp, (int *) arg))
    + return -EFAULT;

    - sp->mode = tmp;
    + sp->mode = tmp;
                     sp->dev->addr_len = AX25_ADDR_LEN; /* sizeof an AX.25 addr */
                     sp->dev->hard_header_len = AX25_KISS_HEADER_LEN + AX25_MAX_HEADER_LEN + 3;
                     sp->dev->type = ARPHRD_AX25;
    @@ -768,7 +744,7 @@

     /* Initialize the 6pack driver. Called by DDI. */
    -int
    +static int
     sixpack_init(struct net_device *dev)
     {
             struct sixpack *sp = (struct sixpack*)(dev->priv);
    @@ -832,7 +808,7 @@

     /* encode an AX.25 packet into 6pack */

    -int encode_sixpack(byte *tx_buf, byte *tx_buf_raw, int length, byte tx_delay)
    +static int encode_sixpack(byte *tx_buf, byte *tx_buf_raw, int length, byte tx_delay)
     {
             int count = 0;
             byte checksum = 0, buf[400];
    @@ -873,7 +849,7 @@

     /* decode a 6pack packet */

    -void
    +static void
     sixpack_decode(struct sixpack *sp, unsigned char pre_rbuff[], int count)
     {
             byte inbyte;
    @@ -917,7 +893,7 @@

     /* identify and execute a 6pack priority command byte */

    -void decode_prio_command(byte cmd, struct sixpack *sp)
    +static void decode_prio_command(byte cmd, struct sixpack *sp)
     {
             byte channel;
             int actual;
    @@ -1016,7 +992,7 @@

     /* identify and execute a standard 6pack command byte */

    -void decode_std_command(byte cmd, struct sixpack *sp)
    +static void decode_std_command(byte cmd, struct sixpack *sp)
     {
             byte checksum = 0, rest = 0, channel;
             short i;
    @@ -1064,7 +1040,7 @@

     /* decode 4 sixpack-encoded bytes into 3 data bytes */

    -void decode_data(byte inbyte, struct sixpack *sp)
    +static void decode_data(byte inbyte, struct sixpack *sp)
     {

             unsigned char *buf;

    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to supbslht.ynamwkuw@spiegel.de



    This archive was generated by hypermail 2b30 : Sat Dec 09 2000 - 16:02:27 EET