Print this page
10687 Service routine cast changes need smatch fixes
   1 /*
   2  * sppp.c - Solaris STREAMS PPP multiplexing pseudo-driver
   3  *
   4  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   5  * Use is subject to license terms.
   6  * Copyright (c) 2016 by Delphix. All rights reserved.

   7  *
   8  * Permission to use, copy, modify, and distribute this software and its
   9  * documentation is hereby granted, provided that the above copyright
  10  * notice appears in all copies.
  11  *
  12  * SUN MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY OF
  13  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  SUN SHALL NOT BE LIABLE FOR
  16  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
  18  *
  19  * Copyright (c) 1994 The Australian National University.
  20  * All rights reserved.
  21  *
  22  * Permission to use, copy, modify, and distribute this software and its
  23  * documentation is hereby granted, provided that the above copyright
  24  * notice appears in all copies.  This software is provided without any
  25  * warranty, express or implied. The Australian National University
  26  * makes no representations about the suitability of this software for


1825         return (0);
1826 }
1827 
1828 /*
1829  * sppp_lrsrv()
1830  *
1831  * MT-Perimeters:
1832  *    exclusive inner, shared outer.
1833  *
1834  * Description:
1835  *    Lower read-side service procedure.  This is run once after the I_LINK
1836  *    occurs in order to clean up any packets that came in while we were
1837  *    transferring in the lower stream.  Otherwise, it's not used.
1838  */
1839 int
1840 sppp_lrsrv(queue_t *q)
1841 {
1842         mblk_t *mp;
1843 
1844         while ((mp = getq(q)) != NULL)
1845                 sppp_lrput(q, mp);
1846         return (0);
1847 }
1848 
1849 /*
1850  * sppp_recv_nondata()
1851  *
1852  * MT-Perimeters:
1853  *    shared inner, shared outer.
1854  *
1855  * Description:
1856  *    All received non-data messages come through here.
1857  */
1858 static void
1859 sppp_recv_nondata(queue_t *q, mblk_t *mp, spppstr_t *ctlsps)
1860 {
1861         sppa_t          *ppa;
1862         spppstr_t       *destsps;
1863         struct iocblk   *iop;
1864 
1865         ppa = (sppa_t *)q->q_ptr;


   1 /*
   2  * sppp.c - Solaris STREAMS PPP multiplexing pseudo-driver
   3  *
   4  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   5  * Use is subject to license terms.
   6  * Copyright (c) 2016 by Delphix. All rights reserved.
   7  * Copyright 2019, Joyent, Inc.
   8  *
   9  * Permission to use, copy, modify, and distribute this software and its
  10  * documentation is hereby granted, provided that the above copyright
  11  * notice appears in all copies.
  12  *
  13  * SUN MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY OF
  14  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  15  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  16  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  SUN SHALL NOT BE LIABLE FOR
  17  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  18  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
  19  *
  20  * Copyright (c) 1994 The Australian National University.
  21  * All rights reserved.
  22  *
  23  * Permission to use, copy, modify, and distribute this software and its
  24  * documentation is hereby granted, provided that the above copyright
  25  * notice appears in all copies.  This software is provided without any
  26  * warranty, express or implied. The Australian National University
  27  * makes no representations about the suitability of this software for


1826         return (0);
1827 }
1828 
1829 /*
1830  * sppp_lrsrv()
1831  *
1832  * MT-Perimeters:
1833  *    exclusive inner, shared outer.
1834  *
1835  * Description:
1836  *    Lower read-side service procedure.  This is run once after the I_LINK
1837  *    occurs in order to clean up any packets that came in while we were
1838  *    transferring in the lower stream.  Otherwise, it's not used.
1839  */
1840 int
1841 sppp_lrsrv(queue_t *q)
1842 {
1843         mblk_t *mp;
1844 
1845         while ((mp = getq(q)) != NULL)
1846                 (void) sppp_lrput(q, mp);
1847         return (0);
1848 }
1849 
1850 /*
1851  * sppp_recv_nondata()
1852  *
1853  * MT-Perimeters:
1854  *    shared inner, shared outer.
1855  *
1856  * Description:
1857  *    All received non-data messages come through here.
1858  */
1859 static void
1860 sppp_recv_nondata(queue_t *q, mblk_t *mp, spppstr_t *ctlsps)
1861 {
1862         sppa_t          *ppa;
1863         spppstr_t       *destsps;
1864         struct iocblk   *iop;
1865 
1866         ppa = (sppa_t *)q->q_ptr;