hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/firewire/core-iso.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Isochronous I/O functionality:
34 * - Isochronous DMA context management
45 * - Isochronous bus resource management (channels, bandwidth), client side
56 *
67 * Copyright (C) 2006 Kristian Hoegsberg <krh@bitplanet.net>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software Foundation,
20
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
218 */
229
2310 #include <linux/dma-mapping.h>
....@@ -103,24 +90,6 @@
10390 return ret;
10491 }
10592 EXPORT_SYMBOL(fw_iso_buffer_init);
106
-
107
-int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer,
108
- struct vm_area_struct *vma)
109
-{
110
- unsigned long uaddr;
111
- int i, err;
112
-
113
- uaddr = vma->vm_start;
114
- for (i = 0; i < buffer->page_count; i++) {
115
- err = vm_insert_page(vma, uaddr, buffer->pages[i]);
116
- if (err)
117
- return err;
118
-
119
- uaddr += PAGE_SIZE;
120
- }
121
-
122
- return 0;
123
-}
12493
12594 void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
12695 struct fw_card *card)
....@@ -308,7 +277,7 @@
308277 if ((data[0] & bit) == (data[1] & bit))
309278 continue;
310279
311
- /* 1394-1995 IRM, fall through to retry. */
280
+ fallthrough; /* It's a 1394-1995 IRM, retry */
312281 default:
313282 if (retry) {
314283 retry--;
....@@ -337,9 +306,16 @@
337306
338307 /**
339308 * fw_iso_resource_manage() - Allocate or deallocate a channel and/or bandwidth
309
+ * @card: card interface for this action
310
+ * @generation: bus generation
311
+ * @channels_mask: bitmask for channel allocation
312
+ * @channel: pointer for returning channel allocation result
313
+ * @bandwidth: pointer for returning bandwidth allocation result
314
+ * @allocate: whether to allocate (true) or deallocate (false)
340315 *
341316 * In parameters: card, generation, channels_mask, bandwidth, allocate
342317 * Out parameters: channel, bandwidth
318
+ *
343319 * This function blocks (sleeps) during communication with the IRM.
344320 *
345321 * Allocates or deallocates at most one channel out of channels_mask.