hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/macintosh/adb.c
....@@ -163,7 +163,7 @@
163163 * See if anybody actually moved. This is suggested
164164 * by HW TechNote 01:
165165 *
166
- * http://developer.apple.com/technotes/hw/hw_01.html
166
+ * https://developer.apple.com/technotes/hw/hw_01.html
167167 */
168168 adb_request(&req, NULL, ADBREQ_SYNC | ADBREQ_REPLY, 1,
169169 (highFree << 4) | 0xf);
....@@ -203,15 +203,15 @@
203203 }
204204
205205 /* Now fill in the handler_id field of the adb_handler entries. */
206
- pr_debug("adb devices:\n");
207206 for (i = 1; i < 16; i++) {
208207 if (adb_handler[i].original_address == 0)
209208 continue;
210209 adb_request(&req, NULL, ADBREQ_SYNC | ADBREQ_REPLY, 1,
211210 (i << 4) | 0xf);
212211 adb_handler[i].handler_id = req.reply[2];
213
- pr_debug(" [%d]: %d %x\n", i, adb_handler[i].original_address,
214
- adb_handler[i].handler_id);
212
+ printk(KERN_DEBUG "adb device [%d]: %d 0x%X\n", i,
213
+ adb_handler[i].original_address,
214
+ adb_handler[i].handler_id);
215215 devmask |= 1 << i;
216216 }
217217 return devmask;
....@@ -579,6 +579,8 @@
579579 mutex_lock(&adb_handler_mutex);
580580 ret = try_handler_change(address, new_id);
581581 mutex_unlock(&adb_handler_mutex);
582
+ if (ret)
583
+ pr_debug("adb handler change: [%d] 0x%X\n", address, new_id);
582584 return ret;
583585 }
584586 EXPORT_SYMBOL(adb_try_handler_change);
....@@ -645,7 +647,7 @@
645647
646648 switch(req->data[1]) {
647649 case ADB_QUERY_GETDEVINFO:
648
- if (req->nbytes < 3)
650
+ if (req->nbytes < 3 || req->data[2] >= 16)
649651 break;
650652 mutex_lock(&adb_handler_mutex);
651653 req->reply[0] = adb_handler[req->data[2]].original_address;