HACKING: add chapter on checkpatch
[fw/openocd] / src / jtag / hla / hla_interface.h
index cbeee5a14493ded6aebd884efab05043e11915dc..fa4965806bf857db723d2ec1174ec8e36653c7e1 100644 (file)
@@ -1,28 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
 /***************************************************************************
  *   Copyright (C) 2011 by Mathias Kuester                                 *
  *   Mathias Kuester <kesmtp@freenet.de>                                   *
  *                                                                         *
  *   Copyright (C) 2012 by Spencer Oliver                                  *
  *   spen@spen-soft.co.uk                                                  *
- *                                                                         *
- *   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 of the License, 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; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#ifndef _HL_INTERFACE
-#define _HL_INTERFACE
+#ifndef OPENOCD_JTAG_HLA_HLA_INTERFACE_H
+#define OPENOCD_JTAG_HLA_HLA_INTERFACE_H
 
 /** */
 struct target;
@@ -31,19 +18,25 @@ enum e_hl_transports;
 /** */
 extern const char *hl_transports[];
 
+#define HLA_MAX_USB_IDS 16
+
 struct hl_interface_param_s {
        /** */
-       char *device_desc;
-       /** */
-       char *serial;
+       const char *device_desc;
+       /** List of recognised VIDs */
+       uint16_t vid[HLA_MAX_USB_IDS + 1];
+       /** List of recognised PIDs */
+       uint16_t pid[HLA_MAX_USB_IDS + 1];
        /** */
-       uint16_t vid;
+       enum hl_transports transport;
        /** */
-       uint16_t pid;
+       bool connect_under_reset;
+       /** Initial interface clock clock speed */
+       int initial_interface_speed;
        /** */
-       unsigned api;
+       bool use_stlink_tcp;
        /** */
-       enum hl_transports transport;
+       uint16_t stlink_tcp_port;
 };
 
 struct hl_interface_s {
@@ -52,7 +45,7 @@ struct hl_interface_s {
        /** */
        const struct hl_layout *layout;
        /** */
-       void *fd;
+       void *handle;
 };
 
 /** */
@@ -61,5 +54,6 @@ int hl_interface_open(enum hl_transports tr);
 
 int hl_interface_init_target(struct target *t);
 int hl_interface_init_reset(void);
+int hl_interface_override_target(const char **targetname);
 
-#endif /* _HL_INTERFACE */
+#endif /* OPENOCD_JTAG_HLA_HLA_INTERFACE_H */