Skip to content

Commit

Permalink
Import of cgminer-3.7.2.tar.bz2.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtbartle committed Feb 21, 2014
1 parent fe36dcf commit 5819ab8
Show file tree
Hide file tree
Showing 237 changed files with 227,132 additions and 0 deletions.
32 changes: 32 additions & 0 deletions 01-cgminer.rules
@@ -0,0 +1,32 @@
# Butterfly Labs FPGA and ASIC devices
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# ModMinerQuad
ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Lancelot and Avalon
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Icarus
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# AsicminerUSB
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Cairnsmore1
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="0230", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Cairnsmore1-2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8350", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Ztex
ATTRS{idVendor}=="221a", ATTRS{idProduct}=="0100", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# BF1
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204b", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

#Klondike
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f60a", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

#HashFast
ATTRS{idVendor}=="297c", ATTRS{idProduct}=="0001", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev", ENV{ID_MM_DEVICE_IGNORE}="1"
3 changes: 3 additions & 0 deletions ADL_SDK/readme.txt
@@ -0,0 +1,3 @@
Please insert AMD ADL files adl_defines.h adl_sdk.h adl_structures.h here.
They can be found here:
http://developer.amd.com/tools/graphics-development/display-library-adl-sdk/
1,666 changes: 1,666 additions & 0 deletions API-README

Large diffs are not rendered by default.

Binary file added API.class
Binary file not shown.
166 changes: 166 additions & 0 deletions API.java
@@ -0,0 +1,166 @@
/*
*
* Copyright (C) Andrew Smith 2012-2013
*
* Usage: java API command ip port
*
* If any are missing or blank they use the defaults:
*
* command = 'summary'
* ip = '127.0.0.1'
* port = '4028'
*
*/

import java.net.*;
import java.io.*;

class API
{
static private final int MAXRECEIVESIZE = 65535;

static private Socket socket = null;

private void closeAll() throws Exception
{
if (socket != null)
{
socket.close();
socket = null;
}
}

public void display(String result) throws Exception
{
String value;
String name;
String[] sections = result.split("\\|", 0);

for (int i = 0; i < sections.length; i++)
{
if (sections[i].trim().length() > 0)
{
String[] data = sections[i].split(",", 0);

for (int j = 0; j < data.length; j++)
{
String[] nameval = data[j].split("=", 2);

if (j == 0)
{
if (nameval.length > 1
&& Character.isDigit(nameval[1].charAt(0)))
name = nameval[0] + nameval[1];
else
name = nameval[0];

System.out.println("[" + name + "] =>");
System.out.println("(");
}

if (nameval.length > 1)
{
name = nameval[0];
value = nameval[1];
}
else
{
name = "" + j;
value = nameval[0];
}

System.out.println(" ["+name+"] => "+value);
}
System.out.println(")");
}
}
}

public void process(String cmd, InetAddress ip, int port) throws Exception
{
StringBuffer sb = new StringBuffer();
char buf[] = new char[MAXRECEIVESIZE];
int len = 0;

System.out.println("Attempting to send '"+cmd+"' to "+ip.getHostAddress()+":"+port);

try
{
socket = new Socket(ip, port);
PrintStream ps = new PrintStream(socket.getOutputStream());
ps.print(cmd.toLowerCase().toCharArray());
ps.flush();

InputStreamReader isr = new InputStreamReader(socket.getInputStream());
while (0x80085 > 0)
{
len = isr.read(buf, 0, MAXRECEIVESIZE);
if (len < 1)
break;
sb.append(buf, 0, len);
if (buf[len-1] == '\0')
break;
}

closeAll();
}
catch (IOException ioe)
{
System.err.println(ioe.toString());
closeAll();
return;
}

String result = sb.toString();

System.out.println("Answer='"+result+"'");

display(result);
}

public API(String command, String _ip, String _port) throws Exception
{
InetAddress ip;
int port;

try
{
ip = InetAddress.getByName(_ip);
}
catch (UnknownHostException uhe)
{
System.err.println("Unknown host " + _ip + ": " + uhe);
return;
}

try
{
port = Integer.parseInt(_port);
}
catch (NumberFormatException nfe)
{
System.err.println("Invalid port " + _port + ": " + nfe);
return;
}

process(command, ip, port);
}

public static void main(String[] params) throws Exception
{
String command = "summary";
String ip = "127.0.0.1";
String port = "4028";

if (params.length > 0 && params[0].trim().length() > 0)
command = params[0].trim();

if (params.length > 1 && params[1].trim().length() > 0)
ip = params[1].trim();

if (params.length > 2 && params[2].trim().length() > 0)
port = params[2].trim();

new API(command, ip, port);
}
}

0 comments on commit 5819ab8

Please sign in to comment.