Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
abarisani committed May 3, 2023
1 parent c270d8a commit b83490d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ module github.com/usbarmory/armory-ums

go 1.19

require (
github.com/usbarmory/tamago v0.0.0-20220915152253-099f7888fe70
)
require github.com/usbarmory/tamago v0.0.0-20230502123508-9ac826d5067f

require (
github.com/usbarmory/crucible v0.0.0-20220823085715-c9e97b45a8b2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/usbarmory/crucible v0.0.0-20220823085715-c9e97b45a8b2 h1:dxJotkRF+Ns8
github.com/usbarmory/crucible v0.0.0-20220823085715-c9e97b45a8b2/go.mod h1:/tDFfTW0y+CtcKzAPmIREQIDpzCuOmLpN8UxHh/iMls=
github.com/usbarmory/tamago v0.0.0-20220915152253-099f7888fe70 h1:a3tyz28TLgDxEJlCM4AQbrWJzJTv5TAs8hyemeaOlRg=
github.com/usbarmory/tamago v0.0.0-20220915152253-099f7888fe70/go.mod h1:Lok79mjbJnhoBGqhX5cCUsZtSemsQF5FNZW+2R1dRr8=
github.com/usbarmory/tamago v0.0.0-20230502123508-9ac826d5067f h1:tSHSAUSV3hcGQ+JwVehjuLUjlc3JXub//HsOZwbagY8=
github.com/usbarmory/tamago v0.0.0-20230502123508-9ac826d5067f/go.mod h1:uCPXcPo8SZulhZPz8irfVqzwVlPZ45w7CTJxkfxueGA=
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak=
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
golang.org/x/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A=
Expand Down
17 changes: 5 additions & 12 deletions usb.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ package main
import (
"bytes"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"strings"

"github.com/usbarmory/tamago/dma"
"github.com/usbarmory/tamago/soc/nxp/imx6ul"
Expand Down Expand Up @@ -53,10 +51,7 @@ func configureDevice(device *usb.Device) {
//
// The serial number format is [0-9A-F]{12,}, the NXP Unique
// ID is converted accordingly.
uid := imx6ul.UniqueID()
serial := strings.ToUpper(hex.EncodeToString(uid[:]))

iSerial, _ := device.AddString(serial)
iSerial, _ := device.AddString(fmt.Sprintf("%X", imx6ul.UniqueID()))
device.Descriptor.SerialNumber = iSerial

conf := &usb.ConfigurationDescriptor{}
Expand All @@ -74,13 +69,11 @@ func buildMassStorageInterface() (iface *usb.InterfaceDescriptor) {
// interface
iface = &usb.InterfaceDescriptor{}
iface.SetDefaults()

iface.NumEndpoints = 2
// Mass Storage
iface.InterfaceClass = 0x8
// SCSI
iface.InterfaceSubClass = 0x6
// Bulk-Only
iface.InterfaceProtocol = 0x50
iface.InterfaceClass = usb.MASS_STORAGE_CLASS
iface.InterfaceSubClass = usb.SCSI_CLASS
iface.InterfaceProtocol = usb.BULK_ONLY_TRANSPORT_PROTOCOL
iface.Interface = 0

// EP1 IN endpoint (bulk)
Expand Down

0 comments on commit b83490d

Please sign in to comment.