Lines Matching +full:data +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0-or-later
24 return sprintf(buf, format_string, rdev->field); \
43 for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size); in routes_show()
45 if (rdev->rswitch->route_table[i] == RIO_INVALID_ROUTE) in routes_show()
49 rdev->rswitch->route_table[i]); in routes_show()
52 return (str - buf); in routes_show()
62 (rdev->prev) ? rio_name(rdev->prev) : "root"); in lprev_show()
73 if (rdev->pef & RIO_PEF_SWITCH) { in lnext_show()
74 for (i = 0; i < RIO_GET_TOTAL_PORTS(rdev->swpinfo); i++) { in lnext_show()
75 if (rdev->rswitch->nextdev[i]) in lnext_show()
77 rio_name(rdev->rswitch->nextdev[i])); in lnext_show()
83 return str - buf; in lnext_show()
93 rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did); in modalias_show()
108 /* Switch-only attributes */
121 unsigned int size = 0x100; in rio_read_config() local
123 u8 *data = (u8 *) buf; in rio_read_config() local
127 size = RIO_MAINT_SPACE_SZ; in rio_read_config()
129 if (off >= size) in rio_read_config()
131 if (off + count > size) { in rio_read_config()
132 size -= off; in rio_read_config()
133 count = size; in rio_read_config()
135 size = count; in rio_read_config()
138 if ((off & 1) && size) { in rio_read_config()
141 data[off - init_off] = val; in rio_read_config()
143 size--; in rio_read_config()
146 if ((off & 3) && size > 2) { in rio_read_config()
149 data[off - init_off] = (val >> 8) & 0xff; in rio_read_config()
150 data[off - init_off + 1] = val & 0xff; in rio_read_config()
152 size -= 2; in rio_read_config()
155 while (size > 3) { in rio_read_config()
158 data[off - init_off] = (val >> 24) & 0xff; in rio_read_config()
159 data[off - init_off + 1] = (val >> 16) & 0xff; in rio_read_config()
160 data[off - init_off + 2] = (val >> 8) & 0xff; in rio_read_config()
161 data[off - init_off + 3] = val & 0xff; in rio_read_config()
163 size -= 4; in rio_read_config()
166 if (size >= 2) { in rio_read_config()
169 data[off - init_off] = (val >> 8) & 0xff; in rio_read_config()
170 data[off - init_off + 1] = val & 0xff; in rio_read_config()
172 size -= 2; in rio_read_config()
175 if (size > 0) { in rio_read_config()
178 data[off - init_off] = val; in rio_read_config()
180 --size; in rio_read_config()
192 unsigned int size = count; in rio_write_config() local
194 u8 *data = (u8 *) buf; in rio_write_config() local
199 size = RIO_MAINT_SPACE_SZ - off; in rio_write_config()
200 count = size; in rio_write_config()
203 if ((off & 1) && size) { in rio_write_config()
204 rio_write_config_8(dev, off, data[off - init_off]); in rio_write_config()
206 size--; in rio_write_config()
209 if ((off & 3) && (size > 2)) { in rio_write_config()
210 u16 val = data[off - init_off + 1]; in rio_write_config()
211 val |= (u16) data[off - init_off] << 8; in rio_write_config()
214 size -= 2; in rio_write_config()
217 while (size > 3) { in rio_write_config()
218 u32 val = data[off - init_off + 3]; in rio_write_config()
219 val |= (u32) data[off - init_off + 2] << 8; in rio_write_config()
220 val |= (u32) data[off - init_off + 1] << 16; in rio_write_config()
221 val |= (u32) data[off - init_off] << 24; in rio_write_config()
224 size -= 4; in rio_write_config()
227 if (size >= 2) { in rio_write_config()
228 u16 val = data[off - init_off + 1]; in rio_write_config()
229 val |= (u16) data[off - init_off] << 8; in rio_write_config()
232 size -= 2; in rio_write_config()
235 if (size) { in rio_write_config()
236 rio_write_config_8(dev, off, data[off - init_off]); in rio_write_config()
238 --size; in rio_write_config()
249 .size = RIO_MAINT_SPACE_SZ,
263 umode_t mode = attr->mode; in rio_dev_is_attr_visible()
265 if (!(rdev->pef & RIO_PEF_SWITCH) && in rio_dev_is_attr_visible()
270 * Hide switch-specific attributes for a non-switch device. in rio_dev_is_attr_visible()
295 return -EINVAL; in scan_store()
303 return -EINVAL; in scan_store()
335 return sprintf(buf, "0x%04x\n", mport->host_deviceid); in port_destid_show()
337 return -ENODEV; in port_destid_show()
347 return sprintf(buf, "%u\n", mport->sys_size); in sys_size_show()
349 return -ENODEV; in sys_size_show()