From a8f0c8eac9d7f00f79b16e18be15f1f9ac3a1fad Mon Sep 17 00:00:00 2001 From: Bernd Herzog Date: Sat, 1 Apr 2023 19:24:13 +0200 Subject: [PATCH] refactoring --- firmware/baseband/sd_over_usb/diskio.c | 22 ++++++++++++++++++++ firmware/baseband/sd_over_usb/diskio.h | 22 ++++++++++++++++++++ firmware/baseband/sd_over_usb/scsi.c | 23 ++++++++++++++++++++- firmware/baseband/sd_over_usb/scsi.h | 22 ++++++++++++++++++++ firmware/baseband/sd_over_usb/sd_over_usb.c | 22 ++++++++++++++++++++ firmware/baseband/sd_over_usb/sd_over_usb.h | 5 +++-- 6 files changed, 113 insertions(+), 3 deletions(-) diff --git a/firmware/baseband/sd_over_usb/diskio.c b/firmware/baseband/sd_over_usb/diskio.c index 2417e4a2..e3d5f850 100644 --- a/firmware/baseband/sd_over_usb/diskio.c +++ b/firmware/baseband/sd_over_usb/diskio.c @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #include "diskio.h" #include "ch.h" diff --git a/firmware/baseband/sd_over_usb/diskio.h b/firmware/baseband/sd_over_usb/diskio.h index 7b0cd064..2dde43e7 100644 --- a/firmware/baseband/sd_over_usb/diskio.h +++ b/firmware/baseband/sd_over_usb/diskio.h @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #ifndef __DISKIO_H__ #define __DISKIO_H__ diff --git a/firmware/baseband/sd_over_usb/scsi.c b/firmware/baseband/sd_over_usb/scsi.c index f3e03787..d5d8b386 100644 --- a/firmware/baseband/sd_over_usb/scsi.c +++ b/firmware/baseband/sd_over_usb/scsi.c @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #include "scsi.h" #include "diskio.h" @@ -203,7 +225,6 @@ void scsi_command(msd_cbw_t *msd_cbw_data) { status = handle_inquiry_serial_number(msd_cbw_data); } else if ((msd_cbw_data->cmd_data[1] & 0b11) || msd_cbw_data->cmd_data[2] != 0) { - //TODO: implement sense status = 1; } else { diff --git a/firmware/baseband/sd_over_usb/scsi.h b/firmware/baseband/sd_over_usb/scsi.h index ff399a3d..9381bdff 100644 --- a/firmware/baseband/sd_over_usb/scsi.h +++ b/firmware/baseband/sd_over_usb/scsi.h @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #ifndef __SCSI_H__ #define __SCSI_H__ diff --git a/firmware/baseband/sd_over_usb/sd_over_usb.c b/firmware/baseband/sd_over_usb/sd_over_usb.c index 1d720d98..e2863da5 100644 --- a/firmware/baseband/sd_over_usb/sd_over_usb.c +++ b/firmware/baseband/sd_over_usb/sd_over_usb.c @@ -1,3 +1,25 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + #include "sd_over_usb.h" #include "scsi.h" diff --git a/firmware/baseband/sd_over_usb/sd_over_usb.h b/firmware/baseband/sd_over_usb/sd_over_usb.h index 37e4e229..b886c866 100644 --- a/firmware/baseband/sd_over_usb/sd_over_usb.h +++ b/firmware/baseband/sd_over_usb/sd_over_usb.h @@ -1,7 +1,8 @@ /* - * Copyright 2023 Bernd Herzog + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2023 Bernd Herzog * - * This file is part of HackRF. + * This file is part of PortaPack. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by