Mon Jan 25 19:59:49 2021 UTC ()
s/boolean_t/bool/.  boolean_t is obsolete (from Mach), and this
also fixes a new build issue in libkvm on sparc*.


(mrg)
diff -r1.49 -r1.50 src/sys/dev/ofw/ofw_subr.c
diff -r1.41 -r1.42 src/sys/dev/ofw/openfirm.h
diff -r1.8 -r1.9 src/sys/dev/pci/ixgbe/if_sriov.c

cvs diff -r1.49 -r1.50 src/sys/dev/ofw/ofw_subr.c (expand / switch to unified diff)

--- src/sys/dev/ofw/ofw_subr.c 2021/01/25 12:15:33 1.49
+++ src/sys/dev/ofw/ofw_subr.c 2021/01/25 19:59:49 1.50
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ofw_subr.c,v 1.49 2021/01/25 12:15:33 jmcneill Exp $ */ 1/* $NetBSD: ofw_subr.c,v 1.50 2021/01/25 19:59:49 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright 1998 4 * Copyright 1998
5 * Digital Equipment Corporation. All rights reserved. 5 * Digital Equipment Corporation. All rights reserved.
6 * 6 *
7 * This software is furnished under license and may be used and 7 * This software is furnished under license and may be used and
8 * copied only in accordance with the following terms and conditions. 8 * copied only in accordance with the following terms and conditions.
9 * Subject to these conditions, you may download, copy, install, 9 * Subject to these conditions, you may download, copy, install,
10 * use, modify and distribute this software in source and/or binary 10 * use, modify and distribute this software in source and/or binary
11 * form. No title or ownership is transferred hereby. 11 * form. No title or ownership is transferred hereby.
12 * 12 *
13 * 1) Any source code used, modified or distributed must reproduce 13 * 1) Any source code used, modified or distributed must reproduce
14 * and retain this copyright notice and list of conditions as 14 * and retain this copyright notice and list of conditions as
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * 3) This software is provided "AS-IS" and any express or implied 24 * 3) This software is provided "AS-IS" and any express or implied
25 * warranties, including but not limited to, any implied warranties 25 * warranties, including but not limited to, any implied warranties
26 * of merchantability, fitness for a particular purpose, or 26 * of merchantability, fitness for a particular purpose, or
27 * non-infringement are disclaimed. In no event shall DIGITAL be 27 * non-infringement are disclaimed. In no event shall DIGITAL be
28 * liable for any damages whatsoever, and in particular, DIGITAL 28 * liable for any damages whatsoever, and in particular, DIGITAL
29 * shall not be liable for special, indirect, consequential, or 29 * shall not be liable for special, indirect, consequential, or
30 * incidental damages or damages for lost profits, loss of 30 * incidental damages or damages for lost profits, loss of
31 * revenue or loss of use, whether such damages arise in contract, 31 * revenue or loss of use, whether such damages arise in contract,
32 * negligence, tort, under statute, in equity, at law or otherwise, 32 * negligence, tort, under statute, in equity, at law or otherwise,
33 * even if advised of the possibility of such damage. 33 * even if advised of the possibility of such damage.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.49 2021/01/25 12:15:33 jmcneill Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.50 2021/01/25 19:59:49 mrg Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/kmem.h> 41#include <sys/kmem.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <dev/ofw/openfirm.h> 43#include <dev/ofw/openfirm.h>
44#include <dev/i2c/i2cvar.h> 44#include <dev/i2c/i2cvar.h>
45 45
46#define OFW_MAX_STACK_BUF_SIZE 256 46#define OFW_MAX_STACK_BUF_SIZE 256
47#define OFW_PATH_BUF_SIZE 512 47#define OFW_PATH_BUF_SIZE 512
48 48
49/* 49/*
50 * int of_decode_int(p) 50 * int of_decode_int(p)
@@ -385,43 +385,43 @@ of_getnode_byname(int start, const char  @@ -385,43 +385,43 @@ of_getnode_byname(int start, const char
385 break; 385 break;
386 node = OF_parent(node); 386 node = OF_parent(node);
387 } 387 }
388 } 388 }
389 389
390 /* XXX is this correct? */ 390 /* XXX is this correct? */
391 return node; 391 return node;
392} 392}
393 393
394/* 394/*
395 * Create a uint32_t integer property from an OFW node property. 395 * Create a uint32_t integer property from an OFW node property.
396 */ 396 */
397 397
398boolean_t 398bool
399of_to_uint32_prop(prop_dictionary_t dict, int node, const char *ofname, 399of_to_uint32_prop(prop_dictionary_t dict, int node, const char *ofname,
400 const char *propname) 400 const char *propname)
401{ 401{
402 uint32_t prop; 402 uint32_t prop;
403 403
404 if (OF_getprop(node, ofname, &prop, sizeof(prop)) != sizeof(prop)) 404 if (OF_getprop(node, ofname, &prop, sizeof(prop)) != sizeof(prop))
405 return FALSE; 405 return FALSE;
406 406
407 return(prop_dictionary_set_uint32(dict, propname, prop)); 407 return(prop_dictionary_set_uint32(dict, propname, prop));
408} 408}
409 409
410/* 410/*
411 * Create a data property from an OFW node property. Max size of 256bytes. 411 * Create a data property from an OFW node property. Max size of 256bytes.
412 */ 412 */
413 413
414boolean_t 414bool
415of_to_dataprop(prop_dictionary_t dict, int node, const char *ofname, 415of_to_dataprop(prop_dictionary_t dict, int node, const char *ofname,
416 const char *propname) 416 const char *propname)
417{ 417{
418 int len; 418 int len;
419 uint8_t prop[256]; 419 uint8_t prop[256];
420 420
421 len = OF_getprop(node, ofname, prop, 256); 421 len = OF_getprop(node, ofname, prop, 256);
422 if (len < 1) 422 if (len < 1)
423 return FALSE; 423 return FALSE;
424 424
425 return prop_dictionary_set_data(dict, propname, prop, len); 425 return prop_dictionary_set_data(dict, propname, prop, len);
426} 426}
427 427

cvs diff -r1.41 -r1.42 src/sys/dev/ofw/openfirm.h (expand / switch to unified diff)

--- src/sys/dev/ofw/openfirm.h 2021/01/18 02:35:49 1.41
+++ src/sys/dev/ofw/openfirm.h 2021/01/25 19:59:49 1.42
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: openfirm.h,v 1.41 2021/01/18 02:35:49 thorpej Exp $ */ 1/* $NetBSD: openfirm.h,v 1.42 2021/01/25 19:59:49 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 * Copyright (C) 1995, 1996 TooLs GmbH. 5 * Copyright (C) 1995, 1996 TooLs GmbH.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -105,30 +105,28 @@ int openfirmware(void *); @@ -105,30 +105,28 @@ int openfirmware(void *);
105 */ 105 */
106struct device_compatible_entry; 106struct device_compatible_entry;
107 107
108int of_compatible(int, const char * const *); 108int of_compatible(int, const char * const *);
109int of_match_compatible(int, const char * const *); 109int of_match_compatible(int, const char * const *);
110int of_match_compat_data(int, const struct device_compatible_entry *); 110int of_match_compat_data(int, const struct device_compatible_entry *);
111const struct device_compatible_entry * 111const struct device_compatible_entry *
112 of_search_compatible(int, const struct device_compatible_entry *); 112 of_search_compatible(int, const struct device_compatible_entry *);
113int of_decode_int(const unsigned char *); 113int of_decode_int(const unsigned char *);
114int of_packagename(int, char *, int); 114int of_packagename(int, char *, int);
115int of_find_firstchild_byname(int, const char *); 115int of_find_firstchild_byname(int, const char *);
116int of_find_bycompat(int, const char *); 116int of_find_bycompat(int, const char *);
117int of_getnode_byname(int, const char *); 117int of_getnode_byname(int, const char *);
118boolean_t of_to_uint32_prop(prop_dictionary_t, int, const char *, 118bool of_to_uint32_prop(prop_dictionary_t, int, const char *, const char *);
119 const char *); 119bool of_to_dataprop(prop_dictionary_t, int, const char *, const char *);
120boolean_t of_to_dataprop(prop_dictionary_t, int, const char *, 
121 const char *); 
122 120
123int *of_network_decode_media(int, int *, int *); 121int *of_network_decode_media(int, int *, int *);
124char *of_get_mode_string(char *, int); 122char *of_get_mode_string(char *, int);
125 123
126void of_enter_i2c_devs(prop_dictionary_t, int, size_t, int); 124void of_enter_i2c_devs(prop_dictionary_t, int, size_t, int);
127void of_enter_spi_devs(prop_dictionary_t, int, size_t); 125void of_enter_spi_devs(prop_dictionary_t, int, size_t);
128 126
129bool of_hasprop(int, const char *); 127bool of_hasprop(int, const char *);
130#define of_getprop_bool of_hasprop 128#define of_getprop_bool of_hasprop
131int of_getprop_uint32(int, const char *, uint32_t *); 129int of_getprop_uint32(int, const char *, uint32_t *);
132int of_getprop_uint32_array(int, const char *, uint32_t *, int); 130int of_getprop_uint32_array(int, const char *, uint32_t *, int);
133int of_getprop_uint64(int, const char *, uint64_t *); 131int of_getprop_uint64(int, const char *, uint64_t *);
134 132

cvs diff -r1.8 -r1.9 src/sys/dev/pci/ixgbe/if_sriov.c (expand / switch to unified diff)

--- src/sys/dev/pci/ixgbe/if_sriov.c 2020/09/07 05:50:58 1.8
+++ src/sys/dev/pci/ixgbe/if_sriov.c 2021/01/25 19:59:49 1.9
@@ -109,27 +109,27 @@ static inline void @@ -109,27 +109,27 @@ static inline void
109ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) 109ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
110{ 110{
111 msg &= IXGBE_VT_MSG_MASK; 111 msg &= IXGBE_VT_MSG_MASK;
112 ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK); 112 ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK);
113} 113}
114 114
115static inline void 115static inline void
116ixgbe_process_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf) 116ixgbe_process_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf)
117{ 117{
118 if (!(vf->flags & IXGBE_VF_CTS)) 118 if (!(vf->flags & IXGBE_VF_CTS))
119 ixgbe_send_vf_nack(adapter, vf, 0); 119 ixgbe_send_vf_nack(adapter, vf, 0);
120} 120}
121 121
122static inline boolean_t 122static inline bool
123ixgbe_vf_mac_changed(struct ixgbe_vf *vf, const uint8_t *mac) 123ixgbe_vf_mac_changed(struct ixgbe_vf *vf, const uint8_t *mac)
124{ 124{
125 return (bcmp(mac, vf->ether_addr, ETHER_ADDR_LEN) != 0); 125 return (bcmp(mac, vf->ether_addr, ETHER_ADDR_LEN) != 0);
126} 126}
127 127
128static inline int 128static inline int
129ixgbe_vf_queues(int mode) 129ixgbe_vf_queues(int mode)
130{ 130{
131 switch (mode) { 131 switch (mode) {
132 case IXGBE_64_VM: 132 case IXGBE_64_VM:
133 return (2); 133 return (2);
134 case IXGBE_32_VM: 134 case IXGBE_32_VM:
135 return (4); 135 return (4);
@@ -254,27 +254,27 @@ static void @@ -254,27 +254,27 @@ static void
254ixgbe_clear_vfmbmem(struct ixgbe_hw *hw, struct ixgbe_vf *vf) 254ixgbe_clear_vfmbmem(struct ixgbe_hw *hw, struct ixgbe_vf *vf)
255{ 255{
256 uint32_t vf_index = IXGBE_VF_INDEX(vf->pool); 256 uint32_t vf_index = IXGBE_VF_INDEX(vf->pool);
257 uint16_t mbx_size = hw->mbx.size; 257 uint16_t mbx_size = hw->mbx.size;
258 uint16_t i; 258 uint16_t i;
259 259
260 IXGBE_CORE_LOCK_ASSERT(adapter); 260 IXGBE_CORE_LOCK_ASSERT(adapter);
261 261
262 for (i = 0; i < mbx_size; ++i) 262 for (i = 0; i < mbx_size; ++i)
263 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_index), i, 0x0); 263 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_index), i, 0x0);
264} /* ixgbe_clear_vfmbmem */ 264} /* ixgbe_clear_vfmbmem */
265 265
266 266
267static boolean_t 267static bool
268ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) 268ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf)
269{ 269{
270 270
271 /* 271 /*
272 * Frame size compatibility between PF and VF is only a problem on 272 * Frame size compatibility between PF and VF is only a problem on
273 * 82599-based cards. X540 and later support any combination of jumbo 273 * 82599-based cards. X540 and later support any combination of jumbo
274 * frames on PFs and VFs. 274 * frames on PFs and VFs.
275 */ 275 */
276 if (adapter->hw.mac.type != ixgbe_mac_82599EB) 276 if (adapter->hw.mac.type != ixgbe_mac_82599EB)
277 return (TRUE); 277 return (TRUE);
278 278
279 switch (vf->api_ver) { 279 switch (vf->api_ver) {
280 case IXGBE_API_VER_1_0: 280 case IXGBE_API_VER_1_0: